- Notifications
You must be signed in to change notification settings - Fork23
A CF-compliant Earth Science data analysis library
License
NCAS-CMS/cf-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
The Pythoncf package is an Earth Science data analysis library thatis built on a complete implementation of the CF data model.
From version 3.14.0 thecf package usesDask 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
Thecf package implements theCF datamodelfor its internal data structures and so is able to process anyCF-compliant dataset. It is not strict about CF-compliance, however,so that partially conformant datasets may be ingested from existingdatasets and written to new datasets. This is so that datasets whichare partially conformant may nonetheless be modified in memory.
A simple example of reading a field construct from a file andinspecting 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)) KCell 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] mThecf package usesDask for allof its array manipulation and can:
- read field constructs from netCDF, CDL, Zarr, PP and UM datasets with achoice of netCDF backends,and in local, http, and s3 locations,
- create new field constructs in memory,
- write and append field and domain constructs to netCDF datasets on disk,
- read, create, and manipulate UGRID mesh topologies,
- read, write, and create coordinates defined by geometry cells,
- read netCDF and CDL datasets containing hierarchical groups,
- inspect field constructs,
- test whether two field constructs are the same,
- modify field construct metadata and data,
- create subspaces of field constructs,
- write field constructs to netCDF datasets on disk,
- incorporate, and create, metadata stored in external files,
- read, write, and create data that have been compressed by convention(i.e. ragged or gathered arrays, or coordinate arrays compressed bysubsampling), whilst presenting a view of the data in itsuncompressed form,
- combine field constructs arithmetically,
- manipulate field construct data by arithmetical and trigonometricaloperations,
- perform weighted statistical collapses on field constructs,including those with geometry cells and UGRID mesh topologies,
- perform histogram, percentile and binning operations on fieldconstructs,
- regrid structured grid, mesh and DSG field constructs with(multi-)linear, nearest neighbour, first- and second-orderconservative and higher order patch recovery methods, including 3-dregridding, and large-grid support,
- apply convolution filters to field constructs,
- create running means from field constructs,
- apply differential operators to field constructs,
- create derived quantities (such as relative vorticity).
- read and write data that are quantized to eliminate falseprecision.
Powerful and flexible visualizations ofcf field constructs,designed to be produced and configured in as few lines of code aspossible, are available with thecf-plotpackage, which needs to beinstalled separately to thecf package.
During installation thecfa command line utility is alsoinstalled, which
generates text descriptions of field constructs contained in files,and
creates new datasets aggregated from existing files.
Tests are run from within thecf/test directory:
python run_tests.pyTraining 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.
About
A CF-compliant Earth Science data analysis library
Topics
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.
