mpas_analysis.shared.climatology.RemapMpasClimatologySubtask¶
-
class
mpas_analysis.shared.climatology.
RemapMpasClimatologySubtask
(mpasClimatologyTask, parentTask, climatologyName, variableList, seasons, comparisonGridNames=None, iselValues=None, subtaskName='remapMpasClimatology', useNcremap=None)[source]¶ An analysis tasks for computing climatologies from output from the
timeSeriesStatsMonthly
analysis member.- Attributes
- climatologyNamestr
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
- variableListlist of str
A list of variable names in
timeSeriesStatsMonthly
to be included in the climatologies- iselValuesdict
A dictionary of dimensions and indices (or
None
) used to extract a slice of the MPAS field.- seasonslist 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.- comparisonDescriptorsdict of
MeshDescriptor
Descriptors of the comparison grids to use for remapping, with grid names as the keys.
- restartFileNamestr
If
comparisonGridName
is notNone
, the name of a restart file from which the MPAS mesh can be read.- useNcremapbool, 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)
- op{‘avg’, ‘min’, ‘max’}
operator for monthly stats
-
__init__
(self, mpasClimatologyTask, parentTask, climatologyName, variableList, seasons, comparisonGridNames=None, 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
- climatologyNamestr
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
- variableListlist of str
A list of variable names in
timeSeriesStatsMonthly
to be included in the climatologies- seasonslist of str
A list of seasons (keys in
shared.constants.monthDictionary
) to be computed or [‘none’] (notNone
) if only monthly climatologies are needed.- comparisonGridNameslist of {‘latlon’, ‘antarctic’, ‘arctic’},
optional The name(s) of the comparison grid to use for remapping. If none is supplied, add_comparison_descriptor() must be called to add one or more comparison grids.
- iselValuesdict, optional
A dictionary of dimensions and indices (or
None
) used to extract a slice of the MPAS field(s).- subtaskNamestr, optional
The name of the subtask
- useNcremapbool, 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__
(self, mpasClimatologyTask, …[, …])Construct the analysis task and adds it as a subtask of the
parentTask
.add_comparison_grid_descriptor
(self, …)Add a custom grid descriptor (something other than ‘latlon’ or ‘antarctic’ or ‘arctic’).
add_subtask
(self, subtask)Add a subtask to this tasks.
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 andtaskName
,componentName
andtags
.close
(self)Close the Process object.
customize_masked_climatology
(self, …)Override this function to customize the climatology during the masking phase (before remapping)
customize_remapped_climatology
(self, …)Override this function to customize the climatology after remapping
get_masked_file_name
(self, 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
(self, 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
(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 analysissetup_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.