Project

General

Profile

How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees

Added by Amit Kumar about 7 years ago

Hi all,

I'm trying to convert a curvilinear grid dataset into a lonlat grid dataset with grid size 2.5 degree. The resolution of curvilinear dataset is pixel level i.e. at nadir it is 4km but away it increases. Now for doing this I want to interpolate the curvilinear dataset by using remapdis but I want to change the search radius to 1.25 degrees. please help how to do it.

The output of sinfo of curvilinear file

File format : netCDF4 ZIP
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown IMAGER instant 1 1 7898880 1 I16z : -1
2 : unknown IMAGER instant 1 1 7898880 1 F32z : -2
Grid coordinates :
1 : curvilinear : points=7898880 (2805x2816)
Longitude : 0.84 to 327.67 degrees_east
Latitude : -81.04 to 327.67 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 2000-01-01 00:00:00 Units = minutes Calendar = standard
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
0412-12-19 01:46:32
cdo sinfo: Processed 2 variables over 1 timestep ( 0.22s )

the grid i want to use:
gridtype = lonlat

gridsize = 525

xname = lon

xlongname = longitude

xunits = degrees_east

yname = lat

ylongname = latitude

yunits = degrees_north

xsize = 25

ysize = 21

xfirst = 40

xinc = 2.5

yfirst = -20

yinc = 2.5


Replies (12)

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Ralf Mueller about 7 years ago

Try

cdo remapdis,griddes.txt <inputfile> <outputfile>

where griddes.txt contains

gridtype = lonlat
gridsize = 525
xname = lon
xlongname = longitude
xunits = degrees_east
yname = lat
ylongname = latitude
yunits = degrees_north
xsize = 25
ysize = 21
xfirst = 40
xinc = 2.5
yfirst = -20
yinc = 2.5

If the results or sufficient for you, you have to decide yourself.

hth
ralf

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Amit Kumar about 7 years ago

Hi Ralf,

I have done this but the issue is that I'm not able to change the default grid search radius from 180 degrees to 1.25 degrees.

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Amit Kumar about 7 years ago

Hi Ralf,

Actually the size of data was exceeding the limit so i've used sellonlatbox to cut it down. I'm uploading the smaller file.

cdo sellonlatbox,-20,20,60,90 W_OLR_INT.nc W_OLR_INT_CUT.nc

cdo sinfo W_OLR_INT_CUT.nc

File format : netCDF4
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown IMAGER instant 1 1 22148 1 F32 : -1
Grid coordinates :
1 : curvilinear : points=22148 (226x98)
Longitude : 10.42 to 327.67 degrees_east
Latitude : 55.41 to 327.67 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 2000-01-01 00:00:00 Units = minutes Calendar = standard
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
0412-12-19 01:46:32
cdo sinfo: Processed 1 variable over 1 timestep ( 0.01s )

now i want to regrid it to a lonlat grid using remapdis, but i want to use grid search radius as 1.25 degrees instead of default 180 degrees.

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Amit Kumar about 7 years ago

Hi Ralf,

By mistake i interchanged lat and lon values in sellonlatbox in the previous upload. I'm reattaching the file after doing correction.

cdo sellonlatbox,60,90,-20,20 W_OLR_INT.nc W_OLR_INT_CUT.nc

cdo sinfo W_OLR_INT_CUT.nc
File format : netCDF4
-1 : Institut Source Ttype Levels Num Points Num Dtype : Parameter ID
1 : unknown IMAGER instant 1 1 864821 1 F32 : -1
Grid coordinates :
1 : curvilinear : points=864821 (809x1069)
Longitude : 58.18 to 90.6 degrees_east
Latitude : -20.32 to 20.32 degrees_north
Vertical coordinates :
1 : surface : levels=1
Time coordinate : 1 step
RefTime = 2000-01-01 00:00:00 Units = minutes Calendar = standard
YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss YYYY-MM-DD hh:mm:ss
0412-12-19 01:46:32
cdo sinfo: Processed 1 variable over 1 timestep ( 0.07s )

now i want to regrid it to a lonlat grid using remapdis, but i want to use grid search radius as 1.25 degrees instead of default 180 degrees.

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Ralf Mueller about 7 years ago

ok, here is what I did

cdo remapdis,gd W_OLR_INT_CUT.nc plainDis.nc
CDO_GRIDSEARCH_RADIUS=1.25 cdo -v remapdis,gd W_OLR_INT_CUT.nc Radius1.25_Dis.nc

Bilinear remapping works, too

cdo -v remapbil,gd W_OLR_INT_CUT.nc plainBilinear.nc

your original data looks like this:

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Amit Kumar about 7 years ago

Hi Ralf,

Thanks for your quick reply.

I have one doubt, in plainDIS interpolation the search radius is 180 degrees and in Radius1.25_Dis search radius is 1.25, then why both files have same values at the grid points. There should be a difference as the number of points used for interpolation in Radius1.25_Dis should be less than plainDIS.

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Ralf Mueller about 7 years ago

some clarification:

  • the grid description fully describes the location of grid points. If you want to change THIS, you have to use a different grid
  • interpolation methods (dis,bil, Radius to look for data) controls, what data is written to a grid point, I you lower the radius, less data values will be taken into account for compute the target value.

in your case the reduction of the radius leads to missing values, because some (outer) target locations are not covered with source data (wrt radius):

<ram@luthien:~/Downloads>
% cdo infov Radius1.25_Dis.nc
    -1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name
     1 : 0412-12-19 01:46:32       0      525     300 :      182.38      269.88      330.20 : OLR_INT       
cdo infon: Processed 525 values from 1 variable over 1 timestep ( 0.00s )
<ram@luthien:~/Downloads>
% cdo infov plainDis.nc
    -1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name
     1 : 0412-12-19 01:46:32       0      525       0 :      182.38      277.08      330.20 : OLR_INT       
cdo infon: Processed 525 values from 1 variable over 1 timestep ( 0.00s )

as you can see: missing values with smaller radius. you can see them with ncview very easily.

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Ralf Mueller about 7 years ago

your original data does not fit in to a regular lonlat box, so your will have missing values for a small (enough) raduis

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Amit Kumar about 7 years ago

exactly ralf, when the search radius is reduced then the number of points taken in consideration should reduce, but in this case take any point where values are available, either in center or corners they are having same values of OLR in both plainDIS and Radius1.25_Dis files, they show no difference because of change in search radius.

RE: How to interpolate data on curvilinear grid using remapdis into a lonlat grid with search radius 1.25 degrees - Added by Ralf Mueller about 7 years ago

Now I see, I thought you wondered about the equal horizontal grids.

I can confirm that behaviour, i.e. the equality of the inner values in both regridded files. Have to look it up - to me, it does not look correct or even desirable.

cheers
ralf

    (1-12/12)