polaris.tasks.ocean.analysis.sim_files.expand_template

polaris.tasks.ocean.analysis.sim_files.expand_template(template, start_year, end_year, simulation_path=None)[source]

Expand a file-name template over a range of years

$Y is replaced by the four-digit year and $M by the two-digit month. A template with no $M gives one file per year and a template with neither gives a single file, which is the case for the analysis output Omega writes to one file for a whole run.

Parameters:
  • template (str) – The file-name template, absolute or relative to simulation_path

  • start_year (int) – The first year to expand over, inclusive

  • end_year (int) – The last year to expand over, inclusive

  • simulation_path (str, optional) – The directory a relative template is resolved against

Returns:

sim_files (list of SimFile) – The expanded files, in chronological order