Skip to content

Commit b0f9558

Browse files
authored
Aeronet format updates and diagnostic changes (#4131)
1 parent 64e2e35 commit b0f9558

7 files changed

Lines changed: 33 additions & 25 deletions

File tree

doc/sphinx/source/recipes/recipe_aod_aeronet_assess.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ User settings in recipe
5757

5858
*Required settings for script*
5959

60-
* wavel: The wavelength of interest for the evaluation, currently set up for 440nm
61-
* min_days_per_mon: The minimum number of days used to calculate the AOD monthly mean
60+
* wavel: The wavelength of interest for the evaluation. Defaults to 440nm.
61+
* min_days_per_mon: The minimum number of days used to calculate the AOD monthly mean. Defaults to 1.
6262
* min_mon_per_seas: The minimum number of seasons used to calculate each
63-
seasonal mean. This must be between 1 and 3.
63+
seasonal mean. This must be between 1 and 3. Defaults to 3.
6464
* min_seas_per_year: The minimum number of seasonal means in each year. This
65-
must be between 1 and 4.
65+
must be between 1 and 4. Defaults to 4.
6666
* min_seas_per_clim: The minimum number of seasonal means used to calculate
6767
the multiannual seasonal mean. This must be btween 1 and the number of years
68-
of available AeroNET data.
68+
of available AeroNET data. Defaults to 5.
6969

7070
*Optional settings for script*
7171

@@ -96,6 +96,9 @@ Variables
9696
---------
9797

9898
* od440aer (atmos, monthly mean, longitude latitude time)
99+
* od550aer (atmos, monthly mean, longitude latitude time)
100+
* od870aer (atmos, monthly mean, longitude latitude time)
101+
99102

100103

101104
Observations and reformat scripts

esmvaltool/cmorizers/data/cmor_config/AERONET.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ filename: 'AOD_Level20_Monthly_V3.tar.gz'
55
# Common global attributes for Cmorizer output
66
attributes:
77
dataset_id: AERONET
8-
version: 20240406
8+
version: 20250726
99
tier: 3
1010
modeling_realm: atmos
1111
project_id: OBS6

esmvaltool/cmorizers/data/datasets.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ datasets:
44
AERONET:
55
tier: 3
66
source: "https://aeronet.gsfc.nasa.gov/"
7-
last_access: 2024-04-06
7+
last_access: 2025-07-26
88
info: |
99
Aerosol Optical Depth information from a worldwide network of stations.
1010

esmvaltool/cmorizers/data/formatters/datasets/aeronet.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
https://aeronet.gsfc.nasa.gov/
88
99
Last access
10-
20240406
10+
20250726
1111
1212
Download and processing instructions
1313
Download the following file:
@@ -89,7 +89,7 @@ def parse_contact(contact):
8989
if match is None:
9090
raise RuntimeError(f"Could not parse contact line {contact}")
9191
names = match.group("names").replace("_", " ").split(" and ")
92-
emails = match.group("emails").split("_and_")
92+
emails = re.split(r"_and_| and ", match.group("emails"))
9393
mailboxes = ", ".join(
9494
[
9595
f'"{name}" <{email}>'
@@ -273,7 +273,7 @@ def assemble_cube(stations, idx, wavelengths=None):
273273
points=wavelength_points,
274274
standard_name="radiation_wavelength",
275275
long_name="Wavelength",
276-
var_name="wl",
276+
var_name="wavelength",
277277
units="nm",
278278
)
279279
times = date_index.to_pydatetime()

esmvaltool/diag_scripts/aerosols/aod_aeronet_assess.py

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ def aod_analyse(model_data, aeronet_obs_cube, clim_seas, wavel):
309309
return figures, fig_scatter
310310

311311

312-
def preprocess_aod_obs_dataset(obs_dataset):
312+
def preprocess_aod_obs_dataset(obs_dataset, thresholds):
313313
"""Calculate a multiannual seasonal mean AOD climatology.
314314
315315
Observational AOD timeseries data from AeroNET are used to generate a
@@ -324,6 +324,11 @@ def preprocess_aod_obs_dataset(obs_dataset):
324324
----------
325325
obs_dataset : ESMValTool dictionary. Holds meta data for the observational
326326
AOD dataset.
327+
thresholds : Minimum days,months, seasons and years threshold dictionary; with keys
328+
- min_days_per_mon
329+
- min_mon_per_seas
330+
- min_seas_per_year
331+
- min_seas_per_clim
327332
328333
Returns
329334
-------
@@ -332,12 +337,6 @@ def preprocess_aod_obs_dataset(obs_dataset):
332337
"""
333338
obs_cube = iris.load_cube(obs_dataset[0]["filename"])
334339

335-
# Set up thresholds for generating the multi annual seasonal mean
336-
min_days_per_mon = 1
337-
min_mon_per_seas = 3
338-
min_seas_per_year = 4
339-
min_seas_per_clim = 5
340-
341340
# Add the clim_season and season_year coordinates.
342341
iris.coord_categorisation.add_year(obs_cube, "time", name="year")
343342

@@ -352,7 +351,7 @@ def preprocess_aod_obs_dataset(obs_dataset):
352351
num_days_var = obs_cube.ancillary_variable("Number of days")
353352
masked_months_obs_cube = obs_cube.copy(
354353
data=ma.masked_where(
355-
num_days_var.data < min_days_per_mon, obs_cube.data
354+
num_days_var.data < thresholds["min_days_per_mon"], obs_cube.data
356355
)
357356
)
358357

@@ -370,7 +369,7 @@ def preprocess_aod_obs_dataset(obs_dataset):
370369
function=lambda values: ~ma.getmask(values),
371370
)
372371
annual_seasonal_mean.data = ma.masked_where(
373-
annual_seasonal_count.data < min_mon_per_seas,
372+
annual_seasonal_count.data < thresholds["min_mon_per_seas"],
374373
annual_seasonal_mean.data,
375374
)
376375

@@ -389,7 +388,7 @@ def preprocess_aod_obs_dataset(obs_dataset):
389388
function=lambda values: ~ma.getmask(values),
390389
)
391390
multi_annual_seasonal_mean.data = ma.masked_where(
392-
clim_season_agg_count.data < min_seas_per_clim,
391+
clim_season_agg_count.data < thresholds["min_seas_per_clim"],
393392
multi_annual_seasonal_mean.data,
394393
)
395394
year_agg_count = multi_annual_seasonal_mean.aggregated_by(
@@ -403,7 +402,7 @@ def preprocess_aod_obs_dataset(obs_dataset):
403402
)
404403
for iseas in counter:
405404
multi_annual_seasonal_mean.data[iseas, :] = ma.masked_where(
406-
year_agg_count.data[0, :] < min_seas_per_year,
405+
year_agg_count.data[0, :] < thresholds["min_seas_per_year"],
407406
multi_annual_seasonal_mean.data[iseas, :],
408407
)
409408

