Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding
Added by Naveen Pothula over 5 years ago
Hi all,
I am interpolating a.nc file which is on rotated curvilinear grid of 0.4179501 degree x 0.4377272 degree to .5 degree x .5 degree. The grid domain is the south Asian domain.
For this I though that I would use thr following two commands
cdo setgrid,mi a.nc out1.nc, where mi is the source grid that I have given below
cdo remapbil, mibil out1.nc out2.nc, where mibil is the target grid which I have given below.
mi grid is defined as
gridtype = curvilinear
gridsize = 25090
xname = lon
xlongname = longitude
xunits = degrees_east
yname = lat
ylongname = latitude
yunits = degrees_north
xsize = 193
ysize = 130
xfirst = 19.86421
xinc = 0.4179501
yfirst = -15.23163
yinc = 0.4377272
But when I processed the first command cdo setgrid, mi a.nc out1.nc and saw the grid information using griddes, it was understood that the grid type is not curvilinear and its is shown as generic, so I could not proceed further.
how to solve this, I am attaching the input file a.nc here. Kindly help :-)
The sinfo of a.nc is
File format : NetCDF4 classic zip
-1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter ID
1 : unknown unknown v instant 1 1 25090 1 F32z : -1
Grid coordinates :
1 : curvilinear : 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
Vertical coordinates :
1 : height : levels=1 scalar
height : 2 m
Time coordinate : 1825 steps
RefTime = 1949-12-01 00:00:00 Units = days Calendar = 365_day Bounds = true
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
1951-01-01 12:00:00 1951-01-02 12:00:00 1951-01-03 12:00:00 1951-01-04 12:00:00
1951-01-05 12:00:00 1951-01-06 12:00:00 1951-01-07 12:00:00 1951-01-08 12:00:00
Replies (10)
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Naveen Pothula over 5 years ago
The interpolation has to be on un rotated geographical lonlat 0.5 x o.5 grids, a correction in the first line of my question.
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Ralf Mueller over 5 years ago
hi Naveen!
I checked your upload and it looks fine - no need to attache any grid information to it since CDO already understands it, I think:
cdo sinfov a.nc [Wed 2019-04-24|15:37:12] File format : NetCDF4 classic zip -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown unknown v instant 1 1 25090 1 F32z : tasmin Grid coordinates : 1 : curvilinear : points=25090 (193x130) lon : 19.86421 to 115.5312 degrees_east lat : -15.23163 to 45.25 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 Vertical coordinates : 1 : height : levels=1 scalar height : 2 m Time coordinate : 1825 steps RefTime = 1949-12-01 00:00:00 Units = days Calendar = 365_day Bounds = true YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss 1951-01-01 12:00:00 1951-01-02 12:00:00 1951-01-03 12:00:00 1951-01-04 12:00:00 1951-01-05 12:00:00 1951-01-06 12:00:00 1951-01-07 12:00:00 1951-01-08 12:00:00 1951-01-09 12:00:00 1951-01-10 12:00:00 1951-01-11 12:00:00 1951-01-12 12:00:00 1951-01-13 12:00:00 1951-01-14 12:00:00 1951-01-15 12:00:00 1951-01-16 12:00:00 1951-01-17 12:00:00 1951-01-18 12:00:00 1951-01-19 12:00:00 1951-01-20 12:00:00 1951-01-21 12:00:00 1951-01-22 12:00:00 1951-01-23 12:00:00 1951-01-24 12:00:00 1951-01-25 12:00:00 1951-01-26 12:00:00 1951-01-27 12:00:00 1951-01-28 12:00:00 1951-01-29 12:00:00 1951-01-30 12:00:00 1951-01-31 12:00:00 1951-02-01 12:00:00 1951-02-02 12:00:00 1951-02-03 12:00:00 1951-02-04 12:00:00 1951-02-05 12:00:00 1951-02-06 12:00:00 1951-02-07 12:00:00 1951-02-08 12:00:00 1951-02-09 12:00:00 1951-02-10 12:00:00 1951-02-11 12:00:00 1951-02-12 12:00:00 1951-02-13 12:00:00 1951-02-14 12:00:00 1951-02-15 12:00:00 1951-02-16 12:00:00 1951-02-17 12:00:00 1951-02-18 12:00:00 1951-02-19 12:00:00 1951-02-20 12:00:00 1951-02-21 12:00:00 1951-02-22 12:00:00 1951-02-23 12:00:00 1951-02-24 12:00:00 1951-02-25 12:00:00 1951-02-26 12:00:00 1951-02-27 12:00:00 1951-02-28 12:00:00 1951-03-01 12:00:00 ................................................................................ ................................................................................ ......... 1955-11-05 12:00:00 1955-11-06 12:00:00 1955-11-07 12:00:00 1955-11-08 12:00:00 1955-11-09 12:00:00 1955-11-10 12:00:00 1955-11-11 12:00:00 1955-11-12 12:00:00 1955-11-13 12:00:00 1955-11-14 12:00:00 1955-11-15 12:00:00 1955-11-16 12:00:00 1955-11-17 12:00:00 1955-11-18 12:00:00 1955-11-19 12:00:00 1955-11-20 12:00:00 1955-11-21 12:00:00 1955-11-22 12:00:00 1955-11-23 12:00:00 1955-11-24 12:00:00 1955-11-25 12:00:00 1955-11-26 12:00:00 1955-11-27 12:00:00 1955-11-28 12:00:00 1955-11-29 12:00:00 1955-11-30 12:00:00 1955-12-01 12:00:00 1955-12-02 12:00:00 1955-12-03 12:00:00 1955-12-04 12:00:00 1955-12-05 12:00:00 1955-12-06 12:00:00 1955-12-07 12:00:00 1955-12-08 12:00:00 1955-12-09 12:00:00 1955-12-10 12:00:00 1955-12-11 12:00:00 1955-12-12 12:00:00 1955-12-13 12:00:00 1955-12-14 12:00:00 1955-12-15 12:00:00 1955-12-16 12:00:00 1955-12-17 12:00:00 1955-12-18 12:00:00 1955-12-19 12:00:00 1955-12-20 12:00:00 1955-12-21 12:00:00 1955-12-22 12:00:00 1955-12-23 12:00:00 1955-12-24 12:00:00 1955-12-25 12:00:00 1955-12-26 12:00:00 1955-12-27 12:00:00 1955-12-28 12:00:00 1955-12-29 12:00:00 1955-12-30 12:00:00 1955-12-31 12:00:00 cdo sinfon: Processed 1 variable over 1825 timesteps [0.07s 50MB]
I curvilinear grids, a griddes with only xinc
and yinc
is not enough - this would fit to a regular grid. check the griddes of a.nc with CDO
cdo griddes a.ncI uploaded it for comparison with your CDO release
For interpolation to a global half-degree grid, you can call
cdo -remapbil,global_0.5 a.nc haldDeg_a.nc
hth
ralf
a.nc.griddes (964 KB) a.nc.griddes |
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Naveen Pothula over 5 years ago
Dear Ralf,
I understand from your post that there is no need to attach any grid information to a.nc as it is having already the curvilinear grid, but in rotated mapping and cdo can directly understand it. I got some doubts kindly explain.
You said
curvilinear grids, a griddes with only xinc and yinc is not enough - this would fit to a regular grid. check the griddes of a.nc with CDO
I did not get the point.
I want to explain what I want to do once again below:
Actually I am having a file a.nc, which is in rotated curvilinear grids for a region, but not for the entire globe. I want to get interpolated a.nc file for the same region in unrotated lonlat grids at a resolution of 0.5 x 0.5.
Question 1: can I use the command cdo -remapbil,global_0.5 a.nc haldDeg_a.nc
As you mentioned above with out using setgrid and then do bilinear interpolation.
Question 2:
I think global_0.5 grids is the grid description for the entire globe; can I use it to interpolate the grids for a region or should I select grids within that region and then interpolate.
I
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Ralf Mueller over 5 years ago
ok, now I see. sorry for the misunderstanding. I thought you wanted to interpolate to regular half-degree grid.
The short answer is "No". CDO cannot generate a 0.5 deg version of your input grid. you have to create griddes file similar to the output of cdo griddes a.nc
yourself, sorry. Maybe the people from the Rossby Centre where the original data seem to come from know a good tool for that.
hth
ralf
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Naveen Pothula over 5 years ago
Hi ralf,
Can I use setgrid and then remapbil to the grid of 0.5 x 0.5, that I want.
When I used setgrid the output has a generic grid, as I mentioned in my first post.
cdo setgrid,mi a.nc out1.nc, where mi is the grid definition that I have given below, It is prepared from the information present in the a.nc file.
gridtype = curvilinear
gridsize = 25090
xname = lon
xlongname = longitude
xunits = degrees_east
yname = lat
ylongname = latitude
yunits = degrees_north
xsize = 193
ysize = 130
xfirst = 19.86421
xinc = 0.4179501
yfirst = -15.23163
yinc = 0.4377272
Is the problem with the grid definition I am using or is it that setgrid can not be used for this file.
best,
naveen
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Ralf Mueller over 5 years ago
the grid definition is not sufficient. for curvilinear grids you need to specify xvals
and yvals
. the CDO command
cdo setgrid,mi a.nc out1.ncdidn't not fail because the grid description is technically applicable to the input file, but the output has nothing to do with what you intended to do. lon/lat are lost in the output.
My recommondation is to ask the people that created the file for the a proper grid description for your target grid. this doesn't have to be a text file, you also use a netcdf file with a data variable on your grid. With that kind of thing, it should be straight forward to perform a horizontal interpolation of the rest of your data with CDO.
cheers
ralf
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Karin Meier-Fleischer over 5 years ago
What about the following way?
To get the unrotated latlon values
cdo sinfo a.nc File format : NetCDF4 classic zip -1 : Institut Source T Steptype Levels Num Points Num Dtype : Parameter name 1 : unknown unknown v instant 1 1 25090 1 F32z : tasmin Grid coordinates : 1 : curvilinear : points=25090 (193x130) lon : 19.86421 to 115.5312 degrees_east <-- unrotated lon min/max values lat : -15.23163 to 45.25 degrees_north <-- unrotated lat min/max values mapping : rotated_latitude_longitude rlon : -32.12 to 52.36 by 0.44 degrees rlat : -21.56 to 35.2 by 0.44 degrees ...
Remap the data to 0.5x0.5 latlon grid
cdo -L -sellonlatbox,19.86421,115.5312,-15.23163,45.25 -remapbil,global_0.5 a.nc a_out_region.nc
-Karin
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Naveen Pothula over 5 years ago
Dear ralf,
I have downloaded another .nc file with regular lonlat grid from the SMHI for the same South Asian Grid; but it is slightly different grid, i.e., it has different Xfirst and Y first as given below obtained from by cdo griddes w.nc.
Can I use it as target grid and directly remapbil using that w.nc file with out resorting to setgrid and unrotating to curvilinear grids.
Also kindly comment on what Karin mentioned above.
Thanks,
Best regards to both of you,
naveen
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Naveen Pothula over 5 years ago
The target grid file is w.nc, which I am attaching wit this message; kindly go through it. But time frequency is month for this and the variable is Tasmax.
My question can I remapbil the a.nc which is in rotated curvilinear grid to the lonlat grid of w.nc with out unrotating and then regridding it or redefining the grid of a.nc.
best,
naveen
RE: Grid shown as generic on using setgrid command while processing Cordex data of South Asian domain-regarding - Added by Karin Meier-Fleischer over 5 years ago
cdo remapbil,w.nc a.nc a_remap_with_w.nc
-Karin