Variable Grid possible?
Jennifer Adams
jma at COLA.IGES.ORG
Wed Sep 30 10:22:47 EDT 2009
If you are planning to use PDEF BILIN, then the i, j, and rotation
grids are floating point grids, sized according to the XDEF and YDEF
records in your descriptor file (in your example, 5x3). The format can
be sequential or stream, and the byte order can be big or little-
endian -- whatever is easier for you to create. The format specs are
provided by you in the PDEF BILIN entry of your descriptor file. With
PDEF BILIN, the i and j values you provide are assumed to be non-
integers, and four nearest neighbors are bi-linearly interpolated to
get the value for each grid point in your rectilinear grid.
If you want to use one-point interpolation (map a single grid point in
the native grid to a location in the rectilinear grid), then use PDEF
GENERAL with the "num" argument equal to 1. In this case, your three
grids will contain index values (not i or j but i*isize+j), weights
(all 1's), and rotation values. From the PDEF doc:
"The num argument in the PDEF GENERAL entry specifies the number of
native grid points that will be used to calcuate each interpolated
rectilinear grid point value. For each num, the supplementary data
file will contain two grids -- both will be the size of the
rectilinear grid (as defined by XDEF and YDEF). The first grid
contains the index or offset values that point to the native grid
value that will be used in the interpolation; the second grid contains
the weights for those native grid values. The first grid contains
integer values, the second grid contains floating-point values.
Finally, the supplementary data file must also contain one grid of
floating-point wind rotation values. Thus if num equals 1, there will
be 3 grids in fname. If num equals 3, there will be 7 grids infname (3
sets of 2 grids plus the wind rotation grid)."
--Jennifer
On Sep 30, 2009, at 9:51 AM, Reto Stauffer wrote:
> Dear Usergroup
>
> A few weeks ago you sent me a wonderful hint about the topic
> "Variable Grid
> possible?" (you can see the answers below).
> I did some web-research but i could not find any good help topics.
>
> What i understood (about the PDEF function):
> - I have a data matrix (data-value, longitude, latitude) (for ex.
> 10x5)
> - I have a GrADS-internal regular Grid, for example XDEF 5 LINEAR 0
> 10, YDEF 3
> LINEAR 0 10 (-> 5x3)
> - I compute a interpolation matrix wich describes wich value (from
> my original
> 10x5 matrix) should be plotted in my regular grid (5x3). So my i and
> j matrix
> need to have the same dimension like my regular grid (5x3). There is
> also a
> third matrix (only one-point-interpolation) wich contains my wind
> rotation
> values (5x3).
>
> In the documentation is written that i have to store the three
> matrices
> (i,j,windrotation) into a binary file. But witch binary file type
> and wich
> structure? I was also afraid because i could not find any example-
> datasets in
> the internet.
>
> Does any of you have a better description for the PDEF function or a
> sample-dataset wich show the features of this PDEF function?
>
> It would be great if someone could help me.
>
> Greetings
> Reto Stauffer, Austria
>
>
>
> --------------------------------------------------
> --------------------------------------------------
> --------------------------------------------------
>
>
>
> Am 10.09.2009 um 20:00 schrieb Jennifer Adams:
>
> That kind of data grid (with 2-dimensional coordinate variables)
> doesn't fit the
> current gridded data model in GrADS. We have talked about
> implementing a new
> data model, quasi-regular data, that would fall somewhere in between
> regular
> grids and station data. But that is not likely to be implemented any
> time soon.
> For now, interpolating to a regular grid with PDEF is the only way
> to handle
> that kind of data directly using GrADS.
> --Jennifer
>
> On Sep 10, 2009, at 11:37 AM, Christopher Lynnes wrote:
>
> Jennifer,
> The PDEF GENERAL capability looks quite useful, but made me wonder
> if GrADS does or will support variable grids in netCDF, where the data
> are defined according to the CF-1 convention for two-dimensional
> latitude and longitude coordinate variables
> (http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.4/cf-conventions.html#id2984605
> ).
> We have a service to convert our AIRS swath data to netCDF files
> with this convention, which allows tools such as IDV and McIDAS-V to
> read and project them. However, attempting an sdfopen in grads
> 2.0.a7.1 leads to the "no discernable X coordinate" error.
> An example file can be obtained via the URL:
> http://aurapar2u.ecs.nasa.gov/airspar1/daac-bin/OTF/HTTP_services.cgi?FILENAME=%2Fdata%2Fs4pa%2FAqua_AIRS_Level2%2FAIRX2RET.005%2F2006%2F161%2FAIRS.2006.06.10.202.L2.RetStd.v5.0.14.0.G07345043455.hdf&LABEL=AIRS.2006.06.10.202.L2.RetStd.v5.0.14.0.G07345043455.nc&SHORTNAME=AIRX2RET&SERVICE=NetCDF&VERSION=1.02
>
> On Sep 10, 2009, at 7:58 AM, Jennifer Adams wrote:
>
> You can use the PDEF GENERAL (aka PDEF FILE) option to tell GrADS
> how to map each grid point in your 1-D vector into a 2-D lat/lon
> grid. Please see http://www.iges.org/grads/gadoc/pdef.html
> The example at the bottom of the page does something very similar to
> what you'd like to do.
> --Jennifer
>
> On Sep 9, 2009, at 7:03 AM, Reto Stauffer wrote:
>
> Hy there
>
> I try to plot some Satellite-Data with Grads. It was "no problem"
> to produce a
> netCDF file wich i can import into GrADS and display the test-
> dataset.
>
> But now i have a question up to you. Normaly GrADS plots only onto
> a linear
> Grid. My netCDF-File only contains a one-line-vector with longitude
> and
> latitude boundries.
>
> Is there any possibility to import long/lat as a 2-D matrix wich
> discribes my
> own grid? I cannot found any good information about that.
>
> Test-Dataset, int [0;10] with own colormap:
> http://dudecom.ch/satpress/wp-content/uploads/2009/09/20090909_grads_colormapexample-543x400.png
>
> If anyone has an idea it wold be great to send me a request.
>
> Best regards
> Reto, Austria
>
> --
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705
> jma at cola.iges.org
>
>
>
>
> --
> Christopher Lynnes NASA/GSFC, Code 610.2
> 301-614-5185
>
> --
> Jennifer M. Adams
> IGES/COLA
> 4041 Powder Mill Road, Suite 302
> Calverton, MD 20705
> jma at cola.iges.org
--
Jennifer M. Adams
IGES/COLA
4041 Powder Mill Road, Suite 302
Calverton, MD 20705
jma at cola.iges.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20090930/1831db6f/attachment.html
More information about the gradsusr
mailing list