mpas_analysis.shared.climatology.RemapMpasClimatologySubtask¶
- class mpas_analysis.shared.climatology.RemapMpasClimatologySubtask(mpasClimatologyTask, parentTask, climatologyName, variableList, seasons, comparisonGridNames=None, iselValues=None, subtaskName='remapMpasClimatology', useNcremap=None, vertices=False)[source]¶
An analysis tasks for computing climatologies from output from the
timeSeriesStatsMonthly
analysis member.- Variables
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 climatologiesiselValues (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.comparisonDescriptors (dict of
MeshDescriptor
) – Descriptors of the comparison grids to use for remapping, with grid names as the keys.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)
op ({'avg', 'min', 'max'}) – operator for monthly stats
vertices (bool) – Whether to remap from vertices, rather than cells
- __init__(mpasClimatologyTask, parentTask, climatologyName, variableList, seasons, comparisonGridNames=None, iselValues=None, subtaskName='remapMpasClimatology', useNcremap=None, vertices=False)[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 remappedparentTask (
AnalysisTask
) – The parent task, used to get thetaskName
,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 climatologiesseasons (list of str) – A list of seasons (keys in
shared.constants.monthDictionary
) to be computed or [‘none’] (notNone
) if only monthly climatologies are needed.comparisonGridNames (list of str) – 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.
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
.vertices (bool, optional) – Whether to remap from vertices, rather than cells
Methods
__init__
(mpasClimatologyTask, parentTask, ...)Construct the analysis task and adds it as a subtask of the
parentTask
.Add a custom grid descriptor (something other than 'latlon', 'antarctic', 'arctic', 'north_atlantic', or 'north_pacific', or 'subpolar_north_atlantic').
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
.close
()Close the Process object.
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
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 analysisPerform 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.