cf functions


Version 3.16.2 for version 1.11 of the CF conventions.

Reading and writing

cf.read

Read field or domain constructs from files.

cf.write

Write field constructs to a netCDF file.

Aggregation

cf.aggregate

Aggregate field constructs into as few field constructs as possible.

cf.climatology_cells

Return a climatological cells dictionary for cf.aggregate.

Mathematical operations

cf.atol

The numerical equality tolerance on absolute differences.

cf.rtol

The numerical equality tolerance on relative differences.

cf.bounds_combination_mode

Determine how to deal with cell bounds in binary operations.

cf.default_netCDF_fillvals

Default data array fill values for each data type.

cf.curl_xy

Calculate the horizontal curl of an (X, Y) vector.

cf.div_xy

Calculate the horizontal divergence of an (X, Y) vector.

cf.histogram

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

cf.ATOL

Alias for cf.atol.

cf.RTOL

Alias for cf.rtol.

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.

cf.isclose

A Query object for an “is close” 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 default chunksize used by dask arrays.

cf.free_memory

The available physical memory.

cf.regrid_logging

Whether or not to enable esmpy regridding logging.

cf.tempdir

The directory for internally generated temporary files.

cf.total_memory

The total amount of physical memory (in bytes).

cf.CHUNKSIZE

Alias for cf.chunksize.

cf.FREE_MEMORY

Alias for cf.free_memory.

cf.REGRID_LOGGING

Alias for cf.regrid_logging.

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.implementation

Return a container for the CF data model implementation.

cf.indices_shape

Return the shape of the array subspace implied by indices.

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.relaxed_identities

Use ‘relaxed’ mode when getting a construct identity.

cf.relpath

Return a relative filepath to a file.

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.unique_constructs

Return the unique constructs from a sequence.

cf.LOG_LEVEL

Alias for cf.log_level.

cf.RELAXED_IDENTITIES

Alias for cf.relaxed_identities.

Deprecated

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.collapse_parallel_mode

Which mode to use when collapse is run in parallel.

cf.fm_threshold

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

cf.free_memory_factor

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

cf.hash_array

Return a hash value of a numpy array.

cf.min_total_memory

The minimum total memory across nodes.

cf.of_fraction

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

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.relative_vorticity

Calculate the relative vorticity using centred finite differences.

cf.set_performance

Tune performance of parallelisation.

cf.COLLAPSE_PARALLEL_MODE

Alias for cf.collapse_parallel_mode.

cf.FM_THRESHOLD

Alias for cf.fm_threshold.

cf.FREE_MEMORY_FACTOR

Alias for cf.free_memory_factor.

cf.MIN_TOTAL_MEMORY

Alias for cf.min_total_memory.

cf.OF_FRACTION

Alias for cf.of_fraction.

cf.SET_PERFORMANCE

Alias for cf.set_performance.