@@ -425,11 +424,17 @@ def main(config):
425424
datasets = group_metadata(input_data.values(), "dataset")
426425

427426
# Default wavelength
428-
wavel = "440"
427+
wavel = config.get("wavel", "440")
428+
thresholds = {
429+
"min_days_per_mon": int(config.get("min_days_per_mon", 1)),
430+
"min_mon_per_seas": int(config.get("min_mon_per_seas", 3)),
431+
"min_seas_per_year": int(config.get("min_seas_per_year", 4)),
432+
"min_seas_per_clim": int(config.get("min_seas_per_clim", 5)),
433+
}
429434

430435
# Produce climatology for observational dataset
431436
obs_dataset = datasets.pop(config["observational_dataset"])
432-
obs_cube = preprocess_aod_obs_dataset(obs_dataset)
437+
obs_cube = preprocess_aod_obs_dataset(obs_dataset, thresholds)
433438

434439
for model_dataset, group in datasets.items():
435440
# 'model_dataset' is the name of the model dataset.

esmvaltool/recipes/examples/recipe_check_obs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ diagnostics:
10841084
variables:
10851085
od440aer:
10861086
additional_datasets:
1087-
- {dataset: AERONET, project: OBS6, mip: AERmon, tier: 3, type: atmos, version: 20240406}
1087+
- {dataset: AERONET, project: OBS6, mip: AERmon, tier: 3, type: atmos, version: 20250726}
10881088
scripts: null
10891089

10901090
ANUClimate:

esmvaltool/recipes/recipe_aod_aeronet_assess.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ diagnostics:
4444
start_year: 1994
4545
end_year: 2014
4646
additional_datasets:
47-
- {dataset: AERONET, project: OBS6, mip: AERmon, tier: 3, type: atmos, version: 20240406}
47+
- {dataset: AERONET, project: OBS6, mip: AERmon, tier: 3, type: atmos, version: 20250726}
4848

4949
od440aer_season:
5050
<<: *var_od440aer

0 commit comments

Comments
 (0)