-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMORizer for NASA MERRA reanalysis (#3039)
Co-authored-by: Rémi Kazeroni <[email protected]>
- Loading branch information
1 parent
9c0d9d4
commit b244fef
Showing
8 changed files
with
432 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"""Script to download MERRA.""" | ||
|
||
from datetime import datetime | ||
|
||
from dateutil import relativedelta | ||
|
||
from esmvaltool.cmorizers.data.downloaders.wget import NASADownloader | ||
|
||
|
||
def download_dataset(config, dataset, dataset_info, start_date, end_date, | ||
overwrite): | ||
"""Download dataset. | ||
Parameters | ||
---------- | ||
config : dict | ||
ESMValTool's user configuration | ||
dataset : str | ||
Name of the dataset | ||
dataset_info : dict | ||
Dataset information from the datasets.yml file | ||
start_date : datetime | ||
Start of the interval to download | ||
end_date : datetime | ||
End of the interval to download | ||
overwrite : bool | ||
Overwrite already downloaded files | ||
""" | ||
if not start_date: | ||
start_date = datetime(1979, 1, 1) | ||
if not end_date: | ||
end_date = datetime(2015, 12, 31) | ||
loop_date = start_date | ||
|
||
downloader = NASADownloader( | ||
config=config, | ||
dataset=dataset, | ||
dataset_info=dataset_info, | ||
overwrite=overwrite, | ||
) | ||
|
||
while loop_date <= end_date: | ||
year = loop_date.year | ||
downloader.download_folder( | ||
"https://goldsmr3.gesdisc.eosdis.nasa.gov/data/MERRA_MONTHLY/" | ||
f"MAIMNXINT.5.2.0/{year}/") | ||
downloader.download_folder( | ||
"https://goldsmr3.gesdisc.eosdis.nasa.gov/data/MERRA_MONTHLY/" | ||
f"MAIMCPASM.5.2.0/{year}/") | ||
downloader.download_folder( | ||
"https://goldsmr3.gesdisc.eosdis.nasa.gov/data/MERRA_MONTHLY/" | ||
f"MATMNXRAD.5.2.0/{year}/") | ||
downloader.download_folder( | ||
"https://goldsmr3.gesdisc.eosdis.nasa.gov/data/MERRA_MONTHLY/" | ||
f"MATMFXCHM.5.2.0/{year}/") | ||
|
||
loop_date += relativedelta.relativedelta(years=1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.