A CF-compliant Earth Science data analysis library
The Python cf
package is an Earth Science data analysis library that
is built on a complete implementation of the CF data model.
From version 3.14.0 the cf
package uses
Dask for all of its data manipulations.
http://ncas-cms.github.io/cf-python
http://ncas-cms.github.io/cf-python/installation.html
https://ncas-cms.github.io/cf-python/cheat_sheet.html
https://ncas-cms.github.io/cf-python/recipes
https://ncas-cms.github.io/cf-python/tutorial.html
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 which
are partially conformant may nonetheless be modified in memory.
A simple example of reading a field construct from a file and inspecting it:
>>> import cf
>>> f = cf.read('file.nc')
>>> print(f[0])
Field: air_temperature (ncvar%tas)
----------------------------------
Data : air_temperature(time(12), latitude(64), longitude(128)) K
Cell methods : time(12): mean (interval: 1.0 month)
Dimension coords: time(12) = [1991-11-16 00:00:00, ..., 1991-10-16 12:00:00] noleap
: latitude(64) = [-87.8638, ..., 87.8638] degrees_north
: longitude(128) = [0.0, ..., 357.1875] degrees_east
: height(1) = [2.0] m
The cf
package uses
Dask for all
of its array manipulation and can:
Powerful, flexible, and very simple to produce visualizations of field
constructs are available with the cfplot
package, that needs to be installed
seprately to the cf
package.
See the cf-plot gallery for the full range of plotting possibilities with example code.
During installation the cfa
command line utility is also
installed, which
generates text descriptions of field constructs contained in files, and
creates new datasets aggregated from existing files.
Tests are run from within the cf/test
directory:
python run_tests.py