Backends

CfGRIB.jl has a flexible backend system built in to allow for multiple ways to represent multidimensional data with named dimensions.

Backends are loaded in dynamically based on what packages the user has available, currently there are two built-in backends, one is based on DimensionalData.jl and the other uses AxisArrays.

Additionally, FileIO.jl integration is prepared for each of the backends so that users utilising FileIO can use its smart load functions which will load the file via CfGRIB.jl when the correct file extension and magic numbers are present.


    CfGRIB.ArrayWrapperType

    Summary

    abstract type ArrayWrapper <: CfGRIB.Backend

    Abstract type for backends which also wrap data types provided by external packages, instead of just providing a 'vanilla' implementation of the data type.

    Python's xarray has two fundamental data structures, a DataArray which holds the data for a single multi-dimensional variable and its coordinates, as well as a Dataset which holds multiple DataArrays that (typically) share the same coordinates.

    See also

    AxisArrayWrapper, DimensionalArrayWrapper

    Fields

    Constructors

    CfGRIB.BackendType

    Summary

    abstract type Backend

    Backends are wrappers around named array data types, contain information on the dimensions, attributes, and encoding of the data, as well as the datasets themselves.

    See also

    AxisArrayWrapper, DimensionalArrayWrapper

    Fields

    Constructors


      CfGRIB.AxisArrayWrapperType

      Summary

      struct AxisArrayWrapper <: CfGRIB.ArrayWrapper

      AxisArrays provides the equivalent of an xarray DataArray, this wrapper adds the functionality of an xarray DataSet by containing multiple AxisArrays.

      Object should be created by calling the relevant convert(AxisArrayWrapper, dataset::DataSet) method on a DataSet.

      See also

      Backend, ArrayWrapper

      Fields

      • dimensions::OrderedCollections.OrderedDict

        Dictionary of DimensionName::String => DimensionLength::Int

      • datasets::NamedTuple

        Named tuple of DatasetName::Symbol => Dataset::AxisArray

      • attributes::OrderedCollections.OrderedDict

        Dictionary of AttributeName::String => AttributeValue::Any

      • encoding::Dict

        Dictionary containing encoding information (usually source, filter_by_keys, and ecode_cf)

      Constructors

      AxisArrayWrapper(dimensions, datasets, attributes, encoding)
      CfGRIB.DimensionalArrayWrapperType

      Summary

      struct DimensionalArrayWrapper <: CfGRIB.ArrayWrapper

      DimensionalData provides the equivalent of an xarray DataArray, this wrapper adds the functionality of an xarray DataSet by containing multiple DimensionalArrays.

      Object should be created by calling the relevant convert(DimensionalArrayWrapper, dataset::DataSet) method on a DataSet.

      See also

      Backend, ArrayWrapper

      Fields

      • dimensions::OrderedCollections.OrderedDict

        Dictionary of DimensionName::String => DimensionLength::Int

      • datasets::NamedTuple

        Named tuple of DatasetName::Symbol => Dataset::DimensionalArray

      • attributes::OrderedCollections.OrderedDict

        Dictionary of AttributeName::String => AttributeValue::Any

      • encoding::Dict

        Dictionary containing encoding information (usually source, filter_by_keys, and ecode_cf)

      Constructors

      DimensionalArrayWrapper(dimensions, datasets, attributes, encoding)