Project

General

Profile

Setgrid for CORDEX was-44

Added by Gianluca Franceschini over 3 years ago

Good morning
I am trying to display CORDEX datasets downloaded from an ESGF node, in latlong coordinates. The dataset contains both latlong and rotated coordinates. However, if I try to display the netCDF in a GIS the latlong coordinates seems not valid (in Arcgis, using the "Make NetCDF Raster Layer" reports an error of "One or both dimensions have variable spacing in their coordinate values"). I tried then to use the Setgrid command to set the grid to latlon. To get the grid template I used the griddes command and also looked at the sinfon results and setting parameters manually. Both of the method seems not to work fine, if I overlay the resulting netcdf with a country boundary (a shift of pixels is evident). The sinfon results is the following:

: points=25090 (193x130)
lon : 19.86421 to 115.5312 by 0.4179501 degrees_east
lat : -15.23163 to 45.25 by 0.4377272 degrees_north
mapping : rotated_latitude_longitude
rlon : -32.12 to 52.36 by 0.44 degrees
rlat : -21.56 to 35.2 by 0.44 degrees

I also calculated by hand the correct spacing of pixels I should enter dividing the range of coordinates with number of pixels:
gridtype = lonlat
gridsize = 25090
xsize = 193
ysize = 130
xfirst = 19.86421
xinc = 0.495684
yfirst = -15.23163
yinc = 0.465243

This result is actually the better but If I display the necdf with a country boundary I still see some pixels of shifts.

Can anyone explain (again) the logic to use the setgrid correctly?

Thanks!!

Gianluca


Replies (2)

RE: Setgrid for CORDEX was-44 - Added by Karin Meier-Fleischer over 3 years ago

Hi Gianluca,

I don't have experience with Arcgis but if the error message says there are coordinate values with different spacing, it seems to me that Arcgis is not able to handle curvilinear data. You can remap the data to a regular lonlat grid with

cdo -remapbil,r820x410 tasmax_WAS-44_NCC-NorESM1-M_historical_r1i1p1_SMHI-RCA4_v2_day_19510101-19551231.nc outfile.nc

-Karin

RE: Setgrid for CORDEX was-44 - Added by Gianluca Franceschini over 3 years ago

Thanks a lot!! It worked fine

    (1-2/2)