Source code for cf

'''

CF is a netCDF convention which is in wide and growing use for the
storage of model-generated and observational data relating to the
atmosphere, ocean and Earth system.

It has been agreed that the CF conventions should include an abstract
data model for data and metadata corresponding to the most up to date
standard, and such a model is has been proposed. This package is an
implementation of this CF data model, and as such it is an API allows
for the full scope of data and metadata interactions described by the
CF conventions.

With this package you can:

    * Read CF-netCDF and PP format files, aggregating their contents
      into as few multidimensional fields as possible.

    * Write fields to CF-netCDF files on disk.

    * Create, delete and modify a field's data and metadata.

    * Select fields by their metadata values.

    * Subset a field's data to create a new field.

    * Perform arithmetic and comparison operations with fields.

All of the above use Large Amounts of Massive Arrays (LAMA)
functionality, which allows multiple fields larger than the available
memory to exist and be manipulated.

See the cf-python home page for downloads, installation and source
code.
'''

__Conventions__ = 'CF-1.5'
__author__      = 'David Hassell'
__date__        = '01 October 2012'
__version__     = '0.9.5'

import imp
import sys

# Check the version of python
if not 0x020600f0 <= sys.hexversion < 0x030000f0:
    raise Exception, "cf will not work with this version of python: %s" % \
        hex(sys.hexversion)

# Check that the dependencies are met
for _module in ('netCDF4', 'numpy'):
    try:
        imp.find_module(_module)
    except ImportError:
        raise ImportError, "Missing dependency: cf requires package '%(_module)s'" % \
            locals()
#--- End: for
del _module

from .variable         import Variable
from .variablelist     import VariableList
from .coordinate       import Coordinate
from .coordinatebounds import CoordinateBounds
from .coordinatelist   import CoordinateList
from .cellmeasures     import CellMeasures
from .transform        import Transform
from .space            import Space
from .field            import Field
from .fieldlist        import FieldList
from .read             import read
from .write            import write
from .utils            import (CfList, CfDict,
                               equals, RTOL, ATOL, close,
                               dump, CHUNKSIZE, FM_THRESHOLD, CONSTANTS)
from .units            import Units
from .partition        import Partition, FileArray
from .partitionarray   import PartitionArray
from .data             import Data
from .aggregate        import aggregate
from .comparison       import Comparison, lt, le, gt, ge, eq, ne, inside, outside
from .flags            import Flags
from .cellmethods      import CellMethods
from .filearray        import FileArray