cf functions


Version 3.0.5 for version 1.7 of the CF conventions.

Reading and writing

cf.read Read field constructs from netCDF, CDL, PP or UM fields files.
cf.write Write field constructs to a netCDF file.
cf.load_stash2standard_name Load a STASH to standard name conversion table.

Aggregation

cf.aggregate Aggregate field constructs into as few field constructs as possible.

Mathematical operations

cf.ATOL The tolerance on absolute differences when testing for numerically tolerant equality.
cf.RTOL The tolerance on relative differences when testing for numerically tolerant equality.
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.

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 customizable 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 scalar or 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.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.MINNCFM
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 ESMPy 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.

Miscellaneous

cf.CF The version of the CF conventions.
cf.RELAXED_IDENTITIES Use ‘relaxed’ mode when getting a construct identity.
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 cf-python dependencies.
cf.example_field Return an example field construct.
cf.flat Return an iterator over an arbitrarily nested sequence.
cf.hash_array Return the hash value of a numpy array.
cf.implementation
cf.inspect Inspect the attributes of an object.
cf.pathjoin Join two file path components intelligently.
cf.pickle
cf.relpath Return a relative filepath to a file.
cf.unpickle