How to convert lonlat grid to gaussian grid
Added by Delei Li almost 5 years ago
Hello,
I am trying to convert a netcdf file (attached file) with lonlat grid to gaussian grid by using command:
cdo remapcon,t511grid 20170101UV.nc tmp.nc
However, the output file is a global one. If I use sellonlatbox to select the region I want, it becomes lonlat grid again. I wonder is there any method to convert it to the region I want with gaussian grid?
Many thanks,
Delei
20170101UV.nc (498 KB) 20170101UV.nc |
Replies (3)
RE: How to convert lonlat grid to gaussian grid - Added by Karin Meier-Fleischer almost 5 years ago
Hi Delei,
I can reproduce the problem and get a lonlat grid, too. But as workaround you can use NCO's ncks to extract a region from a reduced gaussian grid which stays as reduced gaussian grid.
Remap the data to gobal gaussian grid T511
cdo remapcon,T511grid 20170101UV.nc 20170101UV_T511grid_global.nc
For example, extract the region lon=0-180 and lat=0-90 from global gaussian grid
ncks -O -d lat,0.,90. -d lon,0.,180. 20170101UV_T511grid_global.nc 20170101UV_T511grid_subregion.nc
-Karin
RE: How to convert lonlat grid to gaussian grid - Added by Delei Li almost 5 years ago
Dear Karin,
I tried you method and found that the subtracted data is still in lonlat gridtype (use cdo griddes 20170101UV_T511grid_subregion.nc ). But thanks anyway for your kind answer.
Regards,
Delei
RE: How to convert lonlat grid to gaussian grid - Added by Uwe Schulzweida almost 5 years ago
A Gaussian grid is not defined in the NetCDF CF convention. It is stored as a regular lon/lat grid.
When CDO is reading such coordinates it analyses the latitudes to find out whether they are Gaussian or not.
This is possible only for global Gaussian grids.
If you select a region with sellonlatbox or ncks the coordinates are stored correctly. But CDO can't use it as a Gaussian grid anymore.
This shouldn't be a problem in CDO, because all operators which are working on Gaussian grids need them global.