Tutorial API Docs#

tutorial.ERA5DataClass#

class pyearthtools.tutorial.ERA5DataClass.ERA5LowResIndex(variables, *, level_value=None, transforms=None)#

ECWMF ReAnalysis v5

Setup ERA5 Low-Res Indexer

Parameters:
  • variables (list[str] | str) – Data variables to retrieve

  • resolution (Literal[ERA_RES], optional) – Resolution of data, must be one of ‘monthly-averaged’,’monthly-averaged-by-hour’, ‘reanalysis’. Defaults to ‘reanalysis’.

  • level_value (int | float | list[int | float] | tuple[list | int, ...] | None) – (int, optional): Level value to select if data contains levels. Defaults to None.

  • transforms (Transform | TransformCollection, optional) – Base Transforms to apply. Defaults to TransformCollection().

filesystem(querytime)#

Find datafiles given args on local filesystem.

Must be implemented by child class to specify data.

Can return a dictionary[str, str], tuple, list or path representing the files to load.

Parameters:

querytime (str | Petdt)

Return type:

Path | dict[str, str | Path]

class pyearthtools.tutorial.ERA5DataClass.ERA5LowResDemoIndex(variables, *, level_value=None, transforms=None, filename_override=None, product=None)#

ECWMF ReAnalysis v5

Setup ERA5 Low-Res Indexer

Parameters:
  • variables (list[str] | str) – Data variables to retrieve

  • resolution (Literal[ERA_RES], optional) – Resolution of data, must be one of ‘monthly-averaged’,’monthly-averaged-by-hour’, ‘reanalysis’. Defaults to ‘reanalysis’.

  • level_value (int | float | list[int | float] | tuple[list | int, ...] | None) – (int, optional): Level value to select if data contains levels. Defaults to None.

  • transforms (Transform | TransformCollection, optional) – Base Transforms to apply. Defaults to TransformCollection().

filesystem(querytime)#

Find datafiles given args on local filesystem.

Must be implemented by child class to specify data.

Can return a dictionary[str, str], tuple, list or path representing the files to load.

Parameters:

querytime (str | Petdt)

Return type:

Path | dict[str, str | Path]

load(*args, **kwargs)#

This particular example has all its data in a single file, so repeatedly loading files is avoided through caching the loaded dataset. This isn’t a great general pattern, but works well for the tutorial.