@@ -96,40 +96,29 @@ def read_experiment_file_vbsl(filename):
9696exp_name = []
9797exp_number = [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 ]
9898
99- #print(full_exp_name[0:13])
100-
10199for f in full_exp_name [0 :13 ]:
102100 volume , tails , basedir = read_experiment_file (f )
103101 volume_no_calving += [np .around (volume ,2 )]
104102 exp_name += [basedir ]
105- #print('Experiment name', exp_number)
106- #print('Volume before calving', volume_no_calving)
107103
108104volume_no_calving_sle = []
109105for value in volume_no_calving :
110106 volume_no_calving_sle .append (calculate_sea_level_equivalent (value ))
111- #print('Volume before calving SLE', volume_no_calving_sle)
112107
113108# Extract volumes for calving experiments
114109# Reading calving experiments contained in 4_2_With_calving_exp_onlyMT
115- #print(full_exp_name[8:len(full_exp_name)])
116110volume_calving = []
117111exp_name_c = []
118112exp_number_c = [1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 ]
119113
120-
121114for f in full_exp_name [13 :len (full_exp_name )]:
122115 volume , tails , basedir = read_experiment_file (f )
123116 volume_calving += [np .around (volume ,2 )]
124117 exp_name_c += [basedir ]
125- #print('Experiment name', exp_number_c)
126- #print('Volume after calving', volume_calving)
127-
128118
129119volume_calving_sle = []
130120for value in volume_calving :
131121 volume_calving_sle .append (calculate_sea_level_equivalent (value ))
132- #print('Volume after calving SLE', volume_calving_sle)
133122
134123# Extract volumes from volume_below_sea_level.csv
135124# for the different configurations
@@ -144,7 +133,6 @@ def read_experiment_file_vbsl(filename):
144133 d + '/volume_below_sea_level.csv' ))
145134
146135full_dir_name = sorted (full_dir_name )
147- #print(full_dir_name)
148136
149137# Reading no calving volumes below sea level
150138vbsl = []
@@ -157,10 +145,6 @@ def read_experiment_file_vbsl(filename):
157145 vbsl_c += [np .around (volume_c ,2 )]
158146 exp_name_bsl += [tails ]
159147
160- # print('Experiment', exp_number)
161- # print('Volume bsl no calving', vbsl)
162- # print('Volume bsl calving', vbsl_c)
163-
164148# sea level equivalent
165149vbsl_sle = []
166150vbsl_c_sle = []
@@ -169,18 +153,18 @@ def read_experiment_file_vbsl(filename):
169153 vbsl_sle .append (calculate_sea_level_equivalent (i ))
170154 vbsl_c_sle .append (calculate_sea_level_equivalent (j ))
171155
172- #print('Volume bsl no calving in s.l.e', vbsl_sle)
173- #print('Volume bsl calving in s.l.e', vbsl_c_sle)
174156
175157percentage = []
176158for i , j in zip (volume_no_calving , volume_calving ):
177159 percentage .append (calculate_volume_percentage (i ,j ))
178160
161+ print ('FOR THE PAPER' )
162+ print ('----------------' )
179163print ('Percentage' , min (percentage ), max (percentage ))
180-
181164print ('Percent for columbia' , calculate_volume_percentage (270.40 , 349.39 ))
182165print ('Gt equivalent columbia' , 2.98161468959857 / 1.091 )
183166
167+ # Make a dataframe with each configuration output
184168d = {'Experiment No' : exp_number ,
185169 'Volume no calving in s.l.e' : volume_no_calving_sle ,
186170 'Volume no calving bsl in s.l.e' : vbsl_sle ,
@@ -195,40 +179,56 @@ def read_experiment_file_vbsl(filename):
195179 'Volume differences in km3' :
196180 [np .abs (a - b ) for a , b in zip (volume_no_calving ,volume_calving )]
197181 }
198-
199182ds = pd .DataFrame (data = d )
200183
201184ds = ds .sort_values (by = ['Experiment No' ])
202185ds .to_csv (os .path .join (plot_path ,
203186 'MT_glaciers_volume_per_exp.csv' ))
204- print ('----------- For de paper ------------------' )
205- print ('Mean and std volume with calving' ,
206- np .round (np .mean (volume_calving_sle ),2 ), np .round (np .std (volume_calving_sle ),2 ))
207- print ('Mean and std volume no calving' ,
208- np .round (np .mean (volume_no_calving_sle ),2 ), np .round (np .std (volume_no_calving_sle ),2 ))
187+
188+ print ('----------- For de paper more information ------------------' )
189+
190+ print ('Mean and std volume with calving for all config' ,
191+ np .round (np .mean (volume_calving_sle ),2 ),
192+ np .round (np .std (volume_calving_sle ),2 ))
193+
194+ print ('Mean and std volume no calving for all config' ,
195+ np .round (np .mean (volume_no_calving_sle ),2 ),
196+ np .round (np .std (volume_no_calving_sle ),2 ))
197+
209198print ('Mean and std volume below sea level with calving' ,
210- np .round (np .mean (vbsl_c_sle ),2 ), np .round (np .std (vbsl_c_sle ),2 ))
199+ np .round (np .mean (vbsl_c_sle ),2 ),
200+ np .round (np .std (vbsl_c_sle ),2 ))
211201
212202print ('Mean and std volume below sea level without calving' ,
213- np .round (np .mean (vbsl_sle ),2 ), np .round (np .std (vbsl_sle ),2 ))
203+ np .round (np .mean (vbsl_sle ),2 ),
204+ np .round (np .std (vbsl_sle ),2 ))
214205
215206print ('TABLE' ,ds )
216207
217- print ('is vbsl bigger than differnces' , vbsl_c > ds ['Volume differences in km3' ].values )
208+ print ('For the paper check if the volume below sea level is bigger than diff among config.' )
209+ print (vbsl_c > ds ['Volume differences in km3' ].values )
218210
219211diff_config = np .diff (volume_calving )
220-
221212total = abs (diff_config / volume_calving [0 :- 1 ])* 100
222213
223214print ('volume after calving differences between configs' , total )
224215
216+
217+ # Reading Farinotti 2019 regional volume for MT glaciers.
225218farinotti_data = pd .read_csv (os .path .join (MAIN_PATH ,
226219 'input_data/farinotti_volume.csv' ))
220+ #Sum the volumes in farinotti data
221+ vol_fari = farinotti_data ['vol_itmix_m3' ].sum ()* 1e-9
222+ vol_bsl_fari = farinotti_data ['vol_bsl_itmix_m3' ].sum ()* 1e-9
227223
228- #print(farinotti_data)
229224
225+ print ('FOR THE PAPER' )
226+ print ('our estimate after calving' , np .round (np .mean (volume_calving_sle ),2 ))
227+ print ('farinotti' , calculate_sea_level_equivalent (vol_fari ))
228+ print ('percentage of vol change' ,
229+ calculate_volume_percentage (np .mean (volume_calving ),vol_fari ))
230230
231- # Plot settings
231+ # Plot everything!
232232# Set figure width and height in cm
233233width_cm = 12
234234height_cm = 8
@@ -249,26 +249,13 @@ def read_experiment_file_vbsl(filename):
249249ind = np .arange (N )
250250graph_width = 0.35
251251labels = np .append (ds ['Experiment No' ].values , 14 )
252- print (labels )
253-
254- vol_fari = farinotti_data ['vol_itmix_m3' ].sum ()* 1e-9
255- vol_bsl_fari = farinotti_data ['vol_bsl_itmix_m3' ].sum ()* 1e-9
256-
257-
258252
259253bars1 = np .append (ds ['Volume no calving bsl km3' ].values , vol_bsl_fari )
260254bars2 = np .append (ds ['Volume no calving in km3' ].values , vol_fari )
261- #print(bars2)
262255
263256bars3 = ds ['Volume with calving bsl km3' ].values
264257bars4 = ds ['Volume with calving in km3' ].values
265258
266-
267-
268-
269-
270- print (bars1 )
271-
272259sns .set_color_codes ()
273260sns .set_color_codes ("colorblind" )
274261
@@ -277,53 +264,48 @@ def read_experiment_file_vbsl(filename):
277264
278265p1_extra = ax1 .barh (ind [8 :13 ], bars1 [8 :13 ]* - 1 ,
279266 color = "indianred" , edgecolor = "white" , height = graph_width ,
280- alpha = 0.7 )
267+ alpha = 0.5 )
281268
282269p2 = ax1 .barh (ind [0 :8 ], bars2 [0 :8 ], color = sns .xkcd_rgb ["ocean blue" ],
283270 height = graph_width , edgecolor = "white" )
284271
285272p2_extra = ax1 .barh (ind [8 :13 ], bars2 [8 :13 ], color = sns .xkcd_rgb ["ocean blue" ],
286273 height = graph_width , edgecolor = "white" ,
287- alpha = 0.7 )
274+ alpha = 0.5 )
288275
289276p3 = ax1 .barh (ind [0 :8 ] - graph_width , bars3 [0 :8 ]* - 1 ,
290277 color = "indianred" ,edgecolor = "white" , height = graph_width )
291278
292279p3_extra = ax1 .barh (ind [8 :13 ] - graph_width , bars3 [8 :13 ]* - 1 ,
293- color = "indianred" , edgecolor = "white" , alpha = 0.7 ,
280+ color = "indianred" , edgecolor = "white" , alpha = 0.5 ,
294281 height = graph_width )
295282
296283p4 = ax1 .barh (ind [0 :8 ] - graph_width , bars4 [0 :8 ], color = sns .xkcd_rgb ["teal green" ],
297284 edgecolor = "white" ,
298285 height = graph_width )
299286
300287p4_extra = ax1 .barh (ind [8 :13 ] - graph_width , bars4 [8 :13 ], color = sns .xkcd_rgb ["teal green" ],
301- edgecolor = "white" , alpha = 0.7 ,
288+ edgecolor = "white" , alpha = 0.5 ,
302289 height = graph_width )
303290
304291fari_low = ax1 .barh (ind [- 1 ]- graph_width , bars1 [13 :14 ]* - 1 , color = "indianred" ,
305- edgecolor = "white" , alpha = 0.7 ,
292+ edgecolor = "white" ,
306293 height = graph_width )
307294
308295fari = ax1 .barh (ind [- 1 ]- graph_width , bars2 [13 :14 ], color = sns .xkcd_rgb ["grey" ],
309296 edgecolor = "white" , height = graph_width )
310297
311-
312298ax1 .set_xticks ([- 1000 , 0 , 1000 , 2000 , 3000 , 4000 , 5000 ])
313299ax1 .set_xticklabels (abs (ax1 .get_xticks ()), fontsize = 20 )
314300
315- #ax1.plot(bars5, 13)
316-
317301ax2 .set_xlim (ax1 .get_xlim ())
318- #ax2.tick_params('Volume [mm SLE]', fontsize=20)
319302ax2 .set_xticks (ax1 .get_xticks ())
320303array = ax1 .get_xticks ()
321- #print(array)
322304
305+ # Get the other axis on sea level equivalent
323306sle = []
324307for value in array :
325308 sle .append (np .round (abs (calculate_sea_level_equivalent (value )),2 ))
326- #print(sle)
327309
328310ax2 .set_xticklabels (sle ,fontsize = 20 )
329311ax2 .set_xlabel ('Volume [mm SLE]' , fontsize = 18 )
0 commit comments