remapcon on EASE-Grid
Added by liren wei almost 2 years ago
Hello everyone,
I want to conver the my NSIDC snow_cover_fraction dataset, which is EASE-Grid-2.0 projection, into lat-lon 1x1deg grid. For the sake of accuracy, I have to use the conservation regrid (remapcon in cdo). The following part describes the grid of NSIDC dataset:
gridtype = curvilinear
gridsize = 518400
datatype = float
xsize = 720
ysize = 720
xname = longitude
xdimname = cols
xlongname = "longitude of cell center in EASE-Grid-2.0"
xunits = "degrees_east"
yname = latitude
ydimname = rows
ylongname = "latitude of cell center in EASE-Grid-2.0"
yunits = "degrees_north"
xvals = -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999
...
scanningMode = 64
gridtype = projection
gridsize = 518400
xsize = 720
ysize = 720
xname = cols
xunits = "meters"
yname = rows
yunits = "meters"
xfirst = -8987500
xinc = 25000
yfirst = 8987500
yinc = -25000
scanningMode = 64
grid_mapping = coord_system
grid_mapping_name = lambert_azimuthal_equal_area
comment = "EASE-Grid-2.0 projection definition documention: http://nsidc.org/data/ease/ease_grid2.html, NSIDC mapx grid parameter definition file: EASE2_N25km.gpd, grid_id: EASE2_N25km"
longitude_of_projection_origin = 0.f
latitude_of_projection_origin = 90.f
false_easting = 0.f
false_northing = 0.f
scale_factor_at_projection_origin = 25
semimajor_axis = 6378137.f
semiminor_axis = 6356752.f
inverse_flattening = 298.2572f
Firstly, I tried to regrid the netCDF directly but it shows:
$ cdo remapcon,grid.txt NSIDC.nc test.nc
cdo remapcon (Abort): Source grid cell corner coordinates missing!
Then I tried to reset the grid by using "-setgrid"
$ cdo remapcon,grid.txt -setgrid,src_grid.txt NSIDC.nc test.nc
This command takes a long time and has no output (such as a progress bar). By the way, the "src_grid.txt" file are generated by "cdo griddes" so it looks like the same as above netCDF description. I don't know how can I solve this problem now.
Thanks in advance to the people that will answer me.
Replies (3)
RE: remapcon on EASE-Grid - Added by Estanislao Gavilan almost 2 years ago
Hi,
remapcon requires the xbounds and ybounds values in your grid text file (see 1.5.2.4. CDO grids in Documentation). You can also find a example in the appendix D (i.e. Grid description examples)
Kind regards,
Estanislao
RE: remapcon on EASE-Grid - Added by Uwe Schulzweida almost 2 years ago
It looks like the geographical coordinates have some missing values. This is not supported by the interpolation in CDO.
xvals = -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999 -999CDO uses the PROJ library to calculate geographic coordinates from a projection. The best solution is to use the proj_param attribute to specify all the necessary projections parameters.
For the EASE-Grid-2.0 I found them in Appendix C of https://www.mdpi.com/2220-9964/1/1/32/htm. For the projection at the North Pole the attribute looks like this:
proj_params="+proj=laea +rf=298.2572 +lon_0=0 +lat_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m"
The complete CDO grid file is then:
gridtype = projection xsize = 720 ysize = 720 xunits = "meters" yunits = "meters" xfirst = -8987500 xinc = 25000 yfirst = 8987500 yinc = -25000 grid_mapping = coord_system grid_mapping_name = lambert_azimuthal_equal_area proj_params="+proj=laea +rf=298.2572 +lon_0=0 +lat_0=90 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m
RE: remapcon on EASE-Grid - Added by liren wei almost 2 years ago
Thank you very much! This method has completely solved my problem.
In order to help people who also encounter similar problems, I will add some new information. In fact, I have tried to write a CDO grid file by setting the "gridtype = projection" (just as your last CDO grid file) but CDO takes a long time and has no output. This may result from the incorrect "xfirst" and "yfirst" value. It may be helpful to check the output of the last few lines of the commend "cdo griddes".