Skip to content

Commit c537fb6

Browse files
committed
Remove warnings per aircraft
This commit moves logging warnings for non-validated responses to outside of the aircraft identifier loop, to reduce the number of warnings in the log.
1 parent a91c544 commit c537fb6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

openairclim/calc_response.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@
5151
#
5252
# Correction factor for RF O3, tagging
5353
CORR_RF_O3 = CORR_CONC_O3
54+
# Warning message if tagging response surface is used
55+
if CORR_RF_O3 == CORR_CONC_O3:
56+
logging.warning("O3 response surface is not validated!")
5457
#
5558
# Correction factor for RF O3, AirClim (perturbation)
5659
# CORR_RF_O3 = 1.0 / (31536000.0 * 0.45e-15)
@@ -122,9 +125,6 @@ def calc_resp_all(config, resp_dict, inv_dict):
122125
if spec == "H2O":
123126
corr = CORR_RF_H2O
124127
elif spec == "O3":
125-
# Warning message if tagging response surface is used
126-
if CORR_RF_O3 == CORR_CONC_O3:
127-
logging.warning("O3 response surface is not validated!")
128128
corr = CORR_RF_O3 * corr_nox
129129
elif resp_type == "tau":
130130
if spec == "CH4":
@@ -164,7 +164,6 @@ def calc_resp_sub(species_sub, output_dict, ac):
164164
if spec == "PMO":
165165
rf_pmo_dict = calc_pmo_rf(output_dict[ac])
166166
rf_sub_dict = rf_sub_dict | rf_pmo_dict
167-
logging.warning("PMO response not validated!")
168167
else:
169168
msg = "No method defined for sub species " + spec
170169
raise KeyError(msg)

openairclim/main.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,7 @@ def run(file_name):
339339

340340

341341
if species_sub:
342+
logging.warning("PMO response not validated!")
342343
for ac in ac_lst + ["TOTAL"]:
343344
rf_sub_dict = oac.calc_resp_sub(species_sub, output_dict, ac)
344345
oac.update_output_dict(output_dict, ac, "RF", rf_sub_dict)

0 commit comments

Comments
 (0)