<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">If you are planning to use PDEF BILIN, then <font class="Apple-style-span" color="#FF0000">the i, j, and rotation grids are floating point grids</font>, 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. </span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">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: </span></font></div><div><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">"T</span></font><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">he </span></font><em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">num</span></font></em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> 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 </span></font><em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">num, </span></font></em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">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. </span></font><font class="Apple-style-span" color="#FF0000"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">The first grid contains integer values, the second grid contains floating-point values.</span></font></font><font class="Apple-style-span" color="#FF0000"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> Finally, the supplementary data file must also contain one grid of floating-point wind rotation values. Thus if </span></font></font><em><font class="Apple-style-span" color="#FF0000"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">num</span></font></font></em><font class="Apple-style-span" color="#FF0000"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> equals 1, there will be 3 grids in </span></font></font><em><font class="Apple-style-span" color="#FF0000"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">fname</span></font></font></em><font class="Apple-style-span" color="#FF0000"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">.</span></font></font><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> If </span></font><em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">num</span></font></em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> equals 3, there will be 7 grids in</span></font><em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">fname</span></font></em><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"> (3 sets of 2 grids plus the wind rotation grid)."</span></font></span></div><div><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif; "><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;">--Jennifer</span></font></span></div><div><font class="Apple-style-span" face="Arial, Helvetica, sans-serif"><font class="Apple-style-span" size="4"><span class="Apple-style-span" style="font-size: 14px;"><br></span></font></font></div><div><font class="Apple-style-span" face="Arial, Helvetica, sans-serif" size="3"><span class="Apple-style-span" style="font-size: 13px;"><br></span></font></div><div><div>On Sep 30, 2009, at 9:51 AM, Reto Stauffer wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Dear Usergroup<br><br>A few weeks ago you sent me a wonderful hint about the topic "Variable Grid<br>possible?" (you can see the answers below).<br>I did some web-research but i could not find any good help topics.<br><br>What i understood (about the PDEF function):<br>- I have a data matrix (data-value, longitude, latitude) (for ex. 10x5)<br>- I have a GrADS-internal regular Grid, for example XDEF 5 LINEAR 0 10, YDEF 3<br>LINEAR 0 10 (-> 5x3)<br>- I compute a interpolation matrix wich describes wich value (from my original<br>10x5 matrix) should be plotted in my regular grid (5x3). So my i and j matrix<br>need to have the same dimension like my regular grid (5x3). There is also a<br>third matrix (only one-point-interpolation) wich contains my wind rotation<br>values (5x3).<br><br>In the documentation is written that i have to store the three matrices<br>(i,j,windrotation) into a binary file. But witch binary file type and wich<br>structure? I was also afraid because i could not find any example-datasets in<br>the internet.<br><br>Does any of you have a better description for the PDEF function or a<br>sample-dataset wich show the features of this PDEF function?<br><br>It would be great if someone could help me.<br><br>Greetings<br>Reto Stauffer, Austria<br><br><br><br>--------------------------------------------------<br>--------------------------------------------------<br>--------------------------------------------------<br><br><br><br>Am 10.09.2009 um 20:00 schrieb Jennifer Adams:<br><br>That kind of data grid (with 2-dimensional coordinate variables) doesn't fit the<br>current gridded data model in GrADS. We have talked about implementing a new<br>data model, quasi-regular data, that would fall somewhere in between regular<br>grids and station data. But that is not likely to be implemented any time soon.<br>For now, interpolating to a regular grid with PDEF is the only way to handle<br>that kind of data directly using GrADS.<br>--Jennifer<br><br>On Sep 10, 2009, at 11:37 AM, Christopher Lynnes wrote:<br><br>Jennifer,<br> The PDEF GENERAL capability looks quite useful, but made me wonder<br>if GrADS does or will support variable grids in netCDF, where the data<br>are defined according to the CF-1 convention for two-dimensional<br>latitude and longitude coordinate variables<br>(<a href="http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.4/cf-conventions.html#id2984605">http://cf-pcmdi.llnl.gov/documents/cf-conventions/1.4/cf-conventions.html#id2984605</a><br>).<br> We have a service to convert our AIRS swath data to netCDF files<br>with this convention, which allows tools such as IDV and McIDAS-V to<br>read and project them. However, attempting an sdfopen in grads<br>2.0.a7.1 leads to the "no discernable X coordinate" error.<br> An example file can be obtained via the URL:<br><a href="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">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</a><br><br>On Sep 10, 2009, at 7:58 AM, Jennifer Adams wrote:<br><br>You can use the PDEF GENERAL (aka PDEF FILE) option to tell GrADS<br>how to map each grid point in your 1-D vector into a 2-D lat/lon<br>grid. Please see http://www.iges.org/grads/gadoc/pdef.html<br>The example at the bottom of the page does something very similar to<br>what you'd like to do.<br>--Jennifer<br><br>On Sep 9, 2009, at 7:03 AM, Reto Stauffer wrote:<br><br>Hy there<br><br>I try to plot some Satellite-Data with Grads. It was "no problem"<br>to produce a<br>netCDF file wich i can import into GrADS and display the test-<br>dataset.<br><br>But now i have a question up to you. Normaly GrADS plots only onto<br>a linear<br>Grid. My netCDF-File only contains a one-line-vector with longitude<br>and<br>latitude boundries.<br><br>Is there any possibility to import long/lat as a 2-D matrix wich<br>discribes my<br>own grid? I cannot found any good information about that.<br><br>Test-Dataset, int [0;10] with own colormap:<br>http://dudecom.ch/satpress/wp-content/uploads/2009/09/20090909_grads_colormapexample-543x400.png<br><br>If anyone has an idea it wold be great to send me a request.<br><br>Best regards<br>Reto, Austria<br><br>--<br>Jennifer M. Adams<br>IGES/COLA<br>4041 Powder Mill Road, Suite 302<br>Calverton, MD 20705<br>jma@cola.iges.org<br><br><br><br><br>--<br>Christopher Lynnes NASA/GSFC, Code 610.2<br>301-614-5185<br><br>--<br>Jennifer M. Adams<br>IGES/COLA<br>4041 Powder Mill Road, Suite 302<br>Calverton, MD 20705<br>jma@cola.iges.org<br></div></blockquote></div><br><div apple-content-edited="true"> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div>--</div><div>Jennifer M. Adams</div><div>IGES/COLA</div><div>4041 Powder Mill Road, Suite 302</div><div>Calverton, MD 20705</div><div><a href="mailto:jma@cola.iges.org">jma@cola.iges.org</a></div><div><br class="khtml-block-placeholder"></div><br class="Apple-interchange-newline"></span></span></div></span> </div><br></body></html>