mpas_analysis.shared.climatology.RemapMpasClimatologySubtask¶
-
class
mpas_analysis.shared.climatology.
RemapMpasClimatologySubtask
(mpasClimatologyTask, parentTask, climatologyName, variableList, seasons, comparisonGridNames=['latlon'], iselValues=None, subtaskName='remapMpasClimatology', useNcremap=None)[source]¶ An analysis tasks for computing climatologies from output from the
timeSeriesStatsMonthly
analysis member.Attributes: - climatologyName : str
A name that describes the climatology (e.g. a short version of the important field(s) in the climatology) used to name the subdirectories for each stage of the climatology
- variableList : list of str
A list of variable names in
timeSeriesStatsMonthly
to be included in the climatologies- iselValues : dict
A dictionary of dimensions and indices (or
None
) used to extract a slice of the MPAS field.- seasons : list of str
A list of seasons (keys in
shared.constants.monthDictionary
) over which the climatology should be computed or [‘none’] if only monthly climatologies are needed.- comparisonGridNames : list of {‘latlon’, ‘antarctic’}
The name(s) of the comparison grid to use for remapping.
- restartFileName : str
If
comparisonGridName
is notNone
, the name of a restart file from which the MPAS mesh can be read.- useNcremap : bool, optional
Whether to use ncremap to do the remapping (the other option being an internal python code that handles more grid types and extra dimensions)
-
__init__
(mpasClimatologyTask, parentTask, climatologyName, variableList, seasons, comparisonGridNames=['latlon'], iselValues=None, subtaskName='remapMpasClimatology', useNcremap=None)[source]¶ Construct the analysis task and adds it as a subtask of the
parentTask
.Parameters: - mpasClimatologyTask :
MpasClimatologyTask
The task that produced the climatology to be remapped
- parentTask :
AnalysisTask
The parent task, used to get the
taskName
,config
andcomponentName
- climatologyName : str
A name that describes the climatology (e.g. a short version of the important field(s) in the climatology) used to name the subdirectories for each stage of the climatology
- variableList : list of str
A list of variable names in
timeSeriesStatsMonthly
to be included in the climatologies- seasons : list of str, optional
A list of seasons (keys in
shared.constants.monthDictionary
) to be computed or [‘none’] (notNone
) if only monthly climatologies are needed.- comparisonGridNames : list of {‘latlon’, ‘antarctic’}, optional
The name(s) of the comparison grid to use for remapping.
- iselValues : dict, optional
A dictionary of dimensions and indices (or
None
) used to extract a slice of the MPAS field(s).- subtaskName : str, optional
The name of the subtask
- useNcremap : bool, optional
Whether to use ncremap to do the remapping (the other option being an internal python code that handles more grid types and extra dimensions). This defaults to the config option
useNcremap
if it is not explicitly given. If a comparison grid other thanlatlon
is given, ncremap is not supported so this flag is set toFalse
.
- mpasClimatologyTask :
Methods
__init__
(mpasClimatologyTask, parentTask, …)Construct the analysis task and adds it as a subtask of the parentTask
.add_subtask
(subtask)Add a subtask to this tasks. 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
.customize_masked_climatology
(climatology, season)Override this function to customize the climatology during the masking phase (before remapping) customize_remapped_climatology
(climatology, …)Override this function to customize the climatology after remapping get_masked_file_name
(season)Given config options, the name of a field and a string identifying the months in a seasonal climatology, returns the full path for MPAS climatology files before and after remapping. get_remapped_file_name
(season, …)Given config options, the name of a field and a string identifying the months in a seasonal climatology, returns the full path for MPAS climatology files before and after remapping. is_alive
()Return whether process is alive join
([timeout])Wait until child process terminates 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.