Skip to content

Commit

Permalink
Merge pull request #853 from xylar/add_anomaly_tag
Browse files Browse the repository at this point in the history
Add an `anomaly` tag
  • Loading branch information
xylar committed Jan 23, 2022
2 parents 9a19698 + 83e9874 commit 83ae89f
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 5 deletions.
6 changes: 6 additions & 0 deletions docs/config/output.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ specify::

generate = ['all_publicObs', 'no_seaIce']

If an appropriate reference year isn't available for computing anomalies,
include 'no_anomaly' in the generate list to skip all tasks that require the
reference year for computing anomalies::

generate = ['all_publicObs', 'no_anomaly']

To specify that you wanted to plot climatologies from the ocean component, you
could use::

Expand Down
14 changes: 14 additions & 0 deletions example.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,21 @@ htmlSubdirectory = html
# option:
# mpas_analysis config.analysis --generate \
# only_ocean,no_timeSeries,timeSeriesSST
#
# Note: if an appropriate reference year isn't available for computing
# anomalies, include 'no_anomaly' in the generate list
generate = ['all_publicObs']


[climatology]
## options related to producing climatologies, typically to compare against
## observations and previous runs

# the year from which to compute anomalies if not the start year of the
# simulation. This might be useful if a long spin-up cycle is performed and
# only the anomaly over a later span of years is of interest.
# anomalyRefYear = 249

# the first year over which to average climatalogies
startYear = 11
# the last year over which to average climatalogies
Expand All @@ -181,6 +190,11 @@ endYear = 20
## options related to producing time series plots, often to compare against
## observations and previous runs

# the year from which to compute anomalies if not the start year of the
# simulation. This might be useful if a long spin-up cycle is performed and
# only the anomaly over a later span of years is of interest.
# anomalyRefYear = 249

# start and end years for timeseries analysis. Use endYear = end to indicate
# that the full range of the data should be used. If errorOnMissing = False,
# the start and end year will be clipped to the valid range. Otherwise, out
Expand Down
13 changes: 13 additions & 0 deletions example_e3sm.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,20 @@ htmlSubdirectory = html
# option:
# mpas_analysis config.analysis --generate \
# only_ocean,no_timeSeries,timeSeriesSST
#
# Note: if an appropriate reference year isn't available for computing
# anomalies, include 'no_anomaly' in the generate list
generate = ['all_publicObs']

[climatology]
## options related to producing climatologies, typically to compare against
## observations and previous runs

# the year from which to compute anomalies if not the start year of the
# simulation. This might be useful if a long spin-up cycle is performed and
# only the anomaly over a later span of years is of interest.
# anomalyRefYear = 249

# the first year over which to average climatalogies
startYear = 11
# the last year over which to average climatalogies
Expand All @@ -133,6 +141,11 @@ endYear = 20
## options related to producing time series plots, often to compare against
## observations and previous runs

# the year from which to compute anomalies if not the start year of the
# simulation. This might be useful if a long spin-up cycle is performed and
# only the anomaly over a later span of years is of interest.
# anomalyRefYear = 249

# start and end years for timeseries analysis. Use endYear = end to indicate
# that the full range of the data should be used. If errorOnMissing = False,
# the start and end year will be clipped to the valid range. Otherwise, out
Expand Down
3 changes: 2 additions & 1 deletion mpas_analysis/ocean/climatology_map_ohc_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ def __init__(self, config, mpasClimatologyTask, refYearClimatolgyTask,
super(ClimatologyMapOHCAnomaly, self).__init__(
config=config, taskName='climatologyMapOHCAnomaly',
componentName='ocean',
tags=['climatology', 'horizontalMap', fieldName, 'publicObs'])
tags=['climatology', 'horizontalMap', fieldName, 'publicObs',
'anomaly'])

sectionName = self.taskName

Expand Down
2 changes: 1 addition & 1 deletion mpas_analysis/ocean/time_series_ohc_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, config, mpasTimeSeriesTask, controlConfig=None):
config=config,
taskName='timeSeriesOHCAnomaly',
componentName='ocean',
tags=['timeSeries', 'ohc', 'publicObs'])
tags=['timeSeries', 'ohc', 'publicObs', 'anomaly'])

sectionName = 'timeSeriesOHCAnomaly'
regionNames = config.getExpression(sectionName, 'regions')
Expand Down
2 changes: 1 addition & 1 deletion mpas_analysis/ocean/time_series_salinity_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, config, mpasTimeSeriesTask): # {{{
config=config,
taskName='timeSeriesSalinityAnomaly',
componentName='ocean',
tags=['timeSeries', 'salinity', 'publicObs'])
tags=['timeSeries', 'salinity', 'publicObs', 'anomaly'])

sectionName = 'hovmollerSalinityAnomaly'
regionNames = config.getExpression(sectionName, 'regions')
Expand Down
2 changes: 1 addition & 1 deletion mpas_analysis/ocean/time_series_ssh_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def __init__(self, config, mpasTimeSeriesTask, controlConfig):
config=config,
taskName='timeSeriesSSHAnomaly',
componentName='ocean',
tags=['timeSeries', 'ssh', 'publicObs'])
tags=['timeSeries', 'ssh', 'publicObs', 'anomaly'])

self.controlConfig = controlConfig
self.filePrefix = None
Expand Down
2 changes: 1 addition & 1 deletion mpas_analysis/ocean/time_series_temperature_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def __init__(self, config, mpasTimeSeriesTask): # {{{
config=config,
taskName='timeSeriesTemperatureAnomaly',
componentName='ocean',
tags=['timeSeries', 'temperature', 'publicObs'])
tags=['timeSeries', 'temperature', 'publicObs', 'anomaly'])

sectionName = 'hovmollerTemperatureAnomaly'
regionNames = config.getExpression(sectionName, 'regions')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def __init__(self, config, componentName, taskName=None): # {{{
config=new_config,
componentName=componentName,
taskName=taskName)

self.tags.append('anomaly')
# }}}

def get_start_and_end(self): # {{{
Expand Down

0 comments on commit 83ae89f

Please sign in to comment.