Skip to content

Commit 4f61723

Browse files
author
Benjamin Fildier
committed
check figures
1 parent 88a8d18 commit 4f61723

2 files changed

Lines changed: 27 additions & 19 deletions

File tree

scripts/Fig2_Average_profiles.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@
2323
#dir_profile = "/media/ludo/DATA/google-drive/Thèse/EUREC4a/github/Input/Products/"
2424
#path_to_sonde_profiles = os.path.join(dir_profile,"rad_profiles_all_sondes_ERA.nc")
2525

26-
dir_profile = "/Users/annaleaalbright/Dropbox/EUREC4A/RadiativeProfiles/Data/"
27-
fp_rad_profiles = os.path.join(dir_profile, "rad_profiles_all_sondes_ERA.nc")
26+
#dir_profile = "/Users/annaleaalbright/Dropbox/EUREC4A/RadiativeProfiles/Data/"
27+
#fp_rad_profiles = os.path.join(dir_profile, "rad_profiles_all_sondes_ERA.nc")
28+
29+
dir_profile = "../output/rad_profiles"
30+
fp_rad_profiles = os.path.join(dir_profile,"rad_profiles.nc")
31+
2832
sonde_profiles = xr.open_dataset(fp_rad_profiles)
2933

34+
3035
def get_relative_humidity(profiles):
3136

3237
profiles["play"].attrs['units'] = 'hPa'
@@ -165,6 +170,6 @@ def plot_average_profiles(profiles):
165170

166171
fig.subplots_adjust(left=0, bottom=0, right=1, top=1, wspace=None, hspace=None)
167172

168-
fig.savefig('/Users/annaleaalbright/Dropbox/EUREC4A/RadiativeProfiles/Figures/Paper_figures/Fig2_Average_profiles_edit.png')
173+
fig.savefig('../figures/Fig2_Average_profiles.png')
169174

170175
plot_average_profiles(sonde_profiles)

scripts/Fig4_Day_to_day_variability.py

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,11 @@
2727
matplotlib.rcParams.update({'font.size': 24})
2828

2929
#Directory where sondes are stored
30-
dir_profile = "/media/ludo/DATA/google-drive/Thèse/EUREC4a/github/Input/Products/"
31-
path_to_sonde_profiles = os.path.join(dir_profile,"rad_profiles_all_sondes_ERA.nc")
30+
#dir_profile = "/media/ludo/DATA/google-drive/Thèse/EUREC4a/github/Input/Products/"
31+
#path_to_sonde_profiles = os.path.join(dir_profile,"rad_profiles_all_sondes_ERA.nc")
32+
33+
dir_profile = "../output/rad_profiles"
34+
path_to_sonde_profiles = os.path.join(dir_profile,"rad_profiles.nc")
3235

3336
sonde_profiles = xr.open_dataset(path_to_sonde_profiles)
3437

@@ -65,13 +68,13 @@ def get_variables_day_to_day(profiles):
6568
return time, zlay, q_rad, q_rad_lw, q_rad_sw
6669

6770
def plot_day_to_day(profiles):
68-
69-
time, zlay, q_rad, q_rad_lw, q_rad_sw = get_variables_day_to_day(profiles)
70-
71-
dates_list = [date for date in time]
72-
71+
72+
time, zlay, q_rad, q_rad_lw, q_rad_sw = get_variables_day_to_day(profiles)
73+
74+
dates_list = [date for date in time]
75+
7376
fig, ax = plt.subplots(3,1,figsize=(20,30))
74-
77+
7578
fig.subplots_adjust(left=0.1, bottom=0.2, right=0.9, top=0.9, wspace=0.2, hspace=0.2)
7679

7780
pad=10
@@ -87,22 +90,22 @@ def plot_day_to_day(profiles):
8790

8891
ymin=0
8992
ymax=10
90-
93+
9194
colormap = matplotlib.cm.get_cmap("RdBu_r")
9295
val_min = -4
9396
val_max = 4
9497

9598
zlay=zlay/1000
96-
99+
97100
ax[0].pcolormesh(dates_list, zlay, q_rad_sw, cmap=colormap,vmin=val_min, vmax=val_max)
98101
ax[1].pcolormesh(dates_list, zlay, q_rad_lw, cmap=colormap,vmin=val_min, vmax=val_max)
99102
im = ax[2].pcolormesh(dates_list, zlay, q_rad, cmap=colormap,vmin=val_min, vmax=val_max)
100103

101104
myFmt = mdates.DateFormatter('%m-%d')
102-
105+
103106
ini = np.datetime64('2020-01-19 00:00:00')
104107
end = np.datetime64('2020-02-17 00:00:00')
105-
108+
106109
for k in range(3):
107110
ax[k].xaxis.set_major_formatter(myFmt)
108111
ax[k].set_ylim([0,ymax])
@@ -112,14 +115,14 @@ def plot_day_to_day(profiles):
112115
ticks = ax[k].get_xticks()
113116
ax[k].set_xticks(np.linspace(ticks[0], ticks[-1], 10))
114117

115-
ax[0].tick_params(labelbottom=False)
116-
ax[1].tick_params(labelbottom=False)
118+
ax[0].tick_params(labelbottom=False)
119+
ax[1].tick_params(labelbottom=False)
117120

118121
x,y,w,h = ax[2].get_position().bounds
119122
c_map_ax = fig.add_axes([x, y-0.25*h, 1*w, 0.06*h])
120123
cbar = fig.colorbar(im,cax=c_map_ax, orientation="horizontal", extend="both")
121124
cbar.ax.set_xlabel('Heating Rate (K/day)',color='k') # cbar legend
122-
123-
fig.savefig('../Figures/Fig5_Day_to_day_variability.jpg')
125+
126+
fig.savefig('../Figures/Fig5_Day_to_day_variability.jpg')
124127

125128
plot_day_to_day(sonde_BCO)

0 commit comments

Comments
 (0)