polaris.tasks.ocean.analysis.ncclimo.find_climatology_file

polaris.tasks.ocean.analysis.ncclimo.find_climatology_file(work_dir, season)[source]

Find the ncclimo output file for one season

ncclimo names its output <caseid>_<season>_<start>_<end>_climo.nc. Steps that read a climatology glob on the season rather than reconstructing that pattern, which is robust to what ncclimo makes of the case name and to its naming changing. The one substitution that has to be made is that the twelve monthly climatologies are named by month number rather than by JAN through DEC.

Parameters:
  • work_dir (str) – The work directory of the step that computed the climatology

  • season (str) – The season to find, e.g. 'ANN' or 'JAN'

Returns:

filename (str) – The absolute path to the climatology file

Raises:
  • FileNotFoundError – If no file for that season is there

  • ValueError – If more than one file matches, which would make the choice arbitrary