Table of Contents
pp2cf - PP to CF-netCDF file converter
pp2cf [-a opts] [-d dir]
[-f format] [-o outfile] [-r opts] [-t table] [-u VN] [-v] [-V] FILE [FILE ...]
Convert multiple PP files to a single CF-netCDF file or convert multiple
PP files to multiple CF-netCDF files on a file by file basis.
PP fields contributing
to the same output netCDF file are aggregated into as few multidimensional
netCDF variables as possible using the aggregation rules based on the CF
data model. See http://www.met.reading.ac.uk/~david/cf_aggregation_rules.html
The conversion is carried out internally using the python cf package which
must be installed. See http://code.google.com/p/cf-python
See http://www.met.reading.ac.uk/~david/pp2cf.html
for more details and examples.
- -a options, --aggregate_options=options
- Customize
the field aggregation process: The ’messages’ option controls whether to
(1)
or not to (0, the default) print information messages on the aggregation
process.
For example, -a ’messages=1’
- -d dir, --directory=dir
- Create an output
netCDF file for each PP file and place each output file in this directory.
If unset and the -o option is also unset then each netCDF file will be created
in the same directory as its corresponding PP file. In any case, each netCDF
file will have the same non-directory portion of the PP file’s path name,
except with the suffix ’.nc’.
- -f format --format=format
- Set the netCDF format
of the output file(s). Valid choices are ’NETCDF4’, ’NETCDF4_CLASSIC’, ’NETCDF3_64BIT’,
and ’NETCDF3_CLASSIC’. If unset then defauts to ’NETCDF3_CLASSIC’.
- -o outfile,
--output=outfile
- Convert the contents of all PP files to this netCDF file.
If unset then an output netCDF file will be created for each PP file (see
the -d option for details).
- -r options, --read_options=options
- Customize the
reading of the input files: The ’squeeze’ option controls whether to remove
all size 1 dimensions from the data array (1, the default) or force the
data array to span all size 1 dimensions (-1); the ’ignore_ioerror’ option
controls whether to (1)
or not to (0) ignore unreadable files (default
0, the default); the ’aggregate’ option controls whether to (1, the default)
or not to (0) aggregate the input fields (default 1).
For example, -r ’squeeze=-1,
ignore_ioerror=1’
- -t table, --table=table
- Provide a different PP STASH code
to CF standard_name conversion table. The default table is the file ’etc/STASH_to_CF.txt’
located in the cf-python installation directory. The most up to date version
of the table may be found at http://puma.nerc.ac.uk/STASH_to_CF/STASH_to_CF.txt
- -u VN, --umversion=VN
- Use this UM version when translating PP STASH codes
to CF standard names. If unset then the UM version is taken from the environment
variable UMVERSION. In either case, if a PP field specifies a UM version
in its header then this will be used in preference.
- -v, --verbose
- Verbose. Display
a summary of newly created netCDF files.
- -V, --Version
- Display the version.
man pp2cf
pp2cf file.pp
pp2cf -o output.nc file.pp
pp2cf -d directory file.pp
pp2cf *.pp
pp2cf -u 7.6 file1.pp file2.pp
export UMVERSION=7.6
pp2cf file1.pp file2.pp
pp2cf -f NETCDF4 -t user_table.txt -v directory/file*.pp
pp2cf -a messages=1 -r "squeeze=-1, ignore_ioerror=1" file*.pp
pp2cf -V
Written by David Hassell.
Open Source Initiative MIT License.
See http://www.opensource.org/licenses/mit-license.php
The author would
welcome reports of bugs at http://code.google.com/p/cf-python/issues/list
Table of Contents