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.

Attributes
variableListdict 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.

allVariableslist of str

A list of all available variable names in the stream used to raise an exception when an unavailable variable is requested

inputFileslist of str

A list of input files used to compute the climatologies.

ncclimoModel{‘mpaso’, ‘mpascice’}

The name of the component expected by ncclimo

startDate, endDatestr

The start and end dates of the climatology as strings

startYear, endYearint

The start and end years of the climatology

seasonSubtasksdict

If using xarray to compute climatologies, a dictionary of subtasks, one for each possible season

op{‘avg’, ‘min’, ‘max’}

operator for monthly stats

streamNamestr

The name of the stream to read from, one of timeSeriesStatsMonthlyOutput, timeSeriesStatsMonthlyMinOutput, timeSeriesStatsMonthlyMaxOutput

__init__(self, config, componentName, taskName=None, op='avg')[source]

Construct the analysis task.

Parameters
configMpasAnalysisConfigParser

Contains configuration options

componentName{‘ocean’, ‘seaIce’}

The name of the component (same as the folder where the task resides)

op{‘avg’, ‘min’, ‘max’}, optioinal

operator for monthly stats

taskNamestr, optional

the name of the task, defaults to mpasClimatology<ComponentName><Op>

Methods

__init__(self, config, componentName[, …])

Construct the analysis task.

add_subtask(self, subtask)

Add a subtask to this tasks.

add_variables(self, variableList[, seasons])

Add one or more variables and optionally one or more seasons for which to compute climatologies.

check_analysis_enabled(self, analysisOptionName)

Check to make sure a given analysis is turned on, issuing a warning or raising an exception if not.

check_generate(self)

Determines if this analysis should be generated, based on the generate config option and taskName, componentName and tags.

close(self)

Close the Process object.

get_file_name(self, season)

Returns the full path for MPAS climatology file produced by ncclimo.

get_start_and_end(self)

Get the start and end years and dates for the climatology.

is_alive(self)

Return whether process is alive

join(self[, timeout])

Wait until child process terminates

kill(self)

Terminate process; sends SIGKILL signal or uses TerminateProcess()

run(self[, writeLogFile])

Sets up logging and then runs the analysis task.

run_after(self, task)

Only run this task after the given task has completed.

run_task(self)

Compute the requested climatologies

set_start_end_date(self, section)

Set the start and end dates in the config correspond to the start and end years in a given category of analysis

setup_and_check(self)

Perform steps to set up the analysis and check for errors in the setup.

start(self)

Start child process

terminate(self)

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.