Skip to content

Commit

Permalink
Add moving average points to conservation task
Browse files Browse the repository at this point in the history
  • Loading branch information
cbegeman committed Jul 17, 2024
1 parent fe74bff commit ff6c80d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions mpas_analysis/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ fitColor1 = tab:blue
# land_ice_mass_flux_components : Mass fluxes from land ice
plotTypes = ['absolute_energy_error', 'absolute_salt_error', 'total_mass_change']

# Number of points over which to compute moving average(e.g., for monthly
# output, movingAveragePoints=12 corresponds to a 12-month moving average
# window)
movingAveragePoints = 365

[index]
## options related to producing nino index.
Expand Down
8 changes: 5 additions & 3 deletions mpas_analysis/ocean/conservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,9 +468,11 @@ def _make_plot(self, plot_type):
lineStyles.append(lineStylesBase[index])

lineWidths = [3 for i in fields]
if config.has_option('timeSeries', 'movingAveragePoints'):
movingAveragePoints = config.getint('timeSeries',
'movingAveragePoints')
if config.has_option('timeSeriesConservation', 'movingAveragePoints'):
# We assume here that movingAveragePoints is given in months
# and conservation output has daily frequency
movingAveragePoints = \
config.getint('timeSeriesConservation', 'movingAveragePoints')
else:
movingAveragePoints = None

Expand Down

0 comments on commit ff6c80d

Please sign in to comment.