Project

General

Profile

Get coordinates of the nearest grid point

Added by Daniel Fenner over 10 years ago

Hello,

I have a gridded dataset and want to compare it with observational data. I understand that I can get the values from the grid point nearest to my observations for example, with

cdo remapnn,lon=10.55_lat=40.64 ifile ofile

This works perfectly fine and extracts the data from the grid point closest to the given lon/lat (10.55/40.64) and the timeseries is written in ofile. However, I would like to know which grid point was used in remapnn, i.e. the coordinates of the (original) grid point. Is there a simple way to get that information?

Cheers,

Daniel


Replies (4)

RE: Get coordinates of the nearest grid point - Added by Uwe Schulzweida over 10 years ago

Hi Daniel,

There is no way to get the coordinates of the original grid, sorry,

Cheers,
Uwe

RE: Get coordinates of the nearest grid point - Added by Daniel Fenner over 10 years ago

Hi Uwe,

thanks for your reply, though it was not the answer I was looking for...

But thanks anyway!

Cheers,
Daniel

RE: Get coordinates of the nearest grid point - Added by joao ferreira about 8 years ago

Uwe,

I agree this could be a major upgrade to CDO...

Is there a workaround to get it?

Or are there any developments in the latest version of CDO?

In the 1.7.0 manual the outputtab have an option for outputting the Grid x index and the Grid y index. These are xind and yind. However using it, I always get xind=1 and yind=1 regardless of
remapnn,lon=10.55_lat=40.64 or remapnn,lon=20.55_lat=50.64.

That is:

cdo -outputtab,xind,yind,value -remapnn,lon=-10_lat=45 wrf_d04.nc

cdo -outputtab,xind,yind,value -remapnn,lon=-8_lat=48 wrf_d04.nc

gives the same wrong xind and yind of 1

Cheers
Joao

RE: Get coordinates of the nearest grid point - Added by joao ferreira about 8 years ago

I got it

xind and yind being 1 is not an error... it's the index in the output grid and since I asked for one point only then (1,1) is correct.

Still no information on the original grid... A pitty...

Joao

    (1-4/4)