Skip to content

Commit

Permalink
Merge pull request #1053 from xylar/fix-velocity-difference-colormap
Browse files Browse the repository at this point in the history
A few fixes to climatology maps of velocity
  • Loading branch information
xylar authored Jan 21, 2025
2 parents b892c8c + 761f6cb commit 2340566
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 12 deletions.
33 changes: 29 additions & 4 deletions mpas_analysis/default.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2036,12 +2036,10 @@ obs = ['WOA23']


[climatologyMapVel]
## options related to plotting climatology maps of Antarctic fields at various
## levels, including the sea floor against control model results and SOSE
## reanalysis data
## options related to plotting climatology maps of velocity components and
## matnitude

# comparison grid(s)
# only the Antarctic really makes sense but lat-lon could technically work.
comparisonGrids = ['latlon']

# Months or seasons to plot (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct,
Expand Down Expand Up @@ -2072,6 +2070,15 @@ normTypeResult = linear
# A dictionary with keywords for the norm
normArgsResult = {'vmin': -0.2, 'vmax': 0.2}

# colormap for differences
colormapNameDifference = balance
# whether the colormap is indexed or continuous
colormapTypeDifference = continuous
# the type of norm used in the colormap
normTypeDifference = linear
# A dictionary with keywords for the norm
normArgsDifference = {'vmin': -0.2, 'vmax': 0.2}


[climatologyMapVel_VelocityMagnitudeShallow]

Expand All @@ -2084,6 +2091,15 @@ normTypeResult = log
# A dictionary with keywords for the norm
normArgsResult = {'vmin': 1.e-3, 'vmax': 1.}

# colormap for differences
colormapNameDifference = balance
# whether the colormap is indexed or continuous
colormapTypeDifference = continuous
# the type of norm used in the colormap
normTypeDifference = linear
# A dictionary with keywords for the norm
normArgsDifference = {'vmin': -0.2, 'vmax': 0.2}


[climatologyMapVel_VelocityMagnitudeDeep]

Expand All @@ -2096,6 +2112,15 @@ normTypeResult = log
# A dictionary with keywords for the norm
normArgsResult = {'vmin': 1.e-4, 'vmax': 5.e-1}

# colormap for differences
colormapNameDifference = balance
# whether the colormap is indexed or continuous
colormapTypeDifference = continuous
# the type of norm used in the colormap
normTypeDifference = linear
# A dictionary with keywords for the norm
normArgsDifference = {'vmin': -0.2, 'vmax': 0.2}


[climatologyMapSose]
## options related to plotting climatology maps of Antarctic fields at various
Expand Down
15 changes: 7 additions & 8 deletions mpas_analysis/ocean/climatology_map_vel.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# distributed with this code, or at
# https://raw.githubusercontent.com/MPAS-Dev/MPAS-Analysis/main/LICENSE
"""
Analysis tasks for comparing Antarctic climatology maps against observations
and reanalysis data.
An analysis task for plotting climatologies of velocity components and
magnitude
"""
# Authors
# -------
Expand All @@ -32,8 +32,8 @@

class ClimatologyMapVel(AnalysisTask):
"""
An analysis task for comparison of antarctic field against the Southern
Ocean State Estimate
An analysis task for plotting climatologies of velocity components and
magnitude
"""
# Authors
# -------
Expand Down Expand Up @@ -185,12 +185,11 @@ def __init__(self, config, mpasClimatologyTask,
outFileLabel = fieldPrefix
refTitleLabel = None
diffTitleLabel = None
galleryName = 'Velocity'
galleryGroup = 'Velocity'
if controlConfig is not None:
refFieldName = field['mpas']
controlRunName = controlConfig.get('runs', 'mainRunName')
galleryName = f'Control: {controlRunName}'
refTitleLabel = galleryName
refTitleLabel = f'Control: {controlRunName}'
diffTitleLabel = 'Main - Control'

if field['3D']:
Expand Down Expand Up @@ -243,7 +242,7 @@ def __init__(self, config, mpasClimatologyTask,
diffTitleLabel=diffTitleLabel,
unitsLabel=field['units'],
imageCaption=field['titleName'],
galleryGroup=galleryName,
galleryGroup=galleryGroup,
groupSubtitle=None,
groupLink=f'{fieldPrefix}Vel',
galleryName=field['titleName'],
Expand Down

0 comments on commit 2340566

Please sign in to comment.