comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Finding pixel values of NETCDF image based on lat/lon
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Finding pixel values of NETCDF image based on lat/lon [message #89078 is a reply to message #89077] Tue, 22 July 2014 23:44 Go to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 23.07.2014 08:04, Marta Yebra wrote:
> Do I need to convert the NETCDF to GEOTIFF?

No!

In your example you write:

> sites = my_data.Name_site
> Lat_sites=my_data.Lat
> Lon_sites=my_data.Lon
> find_lon=where(Lon EQ Lon_sites, countlon)
> find_lat=where(Lat EQ Lat_sites, countLat)

There are two problems here:
- the EQ operator does not work when the arrays are of different length
- as you point out, where() cannot work since what you really need is
the coordinates of the nearest grid point

For this, several options are available, depending on what you want to
do (interpolate the gridded data to your point? Take the nearest grid
point) and depending on whether or not the lon/lat grid in your netcdf
file is regular or not...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Maxwell equation solver in IDL
Next Topic: IDL Training

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:12:32 PDT 2025

Total time taken to generate the page: 0.00449 seconds