Search code examples
hourextrapolationnco

Extract monthly data from hourly resoluted netcdf file in nco


As the title indicates, I want to extract a time period e.g january for a variable, wind_speed, from a .nc file that consists of wind speeds with 3-hourly resolution during one year. I would like to do this in nco if possible.

I tried the following method: ncrcat -O -F -d time,1,248 -v wind_speed sfcWind.nc out.nc and it works. For this method I need to calculate the time span during the chosen month. Is there any other method in nco where one can specify the month and get the corresponding data?

Another thing is that if one wants data for dec, jan, feb then this method cannot be used, or at least to my knowledge. Any suggestions here?

Best Smail


Solution

  • NCO supports multislabs, i.e., multiple time hyperslabs in one command. With this you can group together arbitrary months, and the --msa switch will keep them in order. The manual is your friend.