Project

General

Profile

Remapping issue

Added by matteo borgnino over 2 years ago

Hi, I have a netcdf file with a curvilinear grid. However the grid is centered at the equator, despite it represent a different geographic area.
How can I map the data on the correct position? I have correct lonlat info in the output of cdo griddes. I attach the output
thanks in advance

grid.txt (7.74 KB) grid.txt grid file

Replies (3)

RE: Remapping issue - Added by Karin Meier-Fleischer over 2 years ago

Hi Matteo,

your data is on a rotated curvilinear grid. Did you take a look at the metadata with ncdump -h infile.nc ? It shows you the coordinates and variables metadata. There should be lon, lat, rlon and rlat as well. The variables should have the dimensions e.g. variable(time,rlat,rlon) and a coordinates attribute set to "lon lat" then most programs can map the data correctly.

-Karin

RE: Remapping issue - Added by matteo borgnino over 2 years ago

Hi Karin,
thank you for your answer.

The output of ncdump -h is
dimensions:
time = UNLIMITED ; // (3 currently)
bnds = 2 ;
rlon = 20 ;
rlat = 17 ;
variables:
double time(time) ;
time:standard_name = "time" ;
time:long_name = "time" ;
time:bounds = "time_bnds" ;
time:units = "hours since 2018-01-01 00:00:00" ;
time:calendar = "proleptic_gregorian" ;
time:axis = "T" ;
double time_bnds(time, bnds) ;
float lon(rlat, rlon) ;
lon:standard_name = "longitude" ;
lon:long_name = "longitude" ;
lon:units = "degrees_east" ;
lon:_CoordinateAxisType = "Lon" ;
float lat(rlat, rlon) ;
lat:standard_name = "latitude" ;
lat:long_name = "latitude" ;
lat:units = "degrees_north" ;
lat:_CoordinateAxisType = "Lat" ;
double rlon(rlon) ;
rlon:standard_name = "grid_longitude" ;
rlon:long_name = "rotated longitude" ;
rlon:units = "degrees" ;
rlon:axis = "X" ;
double rlat(rlat) ;
rlat:standard_name = "grid_latitude" ;
rlat:long_name = "rotated latitude" ;
rlat:units = "degrees" ;
rlat:axis = "Y" ;
int crs ;
crs:grid_north_pole_latitude = 47. ;
crs:grid_north_pole_longitude = -168. ;
crs:grid_mapping_name = "rotated_latitude_longitude" ;
float height_2m ;
height_2m:standard_name = "height" ;
height_2m:long_name = "height above the surface" ;
height_2m:units = "m" ;
height_2m:positive = "up" ;
height_2m:axis = "Z" ;
float AEVAP_S(time, rlat, rlon) ;
AEVAP_S:standard_name = "water_evaporation_amount" ;
AEVAP_S:long_name = "surface evaporation" ;
AEVAP_S:units = "kg m-2" ;
AEVAP_S:grid_mapping = "crs" ;
AEVAP_S:coordinates = "lat lon" ;
AEVAP_S:_FillValue = NaNf ;
AEVAP_S:missing_value = NaNf ;
AEVAP_S:cell_methods = "time: sum" ;
AEVAP_S:__ddsapi_name = "water_evaporation_amount" ;

I have both variables rlat, rlon and lat,lon. Is there a way with cdo to put the data on the lon lat position instead of rlon, rlat?
thanks!

RE: Remapping issue - Added by Karin Meier-Fleischer over 2 years ago

Because the data is on a curvilinear grid (lon and lat are 2D arrays), you can't just exchange the coordinate variables.
But you can remap the data to a lonlat grid using the remap operators (see https://code.mpimet.mpg.de/projects/cdo/embedded/cdo.pdf#subsection.2.12.8).

For example to a global 0.5deg grid

cdo -remapbil,global_0.5 infile outfile

    (1-3/3)