mpas_analysis.shared.climatology.MpasClimatologyTask¶
- class mpas_analysis.shared.climatology.MpasClimatologyTask(config, componentName, taskName=None, op='avg')[source]¶
An analysis tasks for computing climatologies from output from the
timeSeriesStatsMonthly*
analysis members.- Variables
variableList (dict of lists) – A dictionary with seasons as keys and a list of variable names in the stream to be included in the climatologies for each season in the values.
allVariables (list of str) – A list of all available variable names in the stream used to raise an exception when an unavailable variable is requested
inputFiles (list of str) – A list of input files used to compute the climatologies.
ncclimoModel ({'mpaso', 'mpascice'}) – The name of the component expected by
ncclimo
endDate (startDate,) – The start and end dates of the climatology as strings
endYear (startYear,) – The start and end years of the climatology
seasonSubtasks (dict) – If using xarray to compute climatologies, a dictionary of subtasks, one for each possible season
op ({'avg', 'min', 'max'}) – operator for monthly stats
streamName (str) – The name of the stream to read from, one of
timeSeriesStatsMonthlyOutput
,timeSeriesStatsMonthlyMinOutput
,timeSeriesStatsMonthlyMaxOutput
- __init__(config, componentName, taskName=None, op='avg')[source]¶
Construct the analysis task.
- Parameters
config (
MpasAnalysisConfigParser
) – Contains configuration optionscomponentName ({'ocean', 'seaIce'}) – The name of the component (same as the folder where the task resides)
op ({'avg', 'min', 'max'}, optioinal) – operator for monthly stats
taskName (str, optional) – the name of the task, defaults to mpasClimatology<ComponentName><Op>
Methods
__init__
(config, componentName[, taskName, op])Construct the analysis task.
add_subtask
(subtask)Add a subtask to this tasks.
add_variables
(variableList[, seasons])Add one or more variables and optionally one or more seasons for which to compute climatologies.
check_analysis_enabled
(analysisOptionName[, …])Check to make sure a given analysis is turned on, issuing a warning or raising an exception if not.
check_generate
()Determines if this analysis should be generated, based on the
generate
config option andtaskName
,componentName
andtags
.close
()Close the Process object.
get_file_name
(season)Returns the full path for MPAS climatology file produced by ncclimo.
get_start_and_end
()Get the start and end years and dates for the climatology.
is_alive
()Return whether process is alive
join
([timeout])Wait until child process terminates
kill
()Terminate process; sends SIGKILL signal or uses TerminateProcess()
run
([writeLogFile])Sets up logging and then runs the analysis task.
run_after
(task)Only run this task after the given task has completed.
run_task
()Compute the requested climatologies
set_start_end_date
(section)Set the start and end dates in the
config
correspond to the start and end years in a given category of analysissetup_and_check
()Perform steps to set up the analysis and check for errors in the setup.
start
()Start child process
terminate
()Terminate process; sends SIGTERM signal or uses TerminateProcess()
Attributes
BLOCKED
FAIL
READY
RUNNING
SUCCESS
UNSET
authkey
daemon
Return whether process is a daemon
exitcode
Return exit code of process or None if it has yet to stop
ident
Return identifier (PID) of process or None if it has yet to start
name
pid
Return identifier (PID) of process or None if it has yet to start
sentinel
Return a file descriptor (Unix) or handle (Windows) suitable for waiting for process termination.