Open BaptisteVandecrux opened 1 year ago
Code to download 3hrs CAMS AOD 550:
#!/usr/bin/env python
import calendar
from ecmwfapi import ECMWFDataServer
# You need to obtain your own API key and email (username) to run this script
server = ECMWFDataServer(url="https://api.ecmwf.int/v1",key="Your API key",email="Your email")
def retrieve_cams_reanalysis():
yearStart = 2004
yearEnd = 2004
monthStart = 1
monthEnd = 12
for year in list(range(yearStart, yearEnd + 1)):
for month in list(range(monthStart, monthEnd + 1)):
startDate = '%04d%02d%02d' % (year, month, 1)
numberOfDays = calendar.monthrange(year, month)[1]
lastDate = '%04d%02d%02d' % (year, month, numberOfDays)
target = "cams_aod_3h_%04d%02d.nc" % (year, month)
requestDates = (startDate + "/TO/" + lastDate)
cams_reanalysis_request(requestDates, target)
def cams_reanalysis_request(requestDates, target):
server.retrieve({
"class": "mc", # do not change
"dataset": "cams_reanalysis", # do not change
"expver": "eac4", # do not change
"stream": "oper", # do not change
"type": "an", # analysis (versus forecast, fc)
"date": requestDates, # dates, set automatically from above
"levtype": "sfc", # pressure level data (versus surface, sfc, and model level, ml)
"param": "207.210/213.210/214.210/215.210/216.210", # here: Dust Aerosol mixing ration and Relative humidity (r); see http://apps.ecmwf.int/codes/grib/param-db
"time": "00/03/06/09/12/15/18/21",
"grid": "0.625/0.5",
"area": "90/-180/-90/180",
"format": "netcdf",
"target": target,
})
if __name__ == '__main__':
retrieve_cams_reanalysis()
Supplementary in https://www.sciencedirect.com/science/article/abs/pii/S1352231019308556
Sorry, didn't see you are referring to a different product!
Article:
https://www.tandfonline.com/doi/full/10.1080/16000889.2019.1623639
MACv2 properties are at ftp://ftp-projects.mpimet.mpg.de/aerocom/climatology/MACv2_2018/.
The data are placed in several subdirectories and a README file describes data content of file-names