Commit 2b0488b5 authored by Kennedy, Joseph H's avatar Kennedy, Joseph H
Browse files

Fix yearly cylce plots (were only showing out to 10 months)

parent 43438289
......@@ -16,7 +16,7 @@ def make_plot(config=None, out_path='.',
img_list = []
months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
percent_vals = []
model_vals = []
cldsat_vals = []
......@@ -25,17 +25,17 @@ def make_plot(config=None, out_path='.',
for month in months:
# CESM1
f_cesm = os.path.join(cesm_path, "postproc", "atm", "climos",
"b.e10.BG20TRCN.f09_g16.002_{}_aavg_climo.nc".format(month))
"b.e10.BG20TRCN.f09_g16.002_{:02d}_aavg_climo.nc".format(month))
ncid1 = Dataset(f_cesm, mode='r')
model_cld = ncid1.variables['CLDHGH'][0]
# CLDSAT
f_cloudsat = os.path.join(cloud_path, "CLOUDSAT_{}_aavg_climo.nc".format(month))
f_cloudsat = os.path.join(cloud_path, "CLOUDSAT_{:02d}_aavg_climo.nc".format(month))
ncid2 = Dataset(f_cloudsat, mode='r')
cldsat_cld = ncid2.variables['CLDHGH'][0]
# ISCCP
f_isccp = os.path.join(cloud_path, "ISCCP_{}_aavg_climo.nc".format(month))
f_isccp = os.path.join(cloud_path, "ISCCP_{:02d}_aavg_climo.nc".format(month))
ncid3 = Dataset(f_isccp, mode='r')
isccp_cld = ncid3.variables['CLDHGH'][0]
......@@ -58,8 +58,10 @@ def make_plot(config=None, out_path='.',
plt.plot(months, isccp_vals, 'c-.')
plt.xlabel('Months of climatology')
plt.ylabel('Percent total cloud')
plt.tight_layout()
img_path = os.path.join(out_path, 'CESM_yearly_cycle_CLDHGH.png')
plt.savefig(img_path, bbox_inches='tight')
plt.savefig(img_path)
plt.close()
img_link = os.path.join(os.path.basename(out_path),
......
......@@ -16,7 +16,7 @@ def make_plot(config=None, out_path='.',
img_list = []
months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
percent_vals = []
model_vals = []
cldsat_vals = []
......@@ -26,17 +26,17 @@ def make_plot(config=None, out_path='.',
# ---------------- Data source at OLCF ------------------------
# CESM1
input_file1 = os.path.join(cesm_path, "postproc", "atm", "climos",
"b.e10.BG20TRCN.f09_g16.002_{}_aavg_climo.nc".format(month))
"b.e10.BG20TRCN.f09_g16.002_{:02d}_aavg_climo.nc".format(month))
ncid1 = Dataset(input_file1, mode='r')
model_cld = ncid1.variables['CLDLOW'][0]
# CLDSAT
f_cloudsat = os.path.join(cloud_path, "CLOUDSAT_{}_aavg_climo.nc".format(month))
f_cloudsat = os.path.join(cloud_path, "CLOUDSAT_{:02d}_aavg_climo.nc".format(month))
ncid2 = Dataset(f_cloudsat, mode='r')
cldsat_cld = ncid2.variables['CLDLOW'][0]
# ISCCP
f_isccp = os.path.join(cloud_path, "ISCCP_{}_aavg_climo.nc".format(month))
f_isccp = os.path.join(cloud_path, "ISCCP_{:02d}_aavg_climo.nc".format(month))
ncid3 = Dataset(f_isccp, mode='r')
isccp_cld = ncid3.variables['CLDLOW'][0]
......@@ -59,8 +59,10 @@ def make_plot(config=None, out_path='.',
plt.plot(months, isccp_vals, 'c-.')
plt.xlabel('Months of climatology')
plt.ylabel('Percent total cloud')
plt.tight_layout()
img_path = os.path.join(out_path, 'CESM_yearly_cycle_CLDLOW.png')
plt.savefig(img_path, bbox_inches='tight')
plt.savefig(img_path)
plt.close()
img_link = os.path.join(os.path.basename(out_path),
......
......@@ -16,7 +16,7 @@ def make_plot(config=None, out_path='.',
img_list = []
months = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']
months = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]
percent_vals = []
model_vals = []
cldsat_vals = []
......@@ -26,17 +26,17 @@ def make_plot(config=None, out_path='.',
# ---------------- Data source at OLCF ------------------------
# CESM1
f_cesm = os.path.join(cesm_path, "postproc", "atm", "climos",
"b.e10.BG20TRCN.f09_g16.002_{}_aavg_climo.nc".format(month))
"b.e10.BG20TRCN.f09_g16.002_{:02d}_aavg_climo.nc".format(month))
ncid1 = Dataset(f_cesm, mode='r')
model_cld = ncid1.variables['CLDTOT'][0]
# CLDSAT
f_cloudsat = os.path.join(cloud_path, "CLOUDSAT_{}_aavg_climo.nc".format(month))
f_cloudsat = os.path.join(cloud_path, "CLOUDSAT_{:02d}_aavg_climo.nc".format(month))
ncid2 = Dataset(f_cloudsat, mode='r')
cldsat_cld = ncid2.variables['CLDTOT'][0]
# ISCCP
f_isccp = os.path.join(cloud_path, "ISCCP_{}_aavg_climo.nc".format(month))
f_isccp = os.path.join(cloud_path, "ISCCP_{:02d}_aavg_climo.nc".format(month))
ncid3 = Dataset(f_isccp, mode='r')
isccp_cld = ncid3.variables['CLDTOT'][0]
......@@ -59,8 +59,10 @@ def make_plot(config=None, out_path='.',
plt.plot(months, isccp_vals, 'c-.')
plt.xlabel('Months of climatology')
plt.ylabel('Percent total cloud')
plt.tight_layout()
img_path = os.path.join(out_path, 'CESM_yearly_cycle_CLDTOT.png')
plt.savefig(img_path, bbox_inches='tight')
plt.savefig(img_path)
plt.close()
img_link = os.path.join(os.path.basename(out_path),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment