usage: pncdump.py [-h] [--pnc PNC]
[-f {see --list-formats for choices}]
[--list-format] [--help-format HELPFORMAT]
[--sep] [--inherit] [--mangle]
[--rename RENAME]
[--remove-singleton REMOVESINGLETON] [-H]
[-t] [--full-indices [c|f]] [-l LEN]
[--float-precision FDIG]
[--double-precision PDIG]
[--dump-name CDLNAME]
[--coordkeys key1,key2]
[-v varname1[,varname2[,...,varnameN]]
[-a att_nm,var_nm,mode,att_typ,att_val]
[-m MASKS] [--from-convention FROMCONV]
[--to-convention TOCONV] [--stack STACK]
[--merge] [-s dim,start[,stop[,step]]]
[-r dim,function[,weight]]
[--mesh dim,weight,function]
[-c dim,mode,wgt1,wgt2,...wgtN] [-e EXTRACT]
[--extract-file EXTRACTFILE]
[--extractmethod {nn,linear,cubic,quintic,KDTree}]
[--op-typ OPERATORS] [--expr EXPRESSIONS]
[--exprscript EXPRESSIONSCRIPTS]
[ifile [ifile ...]]
PseudoNetCDF Argument Parsing
positional arguments:
ifile path to a file formatted as type -f
optional arguments:
-h, --help show this help message and exit
--pnc PNC Set of pseudonetcdf commands to be
process separately
-f {see --list-formats for choices}, --format {see --list-formats for choices}
File format (default netcdf), can be
one of the choices listed, or an
expression that evaluates to a reader.
Keyword arguments are passed via
,kwd=value.
--list-format Show format options for -f
--help-format HELPFORMAT
Show help for file format (must be one
of the options for -f)
--sep Used to separate groups of arguments
for parsing (e.g., pncgen --
[options1] file(s)1 [--sep [options2]
file(s)2 [... [--sep [optionsN]
file(s)N]]
--inherit Allow subparsed sections (separated
with -- and --sep) to inherit from
global options (-f, --format is always
inherited).
--mangle Remove non-standard ascii from names
--rename RENAME Provide pairs of strings to be
substituted
--rename=type,oldkey,newkey (type: v =
variable; d = dimension;)
--remove-singleton REMOVESINGLETON
Remove singleton (length 1) dimensions
-H, --header
-t, --timestring
--full-indices [c|f] Provide indices in CDL using either C
or Fortran style indexes. C style is
0-based and ordered from slowest
iterating dimension to fastest.
Fortran style is 1-based and ordered
from fastest to slowest iterating
dimension
-l LEN, --length LEN CDL line length (pncdump only)
--float-precision FDIG
single precision digitis (default 8;
pncdump only)
--double-precision PDIG
pdig double precision digits (default
16; pncdump only)
--dump-name CDLNAME Name for display in ncdump
--coordkeys key1,key2
Variables to be ignored in pncbo.
-v varname1[,varname2[,...,varnameN], --variables varname1[,varname2[,...,varnameN]
Variable names or regular expressions
(using match) separated by ','. If a
group(s) has been specified, only
variables in that (those) group(s)
will be selected.
-a att_nm,var_nm,mode,att_typ,att_val, --attribute att_nm,var_nm,mode,att_typ,att_val
Variables have attributes that can be
added following nco syntax
(--attribute
att_nm,var_nm,mode,att_typ,att_val);
mode = a,c,d,m,o and att_typ =
f,d,l,s,c,b; att_typ is any valid
numpy type.
-m MASKS, --mask MASKS
Masks to apply (e.g., greater,0 or
less,0 or values,0, or where,(time[:]%
24<12)[:,None].repeat(10,1))
--from-convention FROMCONV
From convention currently only support
ioapi
--to-convention TOCONV
To convention currently only supports
cf
--stack STACK Concatentate (stack) files on the
dimension.
--merge Combine variables into one file
-s dim,start[,stop[,step]], --slice dim,start[,stop[,step]]
Variables have dimensions (time,
layer, lat, lon), which can be subset
using dim,start,stop,stride (e.g.,
--slice=layer,0,47,5 would sample
every fifth layer starting at 0)
-r dim,function[,weight], --reduce dim,function[,weight]
Variable dimensions can be reduced
using dim,function,weight syntax
(e.g., --reduce=layer,mean,weight).
Weighting is not fully functional.
--mesh dim,weight,function
Variable dimensions can be meshed
using dim,function,weight syntax
(e.g., --mesh=time,0.5,mean).
-c dim,mode,wgt1,wgt2,...wgtN, --convolve dim,mode,wgt1,wgt2,...wgtN
Variable dimension is reduced by
convolve function
(dim,mode,wgt1,wgt2,...wgtN)
-e EXTRACT, --extract EXTRACT
lon/lat coordinates to extract lon1,la
t1/lon2,lat2/lon3,lat3/.../lonN,latN
--extract-file EXTRACTFILE
pncparse options for file
--extractmethod {nn,linear,cubic,quintic,KDTree}
Method for extraction
--op-typ OPERATORS Operator for binary file operations.
Binary file operations use the first
two files, then the result and the
next file, etc. Use // or <= or % or
is not or >> or & or == or != or + or
* or - or / or < or >= or ** or > or
<< or | or is or ^
--expr EXPRESSIONS Generic expressions to execute in the
context of the file.
--exprscript EXPRESSIONSCRIPTS
Generic expressions to execute in the
context of the file.
Detailed Steps
--------------
PseudoNetCDF has many operations and the order often matters. The order is consistent with the order of options in the formatted help. The default order is summarized as:
1. Open with specified reader (-f)
2. Select subset of variables (-v)
2. Add attributes (-a)
4. Apply masks (--mask)
5. Add conventions to support later operations (--to-convention, --from-convention)
6. Combine files via stacking on dimensions (--stack)
7. Slice dimensions (-s --slice)
8. Reduce dimensions (-r --reduce)
9. Convolve dimensions (-c)
10. Extract specific coordinates (--extract)
11. Remove singleton dimensions (--remove-singleton)
12. Apply expressions (--expr then --exprscripts)
13. Apply binary operators (--op_typ)
To impose your own order, use standard options (global options) and then use -- to force positional interpretation of remaining options. In remaining options, use --sep to separate groups of files and options to be evaluated before any global operations.