@@ -343,8 +343,7 @@ def __init__(self, config):
343
343
'timeseries' ,
344
344
'annual_cycle' ,
345
345
'zonalmean' ,
346
- '1d_profile'
347
- ]
346
+ '1d_profile' ]
348
347
for (plot_type , plot_options ) in self .plots .items ():
349
348
if plot_type not in self .supported_plot_types :
350
349
raise ValueError (
@@ -353,7 +352,7 @@ def __init__(self, config):
353
352
if plot_options is None :
354
353
self .plots [plot_type ] = {}
355
354
356
- # Default options for the different plot types
355
+ # Default options for the differ N MMNMJHJ JMHTHent plot types
357
356
if plot_type == 'timeseries' :
358
357
self .plots [plot_type ].setdefault ('annual_mean' , False )
359
358
self .plots [plot_type ].setdefault ('annual_mean_kwargs' , {})
@@ -371,7 +370,9 @@ def __init__(self, config):
371
370
372
371
if plot_type == 'zonalmean' :
373
372
self .plots [plot_type ].setdefault (
374
- 'cbar_label' , '{short_name} [{units}]' )
373
+ 'cbar_label' ,
374
+ f"{ chr (964 )} ({ self ._get_name ('reactant' ).upper ()} )"
375
+ ' [{units}]' )
375
376
self .plots [plot_type ].setdefault (
376
377
'cbar_label_bias' , 'Δ{short_name} [{units}]' )
377
378
self .plots [plot_type ].setdefault (
@@ -569,20 +570,23 @@ def _calculate_coefficients(self):
569
570
z_coord = reaction .coord ('air_pressure' , dim_coords = True )
570
571
z_coord .attributes ['positive' ] = 'down'
571
572
z_coord .convert_units ('Pa' )
573
+ use_z_coord = 'air_pressure'
572
574
elif reaction .coords ('atmosphere_hybrid_sigma_pressure_coordinate' ,
573
575
dim_coords = True ):
574
576
self .z_coord = 'atmosphere_hybrid_sigma_pressure_coordinate'
575
577
z_coord = reaction .coord (
576
578
'atmosphere_hybrid_sigma_pressure_coordinate' ,
577
579
dim_coords = True )
578
580
z_coord .attributes ['positive' ] = 'down'
581
+ use_z_coord = 'model_level_number'
579
582
else :
580
583
raise NotImplementedError (
581
584
"Lifetime calculation is not implemented"
582
585
" for the present type of vertical coordinate."
583
586
)
584
587
585
- if not set (['TROP' , 'STRA' ]).isdisjoint (self .cfg ['regions' ]):
588
+ if (not set (['TROP' , 'STRA' ]).isdisjoint (self .cfg ['regions' ]) and
589
+ not set (['timeseries' , 'annual_cycle' ]).isdisjoint (self .plots )):
586
590
587
591
# calculate climatological tropopause pressure (tp_clim)
588
592
# but only if no tropopause is given by data
@@ -600,16 +604,19 @@ def _calculate_coefficients(self):
600
604
# - tp_i and model_level_number
601
605
# - ptp and (derived) air_pressure
602
606
# - tp_clim and (derived) air_pressure
603
- use_z_coord = 'air_pressure'
604
607
if z_coord .name () == 'air_pressure' :
605
608
tropopause = variables .get ('ptp' , tropopause )
606
609
elif (z_coord .name ()
607
610
== 'atmosphere_hybrid_sigma_pressure_coordinate' ):
608
611
if 'tp_i' in variables :
609
612
tropopause = variables ['tp_i' ]
610
- use_z_coord = 'model_level_number'
611
613
else :
612
614
tropopause = variables .get ('ptp' , tropopause )
615
+ # fall back to air_pressure
616
+ use_z_coord = 'air_pressure'
617
+
618
+ input_data_dataset [dataset ]['tropopause' ] = tropopause
619
+
613
620
614
621
weight = self ._define_weight (variables )
615
622
@@ -620,7 +627,6 @@ def _calculate_coefficients(self):
620
627
621
628
input_data_dataset [dataset ]['z_coord' ] = z_coord
622
629
input_data_dataset [dataset ]['use_z_coord' ] = use_z_coord
623
- input_data_dataset [dataset ]['tropopause' ] = tropopause
624
630
input_data_dataset [dataset ]['variables' ] = variables
625
631
input_data_dataset [dataset ]['reaction' ] = reaction
626
632
input_data_dataset [dataset ]['weight' ] = weight
@@ -1030,8 +1036,8 @@ def create_timeseries_plot(self, region, input_data, base_datasets):
1030
1036
slice_dataset ['tropopause' ] = tp_slice
1031
1037
1032
1038
cube_slice = calculate_lifetime (slice_dataset ,
1033
- plot_type ,
1034
- region )
1039
+ plot_type ,
1040
+ region )
1035
1041
# make it real to reduce memory demand later
1036
1042
cube_slice .data
1037
1043
cube_slices .append (cube_slice )
@@ -1164,7 +1170,7 @@ def create_annual_cycle_plot(self, region, input_data, base_datasets):
1164
1170
list (base_datasets .values ()))
1165
1171
axes .set_title (f'{ self .info ["long_name" ]} in region { region } ' )
1166
1172
axes .set_xlabel ('Month' )
1167
- axes .set_ylabel (f"$ \t au$ ({ self ._get_name ('reactant' ).upper ()} )"
1173
+ axes .set_ylabel (f"{ chr ( 964 ) } ({ self ._get_name ('reactant' ).upper ()} )"
1168
1174
" [{self.info['units']}]" )
1169
1175
axes .set_xticks (range (1 , 13 ), [str (m ) for m in range (1 , 13 )])
1170
1176
gridline_kwargs = self ._get_gridline_kwargs (plot_type )
@@ -1329,8 +1335,8 @@ def create_1d_profile_plot(self, region, input_data, base_datasets):
1329
1335
# Default plot appearance
1330
1336
multi_dataset_facets = self ._get_multi_dataset_facets (
1331
1337
list (base_datasets .values ()))
1332
- axes .set_title (f'{ self .info ["long_name" ]} in region { region } ' )
1333
- axes .set_xlabel (f"$ \t au$ ({ self ._get_name ('reactant' ).upper ()} )"
1338
+ axes .set_title (f'{ self .info ["long_name" ]} ' )
1339
+ axes .set_xlabel (f"{ chr ( 964 ) } ({ self ._get_name ('reactant' ).upper ()} )"
1334
1340
f" [{ self .info ['units' ]} ]" )
1335
1341
z_coord = cube .coord (axis = 'Z' )
1336
1342
axes .set_ylabel (f'{ z_coord .long_name } [{ z_coord .units } ]' )
0 commit comments