Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Size of netCDF files can be further reduced by compression e.g.
    cdo -f nc4c -z zip_6 copy h14_2019053000_r.grib h14_2019053000_compressed.nc
  • To convert multiple files from bash to netCDF, you can loop over all the files in the directory and apply the commands above e.g.



for file in *.grib; do cdo -R remapcon,r1600x800 -setgridtype,regular "$file" "$file".reg; done #To convert to regular grid

for file in *.reg; do cdo -f nc copy "$file" "$file".nc; done #To convert regular grib files to netCDF 

for file in *.nc; do cdo -sellonlatbox,5,19,36,48 "$file" "$file"_italy; done #To extract Italian domain