data_source

Data source helper class.

Functions

cosmo_grib_defs()

Enable COSMO GRIB definitions.

grib_def_ctx(grib_def)

Classes

DataSource(request_template, typing.Any] =)

FDBDataSource(request_template, typing.Any] =)

FileDataSource(request_template, ...)

PolytopeDataSource(request_template, ...)

URLDataSource(request_template, ...)

class meteodatalab.data_source.DataSource(request_template: dict[str, typing.Any] = <factory>)[source]
retrieve(request: dict[str, Any] | str | tuple[str, str] | Request) Iterator[source]
retrieve(request: dict) Iterator
retrieve(request: Request) Iterator
retrieve(request: str) Iterator
retrieve(request: tuple) Iterator

Stream GRIB fields from files or FDB.

Request for data from the source in the mars language.

Simple strings are interpreted as param filters and pairs of strings are interpreted as param and levtype filters.

Key value pairs from the request_template attribute are used as default values. Note that the default values in the mars request passed as an input will take precedence on the template values.

Parameters:

request (dict | str | tuple[str, str] | meteodatalab.mars.Request) – Request for data from the source in the mars language.

Yields:

GribField – GribField instances containing the requested data.

class meteodatalab.data_source.FDBDataSource(request_template: dict[str, typing.Any] = <factory>)[source]
class meteodatalab.data_source.FileDataSource(request_template: dict[str, typing.Any] = <factory>, datafiles: list[str] | None = None)[source]
class meteodatalab.data_source.PolytopeDataSource(request_template: dict[str, typing.Any] = <factory>, polytope_collection: str | None = None)[source]
class meteodatalab.data_source.URLDataSource(request_template: dict[str, typing.Any] = <factory>, urls: list[str] | None = None)[source]
meteodatalab.data_source.cosmo_grib_defs()[source]

Enable COSMO GRIB definitions.