Skip to content

Commit

Permalink
Fixed the bug because of which the layer colorbar wasn't shown on the…
Browse files Browse the repository at this point in the history
… layer-only image.
  • Loading branch information
tkach940 committed Jun 24, 2021
1 parent 85d0820 commit 7fcab2e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
32 changes: 16 additions & 16 deletions oco_vistool.py
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,22 @@ def do_overlay_plot(

if var_lat.ndim == 2:
zip_it = np.ma.dstack([var_lon, var_lat])

# if the XML file exists for the chosen layer
if (layer_url != 'Null'):
cmap2, norm2, ticks_list, bounds_list, units = get_layer_colorbar_params(layer_url)
ax2 = plt.subplot(gs[-1, 2:-2])
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap=cmap2, norm=norm2, orientation = 'horizontal',
ticks = ticks_list + [bounds_list[0], bounds_list[-1]])

for t in cb2.ax.xaxis.get_ticklabels():
t.set_weight("bold")
t.set_fontsize(8)
t.set_rotation(45)

# if units were stated in the XML
if (units != None):
cb2.ax.set_xlabel('# in ' + units, fontdict=dict(weight='bold'))

if color_or_cmap == "cmap" and var_vals.shape[0] > 0:

Expand Down Expand Up @@ -1178,22 +1194,6 @@ def do_overlay_plot(
for t in cb1.ax.yaxis.get_ticklabels():
t.set_weight("bold")
t.set_fontsize(12)

# if the XML file exists for the chosen layer
if (layer_url != 'Null'):
cmap, norm, ticks_list, bounds_list, units = get_layer_colorbar_params(layer_url)
ax2 = plt.subplot(gs[-1, 2:-2])
cb2 = mpl.colorbar.ColorbarBase(ax2, cmap=cmap, norm=norm, orientation = 'horizontal',
ticks = ticks_list + [bounds_list[0], bounds_list[-1]])

for t in cb2.ax.xaxis.get_ticklabels():
t.set_weight("bold")
t.set_fontsize(8)
t.set_rotation(45)

# if units were stated in the XML
if (units != None):
cb2.ax.set_xlabel('# in ' + units, fontdict=dict(weight='bold'))

if color_or_cmap == "color" and var_vals.shape[0] > 0:

Expand Down
2 changes: 1 addition & 1 deletion oco_vistool_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"geo_upper_left": [21, -159],
"geo_lower_right": [17, -154],
"region": "",
"layer": 10,
"layer": 4,
"sensor": "Worldview",
"oco2_overlay_info": {
"file": "oco2_LtCO2_180711_B10206Ar_200730024539s.nc4",
Expand Down

0 comments on commit 7fcab2e

Please sign in to comment.