Parameters: | files : (arbitrarily nested sequence of) str
A string or arbitrarily nested sequence of strings giving the
file names or OPenDAP URLs from which to read fields. Various
type of expansion are applied to the file names:
Expansion |
Description |
Tilde |
An initial component of ~ or
~user is replaced by that user‘s
home directory. |
Environment variable |
Substrings of the form $name or
${name} are replaced by the value
of environment variable name. |
Pathname |
A string containing UNIX file name
metacharacters as understood by the
glob module is replaced by
the list of matching file names. This
type of expansion is ignored for
OPenDAP URLs. |
Where more than one type of expansion is used in the same
string, they are applied in the order given in the above
table.
Example: If the environment variable MYSELF has been set
to the “david”, then '~$MYSELF/*.nc' is equivalent to
'~david/*.nc', which will read all netCDF files in the
user david’s home directory.
- verbose : bool, optional
If True then print information to stdout.
- umversion : int or float, optional
Met Office (UK) PP files and Met Office (UK) fields files
only, the Unified Model (UM) version to be used when decoding
the header. Valid versions are, for example, 402,
'606.3' and '1001'. The default version is
405. The version is ignored if it can be inferred from the
headers (which is generally true for PP files created at
version 5.3 and later and for all fields files). Note that
the PP header can not encode tertiary version elements (such
as the 3 in 606.3), so it may be necessary to provide
a UM version in such cases.
Ignored for any other type of input files.
- ignore_read_error : bool, optional
If True then ignore any file which raises an IOError whilst
being read, as would be the case for an empty file, unknown
file format, etc. By default the IOError is raised.
- fmt : str, optional
Only read files of the given format, ignoring all other
files. Valid formats are 'NETCDF' for CF-netCDF files,
'CFA' for CFA-netCDF files and 'PP' for PP files and
‘FF’ for UM fields files. By default files of any of these
formats are read. default files of any of these formats are
read.
- aggregate : bool or dict, optional
If True (the default) or a (possibly empty) dictionary then
aggregate the fields read in from all input files into as few
fields as possible using the CF aggregation rules. If
aggregate is a dictionary then it is passed as keyword
arguments to the cf.aggregate function. If False then the
fields are not aggregated.
- squeeze : bool, optional
If True then remove size 1 axes from each field’s data array.
- unsqueeze : bool, optional
If True then insert size 1 axes from each field’s domain into
its data array.
- select, select_options : optional
Only return fields which satisfy the given conditions on their
property values. Only fields which, prior to any aggregation,
satisfy f.match(select, **select_options) == True are
returned. See cf.Field.match for details.
- promote : (sequence of) str, optional
Promote field components to independent top-level fields. The
promote parameter may be or, or a sequence, of:
promote |
Extra top-level fields |
'reference' |
Fields in coordinate reference objects |
'ancillary' |
Ancillary data fields |
'field' |
Fields in coordinate references and
ancillary data fields |
'auxiliary' |
Auxiliary coordinate objects |
'measure' |
Cell measure objects |
'all' |
All of the above |
- Example:
To promote fields in coordinate reference objects:
promote='reference' or promote=['reference'].
- Example:
To promote ancillary data fields and cell measure
objects: promote=['ancillary', 'measure'].
|