2727matplotlib .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
3336sonde_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
6770def 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
125128plot_day_to_day (sonde_BCO )
0 commit comments