The cf package implements the CF data model for its internal
data structures and so is able to process any CF-compliant dataset. It
is not strict about CF-compliance, however, so that partially
conformant datasets may be ingested from existing datasets and written
to new datasets.This is so that datasets that are partially conformant
may nonetheless be modified in memory.
A basic example of reading a field construct from a
file and inspecting it.¶
read field constructs and domain
constructs from netCDF, CDL, Zarr, Kerchunk, PP
and UM datasets with a choice of netCDF backends, including from local,
HTTP, OPeNDAP and S3 locations,
be fully flexible with respect to dataset storage chunking,
create new field and domain constructs in memory,
write and append field and domain constructs to netCDF and Zarr
v3 datasets on disk, with control over HDF5 internal file metadata,
read, write, and manipulate UGRID mesh topologies,
read, write, and manipulate HEALPix grids,
read, write, and create coordinates defined by geometry cells,
read and write netCDF4 string data-type variables,
read, write, and create netCDF and CDL datasets containing hierarchical
groups,
read, write, and create data that have been compressed by convention
(i.e. ragged or gathered arrays, or coordinate arrays compressed by
subsampling), whilst presenting a view of the data in its
uncompressed form,
read and write data that are quantized to eliminate false
precision,
convert field and domain constructs to xarray datasets in memory,
inspect field constructs,
test whether two field constructs are the same,
modify field construct metadata and data,
create subspaces of field constructs,
incorporate, and create, metadata stored in external files,
combine field constructs arithmetically,
manipulate field construct data by arithmetical and trigonometrical
operations,
perform weighted statistical collapses on field constructs,
including those with geometry cells, UGRID mesh topologies, and
HEALPix grids,
perform histogram, percentile and binning operations on field
constructs,
regrid structured grid, UGRID, HEALPix, and DSG field constructs
with (multi-)linear, nearest neighbour, first- and second-order
conservative and higher order patch recovery methods, including 3-d
regridding, and large-grid support,
apply convolution filters to field constructs,
create running means from field constructs,
apply differential operators to field constructs, and
create derived quantities (such as relative vorticity).
Powerful, flexible, and user-friendly visualisations of field
constructs are available with the cf-plot package that is installed
separately to cf (see the
cf-plot documentation for details).
See the cf-plot gallery for the wide range
of plotting possibilities with example code.
Examples gallery of plots made with the cf-plot library.¶
Training material on cf-python and cf-plot i.e. the CF Data Tools,
in the form of Jupyter Notebooks, is openly-accessible and available
(with instructions for set-up provided) at:
https://github.com/NCAS-CMS/cf-tools-training.
The CF (Climate and Forecast) metadata conventions
(http://cfconventions.org) provide a description of the physical
meaning of data and of their spatial and temporal properties and are
designed to promote the creation, processing, and sharing of climate
and forecasting data using netCDF files and libraries
(https://www.unidata.ucar.edu/software/netcdf).
The CF data model
identifies the fundamental elements (“constructs”) of the CF
conventions and shows how they relate to each other, independently of
the netCDF encoding.
The CF data model defines a field construct for storing data with
all of its metadata. It is defined in CF-1.13 as follows:
corresponding to CF-netCDF UGRID connectivity variables
The constructs of the CF data model described using UML. The field construct corresponds to a CF-netCDF data variable. The domain construct provides the linkage between the field construct and the constructs which describe measurement locations and cell properties. It is useful to define an abstract generic coordinate construct that can be used to refer to coordinates when their type (dimension or auxiliary coordinate construct) is not an issue.¶
Hassell, D., Gregory, J., Blower, J., Lawrence, B. N., and
Taylor, K. E. (2017). A data model of the Climate and Forecast
metadata conventions (CF-1.6) with a software implementation
(cf-python v2.1), Geosci. Model Dev., 10, 4619-4646,
https://doi.org/10.5194/gmd-10-4619-2017
Rew, R., and Davis, G. (1990). NetCDF: An Interface for Scientific
Rew, R., Hartnett, E., and Caron, J. (2006). NetCDF-4: Software
Implementing an Enhanced Data Model for the Geosciences. In 22nd
International Conference on Interactive Information Processing
Systems for Meteorology, Oceanography, and Hydrology. AMS. Retrieved
from
https://www.unidata.ucar.edu/software/netcdf/papers/2006-ams.pdf
You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.