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

  • comparisonDescriptors (dict of MeshDescriptor) – Descriptors of the comparison grids to use for remapping, with grid names as the keys.

  • restartFileName (str) – If comparisonGridName is not None, 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 remapped

  • parentTask (AnalysisTask) – The parent task, used to get the taskName, config and componentName

  • 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) – A list of seasons (keys in shared.constants.monthDictionary) to be computed or [‘none’] (not None) 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 than latlon is given, ncremap is not supported so this flag is set to False.

  • 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_comparison_grid_descriptor(...)

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 and taskName, componentName and tags.

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 analysis

setup_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.