Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modified scripts/plot_proftrace.py to close figures after saving to file #151

Merged
merged 3 commits into from
Dec 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions scripts/plot_proftrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,13 +297,13 @@ def collect_statistics(setdict):
# entries in a list
# if they are not a list, assert them as a list
it = sd['it']
it = [it] if type(it) is not list else it
it = [it] if not isinstance(it, list) else it
use = sd['use']
use = [use] if type(use) is not list else use
use = [use] if not isinstance(use, list) else use
typ = sd['typ']
typ = [typ] if type(typ) is not list else typ
typ = [typ] if not isinstance(typ, list) else typ
styp = sd['styp']
styp = [styp] if type(styp) is not list else styp
styp = [styp] if not isinstance(styp, list) else styp
# extract variable from gdas
stat = gdas.extract(var) # t, uv, q, etc.
# date it obs use
Expand Down Expand Up @@ -1074,12 +1074,14 @@ def plot_cpen_traces(penList, countList, nameList, dateList,
plt.ioff()
fig_prof.savefig(errProName, bbox_inches='tight',
facecolor='w')
plt.close()
if penProName is not None:
fig_prof = plot_cpen_profiles(cpen_profs, nobs_profs,
name_list, levl_profs)
plt.ioff()
fig_prof.savefig(penProName, bbox_inches='tight',
facecolor='w')
plt.close()
#
# Generate trace plots
#
Expand All @@ -1090,13 +1092,15 @@ def plot_cpen_traces(penList, countList, nameList, dateList,
plt.ioff()
fig_trace.savefig(errTraName, bbox_inches='tight',
facecolor='w')
plt.close()
if penTraName is not None:
fig_trace = plot_cpen_traces(cpen_trace, nobs_trace,
name_list, date_trace,
tskip=tskip)
plt.ioff()
fig_trace.savefig(penTraName, bbox_inches='tight',
facecolor='w')
plt.close()
##############################################################
else:
print('No Figure Cards Found, Exiting...')
Loading