netcdfnetcdf4cdo-climate

Normalization data by CDO / NCO


I tried to do normalized data(sfcWind) by the following codes as a new user. But it seems to be the incorrect results. Can anybody correct us

cdo timmax infil.nc Imax.nc

cdo timmin infil.nc Imin.nc

cdo sub Imax.nc Imin.nc A.nc

cdo sub infil.nc Imin.nc B.nc

cdo div A.nc B.nc N_sfcWind.nc

Solution

  • You are dividing the Xmax-Xmin by X-Xmin whereas it should be the other way around (X-Xmin)/(Xmax-Xmin). You also write X.nc and infil.nc and I think they are supposed to be the same thing!

    I also note that this is normalization in time, not in space. If you are running this for space-time fields, that is quite unusual to do, are you sure you don't want to normalize in space? (i.e. fldmax instead of timmax etc).

    If you really want normalization in time then:

    If your data is in in.nc then you would use:

    cdo timmax in.nc max.nc
    cdo timmin in.nc min.nc 
    cdo sub max.nc min.nc diff.nc 
    cdo sub in.nc min.nc wind-min.nc 
    cdo div wind-min.nc diff.nc v_norm.nc 
    

    You can also use piping to make this shorter

    cdo sub -timmax in.nx -timmin in.nc diff.nc 
    cdo div -sub in.nc -timmin in.nc diff.nc norm.nc 
    

    If the data is compressed then you also need to use -b f32 to convert to float and prevent an error.