Project

General

Profile

problem in extarcting data using a mask

Added by Blanka Bartok over 5 years ago

Hi,

I have a problem with extracting values using a mask. I have .nc file with monthly wind energy indexes (values between 0 an 0.9), 12 timesteps for the whole Euro-Cordex region. I would like to extract values only for Austria. I also have a mask .nc file, values 1 over Austria.
After multiplying my data with the mask (cdo mul index_100_bc_wfdei_sfcWind_EUR-11_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_SMHI-RCA4.nc mask_AUT.nc index_AUT.nc) the result contains only the first timestep, the name of the variables is mask instead of sfcWindAdjust.
Could somebody help me to extract values for all the 12 timesteps? Thank you.


Replies (2)

RE: problem in extarcting data using a mask - Added by Uwe Schulzweida over 5 years ago

The lon and lat coordinate in mask_AUT.nc are not recognized correctly because of a missing coordinate attribute. Therefor they are handled as data variables in CDO (see output of sinfon). You have to either add the coordinates attribute:

ncatted -a coordinates,mask,c,c,"lon lat" mask_AUT.nc
or select only the mask variable from the mask_AUT.nc file:
cdo mul index_100_bc_wfdei_sfcWind_EUR-11_CNRM-CERFACS-CNRM-CM5_rcp85_r1i1p1_SMHI-RCA4.nc -selname,mask mask_AUT.nc index_AUT.nc

RE: problem in extarcting data using a mask - Added by Blanka Bartok over 5 years ago

Super, both solutions work, very simple.
Thanks a lot for the quick help!!!

Blanka

    (1-2/2)