polaris.tasks.ocean.analysis.sim_files.expand_template
- polaris.tasks.ocean.analysis.sim_files.expand_template(template, start_year, end_year, simulation_path=None, month_offset=0)[source]
Expand a file-name template over a range of years
$Yis replaced by the four-digit year and$Mby the two-digit month. A template with no$Mgives 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_pathstart_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
month_offset (int, optional) – The number of months after the one a file covers that it is named for. Omega names a monthly mean for the instant it was finalized, the start of the following month (E3SM-Project/Omega#554), so the mean for January of year 1 is in the file named
0001-02. Theyearandmonthof each file are the ones it covers.
- Returns:
sim_files (list of SimFile) – The expanded files, in chronological order