Re: GRIBCoordinateSystem

Luke,

An often confusing aspect to the GRIB projection definition is that "Ni"
refers to the Longitude Axis and "Nj" refers to the "Latitude Axis".  Note
this is inconsistent with the VISAD documentation included below, depending
on how you read "latitude circle".

In any case, I believe you want:

> CoordinateSystem
>         coordinateSystem
>             new MapProjectionAdapter(new GRIBCoordinateSystem(0,
>               360, 180, -90, -180, 90, 180, 1, 1));

(I changed the 15's to 1's based on your subsequent message).

Also, based on the GRIB spec, Di (longitude increment) and Dj (latitude
increment) are in MILLIDEGREES, so you might also try changing the last two
arguments to 1000 (again note that this is in conflict with the VISAD
documentation).

Take my recommendations with a grain of salt as I am speaking purely from a
GRIB experience perspective - I have no knowledge of the
GRIBCoordinateSystem implementation.

Good Luck!

Steve
----- Original Message -----
From: "Luke A. Catania (TEC)" <lcatania@xxxxxxxxxxxx>
To: "Don Murray" <dmurray@xxxxxxxxxxxxxxxx>; "Luke A. Catania (TEC)"
<lcatania@xxxxxxxxxxxx>
Sent: Tuesday, June 04, 2002 8:34 PM
Subject: GRIBCoordinateSystem


> I am using the code MapProjectionDisplay Trying to create a Mercator or
> Rectangular projection.  I think that is what this constructor does.  I
> tried using:
>
> CoordinateSystem
>         coordinateSystem
>             new MapProjectionAdapter(new GRIBCoordinateSystem(0,
>               180, 360, -90, -180, 90, 180, 15, 15));
>
> But not sure if I am using the GRIBCoordinateSystem class correctly.  The
> help for this shows a second set of lat lons, but does not say what they
> are.  I assume they are the last grid point since the la1 and lo1 are the
> first.
>
> When my display comes up, the map is scrunched really small in the lower
> left of the display box.
>
> GRIBCoordinateSystem
> public GRIBCoordinateSystem(int gridTypeCode,
>                             int Ni,
>                             int Nj,
>                             double La1,
>                             double Lo1,
>                             double La2,
>                             double Lo2,
>                             double Di,
>                             double Dj)
>                      throws VisADException
> Constructor for a latitude-longitude (GRIB type code = 0) with
> RealTupleType.LatitudeLongitudeTuple as a reference.
> Parameters:
> Ni - number of points along a latitude circle
> Nj - number of points along a longitude circle
> La1 - latitude of first grid point (degrees)
> Lo1 - longitude of first grid point (degrees)
> Di - longitudinal direction increment (degrees)
> Dj - latitudinal direction increment (degrees)
> Throws:
> VisADException - couldn't create the necessary VisAD object
>
>
> -----Original Message-----
> From: Don Murray [mailto:dmurray@xxxxxxxxxxxxxxxx]
> Sent: Friday, May 24, 2002 10:23 AM
> To: Luke A. Catania (TEC)
> Cc: Bill Hibbard; visad-list@xxxxxxxxxxxxx
> Subject: Re: MetApps ShapefileAdapter
>
> Luke-
>
> "Luke A. Catania (TEC)" wrote:
> >
> > Is there a way to use a map projection with VisAD?   If so  there
example
> > code?? After using the DisplayImplJ3D, I was able to get the map of the
> > world shape file displayed, but it does not look correct because of the
> lack
> > of a map projection.
>
> As Bill mentioned, we use a Display side CS in MetApps.
> See ucar.unidata.view.geoloc.MapProjectionDisplay.  This
> will take either a visad.georef.MapProjection or a
> ucar.unidata.geoloc.Projection as input to set the background
> projection.  For a version of MapProjectionDisplay that
> uses vanilla VisAD (i.e. no Unidata classes), see:
>
> ftp://ftp.unidata.ucar.edu/pub/dmurray/MapProjectionDisplay.java
>
> This does not allow you to change projections, though whereas
> ucar.unidata.view.geoloc.MapProjectionDisplay does allow changes
> by creating a new DisplayRealTupleType with each change.
>
> Don
> *************************************************************
> Don Murray                               UCAR Unidata Program
> dmurray@xxxxxxxxxxxxxxxx                        P.O. Box 3000
> (303) 497-8628                              Boulder, CO 80307
> http://www.unidata.ucar.edu/staff/donm
> *************************************************************