Hi Tijn-
The sample on a 2D grid takes a LatLonPoint and you are passing in an
EarthLocation. you can call:
location.getLatLonPoint()
to get the LatLon position.
Don
Valentijn Venus wrote:
Hi,
I'm trying to sample at user-specified lat/lon in a 2D grid. Any ideas
to enhance as indicated in the comments below:
def getValueAtLocation(fieldimpl) :
"""Extract a value from a 3D grid at "Location." Enhance so it will
work
On 2D gridded datasets too
level is a makeEarthLocation; must be appropriate for the grid.
param fieldimpl is a grid which may have one or more time steps.
"""
from ucar.unidata.idv.control.DisplayControlBase import
makeEarthLocation
location = makeEarthLocation(10.000, 104.0, 0)
# lat/lon/alt should be supplied as a field of points loaded as csv
using
# the visad text-adaptor/ESRI shapefile
print location
ff = GridUtil.sample(fieldimpl, location)
# works NOT on a 2D grid (only on 3D), is there an equivalent for
2D's?
print ff # works
return ff # return doesn't work yet, why?
Cheers, Tyn
International Institute for Geo-Information Science and Earth Observation (ITC)
Chamber of Commerce: 410 27 560
E-mail disclaimer
The information in this e-mail, including any attachments, is intended for the
addressee only. If you are not the intended recipient, you are hereby notified
that any disclosure, copying, distribution or action in relation to the content
of this information is strictly prohibited. If you have received this e-mail by
mistake, please delete the message and any attachment and inform the sender by
return e-mail. ITC accepts no liability for any error or omission in the
message content or for damage of any kind that may arise as a result of e-mail
transmission.
_______________________________________________
idvdevelopers mailing list
idvdevelopers@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit: http://www.unidata.ucar.edu/mailing_lists/
--
*************************************************************
Don Murray UCAR Unidata Program
dmurray@xxxxxxxxxxxxxxxx P.O. Box 3000
(303) 497-8628 Boulder, CO 80307
http://www.unidata.ucar.edu/staff/donm
*************************************************************