Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New ESACCI AEROSOL CMORizer (Python version) #3629

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/sphinx/source/input.rst
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ A list of the datasets for which a CMORizers is available is provided in the fol
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| ERA-Interim-Land | sm (Lmon) | 3 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| ESACCI-AEROSOL | abs550aer, od550aer, od550aerStderr, od550lt1aer, od870aer, od870aerStderr (aero) | 2 | NCL |
| ESACCI-AEROSOL | abs550aer, od550aer, od550aerStderr, od550lt1aer, od870aer, od870aerStderr (aero) | 2 | Python |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
| ESACCI-CLOUD | clivi, clt, cltStderr, clwvi, lwp, rlut, rlutcs, rsut, rsutcs, rsdt, rlus, rsus, rsuscs (Amon) | 2 | NCL |
+------------------------------+------------------------------------------------------------------------------------------------------+------+-----------------+
Expand Down
76 changes: 76 additions & 0 deletions esmvaltool/cmorizers/data/cmor_config/ESACCI-AEROSOL.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
# Common global attributes for Cmorizer output
attributes:
dataset_id: ESACCI-AEROSOL
version: 'SU-v4.3'
tier: 2
modeling_realm: sat
project_id: OBS
source: 'ftp://anon-ftp.ceda.ac.uk/neodc/esacci/aerosol/data/'
reference: ["esacci-aerosol"]
comment: "Note that the variable tsStderr is an uncertainty not a standard error."

# Variables to cmorize
variables:
# monthly means
od550aer_month:
mip: aero
short_name: od550aer
raw: AOD550_mean
file: '{year}??-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_MONTHLY-v4.3.nc'
od870aer_month:
mip: aero
short_name: od870aer
raw: AOD870_mean
file: '{year}??-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_MONTHLY-v4.3.nc'
od550lt1aer_month:
mip: aero
short_name: od550lt1aer
raw: FM_AOD550_mean
file: '{year}??-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_MONTHLY-v4.3.nc'
abs550aer_month:
mip: aero
short_name: abs550aer
raw: AAOD550_mean
file: '{year}??-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_MONTHLY-v4.3.nc'
od550aerStderr_month:
mip: aero
short_name: od550aerStderr
raw: AOD550_uncertainty
file: '{year}??-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_MONTHLY-v4.3.nc'
od870aerStderr_month:
mip: aero
short_name: od870aerStderr
raw: AOD870_uncertainty
file: '{year}??-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_MONTHLY-v4.3.nc'
# daily data
od550aer_day:
mip: aero
short_name: od550aer
raw: AOD550_mean
file: '{year}????-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_DAILY-v4.3.nc'
od870aer_day:
mip: aero
short_name: od870aer
raw: AOD870_mean
file: '{year}????-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_DAILY-v4.3.nc'
od550lt1aer_day:
mip: aero
short_name: od550lt1aer
raw: FM_AOD550_mean
file: '{year}????-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_DAILY-v4.3.nc'
abs550aer_day:
mip: aero
short_name: abs550aer
raw: AAOD550_mean
file: '{year}????-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_DAILY-v4.3.nc'
od550aerStderr_day:
mip: aero
short_name: od550aerStderr
raw: AOD550_uncertainty
file: '{year}????-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_DAILY-v4.3.nc'
od870aerStderr_day:
mip: aero
short_name: od870aerStderr
raw: AOD870_uncertainty
file: '{year}????-ESACCI-L3C_AEROSOL-AER_PRODUCTS-*-SU_DAILY-v4.3.nc'
9 changes: 6 additions & 3 deletions esmvaltool/cmorizers/data/datasets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -420,11 +420,14 @@ datasets:
ESACCI-AEROSOL:
tier: 2
source: ftp://anon-ftp.ceda.ac.uk/neodc/esacci/aerosol/data/
last_access: 2019-01-24
# last_access: 2019-01-24
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you leave this line in (just commented out) to show how the cmorizer would work with the older version of the data? This is not clear here.

last_access: 2024-05-22
info: |
Download the data from:
ATSR2_SU/L3/v4.21/MONTHLY/ (1997-2002)
AATSR_SU/L3/v4.21/MONTHLY/ (2003-2011)
# ATSR2_SU/L3/v4.21/MONTHLY/ (1997-2002)
# AATSR_SU/L3/v4.21/MONTHLY/ (2003-2011)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. I think you commented it out to so that it could be used again for the older version, but it would be nice if this would be described somewhere.

ATSR2_SU/L3/v4.3/MONTHLY/ (1997-2002)
AATSR_SU/L3/v4.3/MONTHLY/ (2003-2011)
Other years are not considered since they are not complete.
Put all files in input_dir_path (no subdirectories with years).

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
"""Script to download ESACCI-AEROSOL from CCI CEDA ftp."""

import logging
from datetime import datetime

from dateutil import relativedelta

from esmvaltool.cmorizers.data.downloaders.ftp import CCIDownloader

logger = logging.getLogger(__name__)


def download_dataset(config, dataset, dataset_info, start_date, end_date,
overwrite):
Expand All @@ -29,7 +32,7 @@ def download_dataset(config, dataset, dataset_info, start_date, end_date,
if start_date is None:
start_date = datetime(1997, 1, 1)
if end_date is None:
end_date = datetime(2011, 1, 1)
end_date = datetime(2011, 12, 31)
loop_date = start_date

downloader = CCIDownloader(
Expand All @@ -40,12 +43,44 @@ def download_dataset(config, dataset, dataset_info, start_date, end_date,
)
downloader.connect()

version = 'v4.3'
algorithm = 'SU'

# download monthly data

loop_date = start_date
while loop_date <= end_date:
year = loop_date.year
if year < 2003:
downloader.set_cwd('ATSR2_SU/L3/v4.21/MONTHLY')
if loop_date.year < 2003:
instrument = 'ATSR2'
else:
downloader.set_cwd('AATSR_SU/L3/v4.21/MONTHLY')

downloader.download_year(loop_date.year)
instrument = 'AATSR'
rel_base_dir = f'{instrument}_{algorithm}/L3/{version}/MONTHLY'
downloader.set_cwd(rel_base_dir)
if downloader.exists(f'{loop_date.year}'):
downloader.download_folder(f'{loop_date.year}',
f'{algorithm}-{version}-monthly')
else:
logger.info('%d: no data found', loop_date.year)
loop_date += relativedelta.relativedelta(years=1)

# download daily data

loop_date = start_date
while loop_date <= end_date:
if loop_date.year < 2003:
instrument = 'ATSR2'
else:
instrument = 'AATSR'
rel_base_dir = f'{instrument}_{algorithm}/L3/{version}/DAILY'
downloader.set_cwd(rel_base_dir)
if downloader.exists(f'{loop_date.year}'):
downloader.set_cwd(f'{rel_base_dir}/{loop_date.year}')
if downloader.exists(f"{loop_date.month:02}"):
downloader.download_folder(f'{loop_date.month:02}',
f'{algorithm}-{version}-daily')
else:
logger.info('%d/%d: no data found', loop_date.year,
loop_date.month)
else:
logger.info('%d: no data found', loop_date.year)
loop_date += relativedelta.relativedelta(months=1)
169 changes: 0 additions & 169 deletions esmvaltool/cmorizers/data/formatters/datasets/esacci_aerosol.ncl

This file was deleted.

Loading