Skip to content

Commit 4c2908d

Browse files
fixing clevs for tc; an error that misses one storm (#1009)
1 parent 9032c3d commit 4c2908d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

e3sm_diags/driver/tc_analysis_driver.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,11 @@ def _filter_lines_within_year_bounds(
268268
if year <= data_end_year:
269269
line_ind.append(i)
270270

271-
end_ind = line_ind[-1]
271+
if not line_ind:
272+
return []
272273

273-
new_lines = lines_orig[0:end_ind]
274-
return new_lines
274+
# Include all lines since year filtering already determined valid storms
275+
return lines_orig
275276

276277

277278
def _calc_num_storms_and_max_len(lines: list[str]) -> tuple[int, int]:

e3sm_diags/plot/tc_analysis_plot.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"x_ticks": [240, 300],
3030
"y_ticks": [0, 15, 30],
3131
"title": "African Easterly Wave Density",
32-
"clevs": np.arange(0, 15.1, 1),
32+
"clevs": np.arange(0, 16.1, 2),
3333
"reference": "EAR5 (2000-2014)",
3434
"time_resolution_ratio": 1,
3535
},
@@ -38,7 +38,7 @@
3838
"x_ticks": [0, 60, 120, 180, 240, 300, 359.99],
3939
"y_ticks": [-60, -30, 0, 30, 60],
4040
"title": "TC Tracks Density",
41-
"clevs": np.arange(0, 0.3, 0.05),
41+
"clevs": [0, 0.01, 0.02, 0.05, 0.1, 0.15, 0.2, 0.25],
4242
"reference": "IBTrACS (1979-2018)",
4343
"time_resolution_ratio": 2,
4444
},
@@ -276,6 +276,7 @@ def plot_panel(n, fig, proj, var, var_num_years, region, title):
276276
lon = xc.get_dim_coords(var, axis="X")
277277

278278
var = var.squeeze()
279+
279280
p1 = ax.contourf(
280281
lon,
281282
lat,
@@ -306,9 +307,9 @@ def plot_panel(n, fig, proj, var, var_num_years, region, title):
306307
ax.yaxis.set_ticks_position("left")
307308

308309
cbax = fig.add_axes(
309-
(PANEL_CFG[n][0] + 0.6635, PANEL_CFG[n][1] + 0.0215, 0.0326, 0.1792)
310+
(PANEL_CFG[n][0] + 0.6635, PANEL_CFG[n][1] + 0.0415, 0.0326, 0.1792)
310311
)
311312
cbar = fig.colorbar(p1, cax=cbax)
312-
313+
cbar.set_ticks(clevs)
313314
cbar.ax.tick_params(labelsize=9.0, length=0)
314315
return

0 commit comments

Comments
 (0)