z3fdb.simple_store_builder#

Classes#

SimpleStoreBuilder

Builder to create a Zarr store with FDB backing.

Module Contents#

class SimpleStoreBuilder(fdb_config_file: pathlib.Path | None = None)#

Builder to create a Zarr store with FDB backing.

This builder will create a Zarr store with a Zarr Array at its root (“/”) containing the data from your MARS request(s).

Parameters:

fdb_config_file – Optional path to FDB config file. If not set normal FDB config file resolution is applied.

_builder#
add_part(mars_request: pychunked_data_view.MarsSelection, axes: list[pychunked_data_view.AxisDefinition], extractor_type: pychunked_data_view.ExtractorType) None#

Add a MARS request to the view.

Parameters:
  • mars_request (MarsSelection) –

    A dict mapping MARS keys to their values. Single values may be given as str, int, or float; multi-valued keys may be given as a list. MARS range expressions (e.g. "2020-01-01/to/2020-01-04") must be passed as a plain string value.

    For example:

    {
        "type": "an",
        "class": "ea",
        "domain": "g",
        "expver": "0001",
        "stream": "oper",
        "date": "2020-01-01/to/2020-01-04",
        "levtype": "sfc",
        "step": 0,
        "param": [167, 131, 132],
        "time": "0/to/21/by/3",
    }
    

  • axes (list of AxisDefinition) – List of AxisDefinitions that describe how axis in the MARS request are mapped to axis in the Zarr array.

  • extractor_type – Defines how to extract data from FDB. Currently only ExtractorType.GRIB is supported.

fill_value(value: float) None#

Set the fill value used for missing / bitmap-masked grid points.

Parameters:

value (float) – Fill value written into array positions that carry a GRIB bitmap missing flag. Also used as the zarr array fill_value.

extend_on_axis(axis: int) None#

Defines the extension axis when multiple parts are added.

Parameters:

axis (int) – Index of the axis that is extendet when multiple parts have been added.

build() z3fdb._internal.zarr.FdbZarrStore#

Build the store from the inputs.

Raises:

Z3fdbError if store cannot be created.