Remapping from UTM32 to lon-lat
Added by Mark Payne 18 days ago
Hi,
The attached netcdf dataset is derived from an observational product here at DMI that is on a regular UTM32 grid. I would like to regrid this to some other grid, using a regular 1x1 degree grid as an example in this case. The command that I have used is:
cdo remapnn,global_1 sample.nc foo.nc
cdo remapnn (Abort): Unsupported projection coordinates (Variable: tas)!
What is going on here? Does CDO not support regridding with UTM? Is there anything I can do to make this work?
Note - I have made the metadata myself, with an attempt to follow CF conventions, with a lot of help from Chat. I (we) may be missing some key elements that are causing the problem.
Best wishes,
Mark
Replies (7)
RE: Remapping from UTM32 to lon-lat - Added by Karin Meier-Fleischer 18 days ago
With version 2.4.4 it works good.
RE: Remapping from UTM32 to lon-lat - Added by Mark Payne 17 days ago
<blush> You're right. I was flipping back and forth between 1.99 rc1 and 2.4.4 without realising it, which created the bug. Apologies.
RE: Remapping from UTM32 to lon-lat - Added by Lina Neunhäuserer 4 days ago
I just experienced the same problem as Mark above. Using
cdo remapnn,lonlat_grid O3_utm32_hour01_day01_mon01.nc O3_lonlat_hour01_day01_mon01.nc
resulted in
cdo remapnn (Abort): Unsupported projection coordinates (Variable: O3)!
As I am using cdo version 2.5 (ubuntu) I cannot figure out what is going wrong here. Any support would be highly appreciated.
Best regards, Lina
lonlat_grid (136 Bytes) lonlat_grid | |||
O3_utm32_hour01_day01_mon01.nc (2.19 MB) O3_utm32_hour01_day01_mon01.nc |
RE: Remapping from UTM32 to lon-lat - Added by Karin Meier-Fleischer 4 days ago
The used projection is UTM32 so you have to add the proj string to the grid description as follows.
First get the grid description from O3_utm32_hour01_day01_mon01.nc:
cdo griddes O3_utm32_hour01_day01_mon01.nc > gridfile_UTM32.txt
Add the proj_params string to gridfile_UTM32.txt:
gridtype = projection gridsize = 570500 xsize = 652 ysize = 875 xname = x xunits = "meter " yname = y yunits = "meter " xfirst = 275500 xinc = 1000 yfirst = 5231500 yinc = 1000 grid_mapping = crs grid_mapping_name = transverse_mercator semi_major_axis = 6378137. inverse_flattening = 298.257223563 scale_factor_at_central_meridian = 0.9996 longitude_of_central_meridian = 9. latitude_of_projection_origin = 0. false_easting = 500000. false_northing = 0. proj_params = "+proj=utm +zone=32 +north +datum=WGS84 +ellps=GRS80 +lat_0=0 +lon_0=9 +k_0=0.9996 +x_0=500000 +y_0=0 +units=m"
Then you can remap the data to your lonlat_grid:
cdo -remapnn,lonlat_grid -setgrid,gridfile_UTM32.txt O3_utm32_hour01_day01_mon01.nc outfile.nc
This works with CDO 2.4.4
RE: Remapping from UTM32 to lon-lat - Added by Lina Neunhäuserer 3 days ago
Thanks a lot! Adding the proj_params was the missing point, with them it works fine, even with cdo 1.9.10.
Best regards, Lina
RE: Remapping from UTM32 to lon-lat - Added by Uwe Schulzweida 3 days ago
You can set the proj_params attribute directly with setprojparams since CDO release 2.4.0:
cdo setprojparams,"+proj=utm +zone=32 +north +datum=WGS84 +ellps=GRS80 +lat_0=0 +lon_0=9 +k_0=0.9996 +x_0=500000 +y_0=0 +units=m" infile outfile or cdo -remapnn,lonlat_grid \ -setprojparams,"+proj=utm +zone=32 +north +datum=WGS84 +ellps=GRS80 +lat_0=0 +lon_0=9 +k_0=0.9996 +x_0=500000 +y_0=0 +units=m" \ infile outfile
RE: Remapping from UTM32 to lon-lat - Added by Karin Meier-Fleischer 3 days ago
@Uwe: Thanks for the hint