fre.app.generate_time_averages.wrapper module

climatology computation routines for fre/app/generate_time_averages

fre.app.generate_time_averages.wrapper.extract_variables_from_files(files: list[str]) list[str]

Utility to extract “variable” part of a list of input files, outputting a list of variables. e.g. ‘ocean_annual.1958-1962.evs.nc’ will return ‘evs’

Parameters:

files (list[str]) – List of relative path filenames to parse

Returns:

List of variables

Return type:

list[str]

fre.app.generate_time_averages.wrapper.generate_wrapper(cycle_point: str, dir_: str, sources: list[str], output_interval: str, input_interval: str, grid: str, frequency: str, pkg: str = 'fre-nctools') None

Run climatology tool on a subset of timeseries

Parameters:
  • cycle_point (ISO8601 time-point) – Beginning of the climatology

  • dir (str) – Root shards directory

  • sources (list[str]) – List of history files to average

  • output_interval (ISO8601 duration) – Desired output interval

  • input_interval (ISO8601 duration) – Input timeseries length

  • frequency (ISO8601 duration) – Period to average: ‘yr’ or ‘mon’

  • pkg (str) – Package to use for time averaging (‘fre-nctools’, ‘cdo’, ‘fre-python-tools’)

Raises:
  • ValueError – Only monthly and annual frequencies allowed

  • FileNotFoundError – Missing input timeseries files

Return type:

None