Skip to content

Commit

Permalink
new_ua_temp_colormaps (#251)
Browse files Browse the repository at this point in the history
* new_ua_temp_colormaps
These are some requested changes in the 925mb, 850mb, 700mb, and 500mb temperature contours, to clearly delineate the 0 deg line and provide more clarity in the -5 to +5 C range.  The 500mb scale was changed to match the scales at the other levels.

* Reinstated old t_colors (which is now only used with potential temp) and made a new routine, ua_temp_colors.  Passes local pylint and pytest.
  • Loading branch information
Brian-Jamison authored Feb 24, 2025
1 parent 1afb4ec commit 7fe6c84
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
7 changes: 2 additions & 5 deletions adb_graphics/default_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1674,9 +1674,9 @@ temp: # Temperature
unit: F
wind: 10m
500mb: &ua_temp
clevs: !!python/object/apply:numpy.arange [-70, 10, 2.5]
clevs: !!python/object/apply:numpy.arange [-40, 40, 2.5]
cmap: jet
colors: t_colors
colors: ua_temp_colors
contours:
pres_sfc:
levels: [0, 500]
Expand All @@ -1697,7 +1697,6 @@ temp: # Temperature
wind: True
700mb:
<<: *ua_temp
clevs: !!python/object/apply:numpy.arange [-40, 40, 2.5]
contours:
pres_sfc:
colors: 'k'
Expand All @@ -1711,7 +1710,6 @@ temp: # Temperature
levels: [0, 700]
850mb:
<<: *ua_temp
clevs: !!python/object/apply:numpy.arange [-40, 40, 2.5]
contours:
pres_sfc:
colors: 'k'
Expand All @@ -1723,7 +1721,6 @@ temp: # Temperature
levels: [0, 850]
925mb:
<<: *ua_temp
clevs: !!python/object/apply:numpy.arange [-40, 40, 2.5]
contours:
pres_sfc:
colors: 'k'
Expand Down
14 changes: 13 additions & 1 deletion adb_graphics/specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def soilw_colors(self) -> np.ndarray:
@property
def t_colors(self) -> np.ndarray:

''' Default color map for Upper-Air Temperature '''
''' Default color map for Potential Temperature '''

ncolors = len(self.clevs)
return cm.get_cmap(self.vspec.get('cmap', 'jet'), ncolors)(range(ncolors))
Expand All @@ -499,6 +499,18 @@ def terrain_colors(self) -> np.ndarray:
(range(54, 157, 6))
return ctable

@property
def ua_temp_colors(self) -> np.ndarray:

''' Default color map for Upper-Air Temperature '''

grays = cm.get_cmap('Greys', 27)(range(17, 1, -2))
purples = cm.get_cmap('Purples', 27)(range(17, 1, -2))
ncar = cm.get_cmap(self.vspec.get('cmap'), 128) \
([30, 34, 36, 40, 45, 55, 60, 65, 70, \
75, 80, 85, 90, 95, 100, 115])
return np.concatenate((grays, purples, ncar))

@property
def vis_colors(self) -> np.ndarray:

Expand Down

0 comments on commit 7fe6c84

Please sign in to comment.