cf functions


Version 3.10.0 for version 1.8 of the CF conventions.

Reading and writing

cf.read

Read field constructs from netCDF, CDL, PP or UM fields datasets.

cf.write

Write field constructs to a netCDF file.

Aggregation

cf.aggregate

Aggregate field constructs into as few field constructs as possible.

Mathematical operations

cf.atol

The numerical equality tolerance on absolute differences.

cf.rtol

The numerical equality tolerance on relative differences.

cf.default_netCDF_fillvals

Default data array fill values for each data type.

cf.histogram

Return the distribution of a set of variables in the form of an N-dimensional histogram.

cf.relative_vorticity

Calculate the relative vorticity using centred finite differences.

cf.ATOL

Alias for cf.atol.

cf.RTOL

Alias for cf.rtol.

cf.bounds_combination_mode

Determine how to deal with cell bounds in binary operations.

Condition constructors

General conditions

cf.eq

A Query object for an “equal” condition.

cf.ge

A Query object for a “greater than or equal” condition.

cf.gt

A Query object for a “strictly greater than” condition.

cf.le

A Query object for a “less than or equal” condition.

cf.lt

A Query object for a “strictly less than” condition.

cf.ne

A Query object for a “not equal” condition.

cf.wi

A Query object for a “within a range” condition.

cf.wo

A Query object for a “without a range” condition.

cf.set

A Query object for a “member of set” condition.

Date-time conditions

cf.year

A Query object for a “year” condition.

cf.month

A Query object for a “month of the year” condition.

cf.day

A Query object for a “day of the month” condition.

cf.hour

A Query object for a “hour of the day” condition.

cf.minute

A Query object for a “minute of the hour” condition.

cf.second

A Query object for a “second of the minute” condition.

cf.jja

A Query object for a “month of year in June, July or August” condition.

cf.son

A Query object for a “month of year in September, October, November” condition.

cf.djf

A Query object for a “month of year in December, January, February” condition.

cf.mam

A Query object for a “month of year in March, April, May” condition.

cf.seasons

A customisable list of Query objects for “seasons in a year” conditions.

Coordinate cell conditions

cf.contains

A Query object for a “cell contains” condition.

cf.cellsize

A Query object for a “cell size” condition.

cf.cellgt

A Query object for a “cell bounds strictly greater than” condition.

cf.cellge

A Query object for a “cell bounds greater than or equal” condition.

cf.cellle

A Query object for a “cell bounds less than or equal” condition.

cf.celllt

A Query object for a “cell bounds strictly less than” condition.

cf.cellwi

A Query object for a “cell bounds lie within range” condition.

cf.cellwo

A Query object for a “cell bounds lie without range” condition.

Date-time and time duration

cf.dt

Return a date-time object for a date and time according to a calendar.

cf.dt_vector

Return a 1-d array of date-time objects.

cf.Y

Return a time duration of calendar years in a cf.TimeDuration object.

cf.M

Return a time duration of calendar months in a cf.TimeDuration object.

cf.D

Return a time duration of days in a cf.TimeDuration object.

cf.h

Return a time duration of hours in a cf.TimeDuration object.

cf.m

Return a time duration of minutes in a cf.TimeDuration object.

cf.s

Return a time duration of seconds in a cf.TimeDuration object.

Resource management

cf.configuration

View or set any number of constants in the project-wide configuration.

cf.chunksize

Set the chunksize used by LAMA for partitioning the data array.

cf.collapse_parallel_mode

Which mode to use when collapse is run in parallel.

cf.free_memory

The available physical memory.

cf.free_memory_factor

Set the fraction of memory kept free as a temporary workspace.

cf.fm_threshold

The amount of memory which is kept free as a temporary work space.

cf.of_fraction

The amount of concurrently open files above which files containing data arrays may be automatically closed.

cf.regrid_logging

Whether or not to enable ESMF regridding logging.

cf.set_performance

Tune performance of parallelisation by setting chunksize and free memory factor.

cf.tempdir

The directory for internally generated temporary files.

cf.total_memory

TODO.

cf.close_files

Close open files containing sub-arrays of data arrays.

cf.close_one_file

Close an arbitrary open file containing a sub-array of a data array.

cf.open_files

Return the open files containing sub-arrays of master data arrays.

cf.open_files_threshold_exceeded

Return True if the total number of open files is greater than the current threshold.

cf.CHUNKSIZE

Alias for cf.chunksize.

cf.COLLAPSE_PARALLEL_MODE

Alias for cf.collapse_parallel_mode.

cf.FREE_MEMORY

Alias for cf.free_memory.

cf.FREE_MEMORY_FACTOR

Alias for cf.free_memory_factor.

cf.FM_THRESHOLD

Alias for cf.fm_threshold.

cf.MINNCFM

cf.OF_FRACTION

Alias for cf.of_fraction.

cf.REGRID_LOGGING

Alias for cf.regrid_logging.

cf.SET_PERFORMANCE

Alias for cf.set_performance.

cf.TEMPDIR

Alias for cf.tempdir.

cf.TOTAL_MEMORY

Alias for cf.total_memory.

Miscellaneous

cf.CF

The version of the CF conventions.

cf.abspath

Return a normalized absolute version of a file name.

cf.dirname

Return the directory name of a file.

cf.dump

Print a description of an object.

cf.environment

Return the names and versions of the cf package and its dependencies.

cf.example_field

Return an example field construct.

cf.example_fields

Return example field constructs.

cf.example_domain

Return an example domain construct.

cf.flat

Return an iterator over an arbitrarily nested sequence.

cf.hash_array

Return the hash value of a numpy array.

cf.implementation

Return a container for the CF data model implementation.

cf.inspect

Inspect the attributes of an object.

cf.log_level

The minimal level of seriousness of log messages which are shown.

cf.pathjoin

Join two file path components intelligently.

cf.pickle

cf.relaxed_identities

Use ‘relaxed’ mode when getting a construct identity.

cf.relpath

Return a relative filepath to a file.

cf.unpickle

cf.load_stash2standard_name

Load a STASH to standard name conversion table from a file.

cf.stash2standard_name

Return a copy of the loaded STASH to standard name conversion table.

cf.LOG_LEVEL

Alias for cf.log_level.

cf.RELAXED_IDENTITIES

Alias for cf.relaxed_identities.