Nearest Neighbor

Sestak, Michael L CIV 63134 michael.l.sestak at NAVY.MIL
Thu Sep 18 10:57:26 EDT 2008


My guess, NAM is lambert conformal.  If you use a pdef specifying the projection, grads will always interpolate to lat/lon space, therefore you will always have problems with non-integer values in the results if you start from categorical 0/1 grids.  

If the calculation part of your work does not need to know about the projection, then you could create a control file that just treats the data as a rectangular grid (no projection information), do the calculations, write the results to a file, then open using a control file with the correct pdef for plotting.  

Also my guess, grib2ctl will read the projection out of the grib header, so it will take some manual editing of the control file it produces to get this to work.  And if your calculation needs projection information (like you are doing area averages), this won't work.  

If it is available to you, you might also look into pygrads.  It may be able to do calculations on the native grids without the interpolation that grads does.



From: Walsh, Brian J
Sent: Thu 9/18/2008 6:35
To: GRADSUSR at LIST.CINECA.IT
Subject: Nearest Neighbor


Hello,

I'm trying to extract data from a NAM model grid, but I am getting values between 0 and 1 for the categorical rain, snow, freezing rain and ice pellets.  This appears to be an issue with interpolation and I need it to get data from the nearest neighbor point.  The question is, how do I do this?  I tried adding an argument to the grib2ctl.pl script, but this didn't work.  Any ideas would be helpful.

Thanks,

Brian
The information contained in this e-mail is intended only for the individual or entity to whom it is addressed. 
Its contents (including any attachments) may contain confidential and/or privileged information. 
If you are not an intended recipient you must not use, disclose, disseminate, copy or print its contents. 
If you receive this e-mail in error, please notify the sender by reply e-mail and delete and destroy the message.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20080918/255ee6fc/attachment.html 


More information about the gradsusr mailing list