GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - NCAS-CMS/cf-python: A CF-compliant Earth Science data analysis library

BranchesTags
Open more actions menu

Latest commit

 

History

5,757 Commits
5,757 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
cf
cf
 
 
docker
docker
 
 
docs
docs
 
 
recipes-docs
recipes-docs
 
 
scripts
scripts
 
 
singularity
singularity
 
 
.flake8
.flake8
 
 
.gitignore
.gitignore
 
 
.howfairis.yml
.howfairis.yml
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
Changelog.rst
Changelog.rst
 
 
LICENSE
LICENSE
 
 
MANIFEST.in
MANIFEST.in
 
 
README.md
README.md
 
 
RECIPES.md
RECIPES.md
 
 
RELEASE.md
RELEASE.md
 
 
archive_docs
archive_docs
 
 
check_docs_api_coverage
check_docs_api_coverage
 
 
codecov.yml
codecov.yml
 
 
generate_stub_files.py
generate_stub_files.py
 
 
pyproject.toml
pyproject.toml
 
 
release_docs
release_docs
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 
tag
tag
 
 
test_release
test_release
 
 
test_tutorial_code
test_tutorial_code
 
 
upload_to_pypi
upload_to_pypi
 
 

Repository files navigation

cf-python

The Python cf package is an Earth Science data analysis library that is built on a complete implementation of the CF data model.

GitHub tag (latest by date) PyPI Conda

Conda Website GitHub

Codecov GitHub Workflow Status

fair-software.eu

References

Website Website Website

Dask

From version 3.14.0 the cf package uses Dask for all of its data manipulations.

Documentation

http://ncas-cms.github.io/cf-python

Installation

http://ncas-cms.github.io/cf-python/installation.html

Cheat Sheet

https://ncas-cms.github.io/cf-python/cheat_sheet.html

Recipes

https://ncas-cms.github.io/cf-python/recipes

Tutorial

https://ncas-cms.github.io/cf-python/tutorial.html

Functionality

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:

  • read field 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).

Visualization

Powerful and flexible visualizations of cf field constructs, designed to be produced and configured in as few lines of code as possible, are available with the cf-plot package, which needs to be installed separately to the cf package.

Example outputs of cf-plot displaying selected aspects of cf field constructs

Command line utilities

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

Tests are run from within the cf/test directory:

python run_tests.py

Training

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.

About

A CF-compliant Earth Science data analysis library

ncas-cms.github.io/cf-python

Topics

cfcfdmcfunitsdata-analysisearth-sciencemetadatanetcdfpppythonum

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

151 stars

Watchers

3 watching

Forks

23 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — 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.