seNorge: issues with extracting a region from Lussana et al 2018
Added by Michel Mesquita over 5 years ago
Hi,
I am working with a dataset for Norway called "seNorge". I have contacted the main author of a paper describing the data for help, but he does not work with CDO. The paper is here, with a link to the data: [[https://www.earth-syst-sci-data.net/10/235/2018/essd-10-235-2018.pdf]]
The data are given with coordinates in metres (X and Y). I need to extract a region from there using sellonlatbox and then apply other CDO commands (e.g. EOF) to the precipitation data.
However, I get an error message from CDO, since the data are not in a format we often work with in climatology (lat lon in degrees).
The netcdf file says that the projection used in the file is: "+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0"
How can I regrid this type of data to be able to use it with CDO?
Any help is appreciated.
Best regards,
Michel Mesquita
P.S.: I have tried to extract two time steps from the data with CDO to attach here, but it was not possible. I got the following error:
cdo -seltimestep,1,2 seNorge2_PREC1d_dataset_1957_2015.nc seNorge2_PREC1d_dataset_1957_2015_2timesteps.nc
cdf_put_att_double: ncid = 131072 varid = 3 att = _FillValue val = -1
Error (cdf_put_att_double): NetCDF: Not a valid data type or _FillValue type mismatch
HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 0:
#000: H5T.c line 1754 in H5Tclose(): not a datatype
major: Invalid arguments to routine
minor: Inappropriate type
Error (cdf_close): NetCDF: HDF error
Replies (6)
RE: seNorge: issues with extracting a region from Lussana et al 2018 - Added by Ralf Mueller over 5 years ago
hi Michel!
could you upload the data - or at least some sample of it like a singel timestep?
RE: seNorge: issues with extracting a region from Lussana et al 2018 - Added by Michel Mesquita over 5 years ago
Hi Ralf,
The data files can be downloaded here: [[https://doi.org/10.5281/zenodo.845733]]
Thank you!
Best,
Michel
RE: seNorge: issues with extracting a region from Lussana et al 2018 - Added by Uwe Schulzweida over 5 years ago
Hi Michel,
Thanks for the data. This is a bug, we will solve this problem in the next CDO release.
A workaround is to remove the attribute UTM_Zone_33:_FillValue.
And you have to add the attribute UTM_Zone_33:proj4_params in order to interpolate this data with CDO.
This can be done with the NCO tool ncatted:
ncatted -a _FillValue,UTM_Zone_33,d,, -a proj4_params,UTM_Zone_33,c,c,"+proj=utm +zone=33 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0" filenameCheers,
Uwe
RE: seNorge: issues with extracting a region from Lussana et al 2018 - Added by Michel Mesquita over 5 years ago
Dear Uwe,
Thank you so much for helping me out! The command worked well.
I am trying to select a region from these data. So, after running the ncatted command, I tried sellonlatbox, but I still get some error messages. Similarly if I try to use remapbil. For example:
cdo -sellonlatbox,8.4,11.8,62.3,64.0 seNorge2_PREC1d_dataset_1957_2015.nc seNorge2_PREC1d_dataset_1957_2015_box.nc
cdo sellonlatbox: Unsupported grid type: projection
cdo sellonlatbox (Abort): Unsupported grid type!
HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 0:
#000: H5T.c line 1754 in H5Tclose(): not a datatype
major: Invalid arguments to routine
minor: Inappropriate type
Error (cdf_close): NetCDF: HDF error
Or here:
cdo remapbil,n32 seNorge2_PREC1d_dataset_1957_2015.nc seNorge2_dataset_1957_2015/seNorge2_PREC1d_dataset_1957_2015_interpolated.nc
cdf_create : ncid = -1 mode = 4352 chunksizehint = 0 file = INTERPOLATED/seNorge2_dataset_1957_2015/seNorge2_PREC1d_dataset_1957_2015_interpolated.nc
Error (cdf_create): INTERPOLATED/seNorge2_dataset_1957_2015/seNorge2_PREC1d_dataset_1957_2015_interpolated.nc: Permission denied
HDF5-DIAG: Error detected in HDF5 (1.10.5) thread 0:
#000: H5T.c line 1754 in H5Tclose(): not a datatype
major: Invalid arguments to routine
minor: Inappropriate type
Error (cdf_close): NetCDF: HDF error
Cheers,
Michel
RE: seNorge: issues with extracting a region from Lussana et al 2018 - Added by Uwe Schulzweida over 5 years ago
sellonlatbox needs geographical coordinates as input. You can convert your projection to geographical coordinates with "setgridtype,curvilinear":
cdo -sellonlatbox,8.4,11.8,62.3,64.0 -setgridtype,curvilinear seNorge2_PREC1d_dataset_1957_2015.nc seNorge2_PREC1d_dataset_1957_2015_box.nc
The second error message
Error (cdf_create): INTERPOLATED/seNorge2_dataset_1957_2015/seNorge2_PREC1d_dataset_1957_2015_interpolated.nc: Permission deniedsays that you are not allow the create this file. This can have several reasons, possibly one of the folders does not exist.
Cheers,
Uwe
RE: seNorge: issues with extracting a region from Lussana et al 2018 - Added by Michel Mesquita over 5 years ago
Dear Uwe,
Thank you so much for this! I really appreciate it!
Kindest regards,
Michel