Project

General

Profile

sellevel retains singleton dimension

Added by Gabriel Abrahao over 6 years ago

Hello,

This is only a suggestion. I frequently have trouble using CDO output directly (without further processing before e.g. plotting) because it is unable to discard a singleton level dimension in operators such as sellevel and sellevidx. The same goes for time selection in operators such as seltimestep. It would be greatly useful if the --reduce_dim also worked with such operators, not just with the timstat ones.

Thanks for the great work,
Gabriel


Replies (3)

RE: sellevel retains singleton dimension - Added by Uwe Schulzweida over 6 years ago

Hello Gabriel,

Thanks for your suggestion! The option --reduce_dim will be available for all CDO operators in the next release. A prerelease for testing is available in the download area.

Cheers,
Uwe

RE: sellevel retains singleton dimension - Added by Gabriel Abrahao over 6 years ago

Hello again Uwe,

The current version (1.9.1rc1) worked greatly with operators sellevel, sellevidx and seltimestep and --reduce_dim. Thanks a lot!

It should be noted, however, that sellevel also deletes any data (non-coordinate) variable from the dataset that doesn't have a level dimension. This shouldn't be an issue as its only a matter of proper chaining, but I pointed out because that's not the behavior of sellevidx, which retains all variables in the dataset, only removing the level coordinate variable. In case you feel this is actually an issue, there are three files attached, the base file (file_base) with variables wspd and temp and the result of each of the two operators. Note the missing temp variable in file_sellevel.

Again, thanks a lot for your great work,
Gabriel

file_sellevel.nc (2.97 MB) file_sellevel.nc File after --reduce_dim sellevel (missing temp variable)
file_sellevidx.nc (5.94 MB) file_sellevidx.nc File after --reduce_dim sellevidx
file_base.nc (5.94 MB) file_base.nc Base file

RE: sellevel retains singleton dimension - Added by Uwe Schulzweida over 6 years ago

Hello Gabriel,

Thanks for your feedback!
sellevidx refers more to the CDO internal data model and not directly to the external representation (netcdf).
Here are the first lines of the sinfon output:

   File format : NetCDF
    -1 : Institut Source   Steptype Levels Num    Points Num Dtype : Parameter name
     1 : unknown  unknown  instant       1   1     64800   1  F32  : wspd          
     2 : unknown  unknown  instant       1   2     64800   1  F32  : temp          
   Grid coordinates :
     1 : lonlat                   : points=64800 (360x180)
                        longitude : -179.75 to 179.749 by 1.00139 degrees_east
                         latitude : 89.5 to -89.5 by -1 degrees_north
   Vertical coordinates :
     1 : generic                  : levels=1
                              lev : 992.528 hybrid_sigma
     2 : surface                  : levels=1
The data variable temp has 1 level with the value zero. All data variables without level information have still the level index 1.

Cheers,
Uwe

    (1-3/3)