NetCDF Operators: Difference between revisions
From BAWiki
imported>Schade Peter (Reduction of a NetCDF file along its dimensions) |
Peter Schade (talk | contribs) mNo edit summary |
||
(One intermediate revision by one other user not shown) | |||
Line 22: | Line 22: | ||
* more options see [https://linux.die.net/man/1/ncks]. | * more options see [https://linux.die.net/man/1/ncks]. | ||
==== Typical reduction of UnTRIM results in time==== | ==== Typical reduction of UnTRIM results in time==== | ||
* ncks -d nMesh2_data_time 1, 19, 6 in_file out_file | * ncks -d nMesh2_data_time,1,19,6 in_file out_file | ||
* extracts the first, seventh, thirteenth and nineteenth timestep | * extracts the first, seventh, thirteenth and nineteenth timestep | ||
==== Typical reduction of meteorological data in space==== | ==== Typical reduction of meteorological data in space==== | ||
* ncks -d rlon 600,900 iconeu.nc tmp_reduced_rlon.nc | * ncks -d rlon,600,900 iconeu.nc tmp_reduced_rlon.nc | ||
* ncks -d rlat 200,500 tmp_reduced_rlon.nc iconeu.reduced_in_space.nc | * ncks -d rlat,200,500 tmp_reduced_rlon.nc iconeu.reduced_in_space.nc | ||
* extracts a "square" of 301 * 301 values in longitude and latitude direction in a two-step procedure | * extracts a "square" of 301 * 301 values in longitude and latitude direction in a two-step procedure | ||
Line 37: | Line 37: | ||
-> Befehle -> Kommandozeilenfenster öffnen (TotalCommander language = German): | -> Befehle -> Kommandozeilenfenster öffnen (TotalCommander language = German): | ||
* Extend the search path: | * Extend the search path: | ||
set PATH = %PATH%; | set PATH = %PATH%;%PROGHOME%\bin\win | ||
* Get help on the command, for example: | * Get help on the command, for example: | ||
ncrcat | ncrcat |
Latest revision as of 13:11, 15 May 2020
About NCO
The NCO toolkit manipulates and analyzes data stored in NetCDF-accessible formats, including DAP, HDF4, and HDF5. It exploits the geophysical expressivity of many CF (Climate & Forecast) metadata conventions, the flexible description of physical dimensions translated by UDUnits, the network transparency of OPeNDAP, the storage features (e.g., compression, chunking, groups) of HDF (the Hierarchical Data Format), and many powerful mathematical and statistical algorithms of GSL (the GNU Scientific Library). NCO is fast, powerful, and free.
For more information see nco.sourceforge.net.
Typical applications at BAW
Concatenation of several NetCDF files converted from boewrt.dat files into one cf-netcdf.nc file
- Verify original data for correctness and completeness;
- (optional) Transform boewrt.dat using ZEITRIO into equidistant time-series of identical length;
- Convert several boewrt.dat files using DATACONVERT to equivalent cf-netcdf.nc files (with identical dates and times);
- With ncrcat several files can be concatenated into one cf-netcdf.nc file;
- Typical post processors: NCANALYSE;
- Example: ncrcat -h f1.nc f2.nc ... fn.nc result.nc (-h suppresses the modification or creation of a history attribute);
- More information: ncrcat-netCDF-Record-Concatenator.
Reduction of a NetCDF file along its dimensions
General
- ncks -d dim, min, max,[ stride] in_file out_file
- more options see [1].
Typical reduction of UnTRIM results in time
- ncks -d nMesh2_data_time,1,19,6 in_file out_file
- extracts the first, seventh, thirteenth and nineteenth timestep
Typical reduction of meteorological data in space
- ncks -d rlon,600,900 iconeu.nc tmp_reduced_rlon.nc
- ncks -d rlat,200,500 tmp_reduced_rlon.nc iconeu.reduced_in_space.nc
- extracts a "square" of 301 * 301 values in longitude and latitude direction in a two-step procedure
Availability at the BAW in Hamburg
- Linux: nco-4.6.1 from 06.08.2016
- Windows: at console level. Status 04.02.2015
"Recipe" for execution on Windows systems
- Open the console in the data directory, e.g. in the TotalCommander:
-> Befehle -> Kommandozeilenfenster öffnen (TotalCommander language = German):
- Extend the search path:
set PATH = %PATH%;%PROGHOME%\bin\win
- Get help on the command, for example:
ncrcat
- Execute the command with options, file names etc.:
ncrcat -h file1.nc file2.nc result.nc
- The option -h eliminates the attributes history and nco_openmp_thread_number. The latter causes an error when processing the output file with BAW programs as NCANALYSE.
- Example directory $PROGHOME/examples/ncdelta/data/emderfahrwasser-1/mes/wl. The time series of eleven different stations have been concatenated to 2010_0608_0708.aequi5.nc with ncrcat.
Citations
The recommended citations for NCO software are
- Zender, C. S. (2008), Analysis of Self-describing Gridded Geoscience Data with netCDF Operators (NCO), Environ. Modell. Softw., 23(10), 1338-1342, doi:10.1016/j.envsoft.2008.03.004.
- Zender, C. S. (2014), netCDF Operator (NCO) User Guide, Version 4.4.8, http://nco.sf.net/nco.pdf.
Use the former when referring to overall design, purpose, and optimization of NCO, and use the latter when referring to specific features and/or the User Guide itself.
back to Standard-Software-Applications (Add-ons)