-
Notifications
You must be signed in to change notification settings - Fork 150
CMORizer ESACCI-PERMAFROST #3545
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
Open
axel-lauer
wants to merge
31
commits into
main
Choose a base branch
from
cmorize_esacci_permafrost
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
0fab902
first draft ESACCI-PERMAFROST downloader
axel-lauer 9e0be9d
snapshot 2024-02-28
axel-lauer 680c617
working version of ESACCI-PERMAFROST downloader
axel-lauer 127c924
some pylint fixes
axel-lauer ada5ae3
snapshot 2024-02-29
axel-lauer 2230739
added cmor_config/ESACCI-PERMAFROST.yml
axel-lauer b7d412e
snapshot 2024-03-01
axel-lauer 81b99c6
first working version
axel-lauer 5487cb4
cleaned up code a bit
axel-lauer 7682235
Merge branch 'main' into cmorize_esacci_permafrost
axel-lauer 21708d6
snapshot 2024-06-21
axel-lauer f913206
merged with main
axel-lauer b0ebee8
snapshot 2025-05-07
axel-lauer ba1359e
updated recipe_check_obs.yml
axel-lauer ae463f4
Merge branch 'main' into cmorize_esacci_permafrost
axel-lauer b174566
updated input.rst
axel-lauer 133cd2e
small formatting updates
axel-lauer 52c7782
format updates
axel-lauer 8fa7972
updated with latest main
axel-lauer e74218d
removed unneeded time zone
axel-lauer 25668cf
changed path of regridding cache
axel-lauer a5811b5
add source of cdo grid definition file
axel-lauer 98142ae
replaced glob with Path
axel-lauer 1de23ac
removed automatic deletion of grid definition file
axel-lauer 6f4a180
changed from ESACCI-PERMAFROST v3.0 to v5.0
axel-lauer 0b7deee
update formatters/datasets/esacci_permafrost.py
axel-lauer 6f09965
merged with main
axel-lauer c84fd37
fix codacy issues 1
axel-lauer 69816c4
update cmor config file
axel-lauer 105253e
fix codacy issues 2
axel-lauer b2c0e99
added doc sting to formatter
axel-lauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
29 changes: 29 additions & 0 deletions
29
esmvaltool/cmorizers/data/cmor_config/ESACCI-PERMAFROST.yml
This file contains hidden or 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,29 @@ | ||
| --- | ||
| # Common global attributes for CMORizer output | ||
| attributes: | ||
| dataset_id: ESACCI-PERMAFROST | ||
| version: 'v5.0NH' | ||
| tier: 2 | ||
| type: sat | ||
| project_id: OBS6 | ||
| source: 'ftp://dap.ceda.ac.uk/neodc/esacci/permafrost' | ||
| reference: "esacci-permafrost" | ||
| comment: "" | ||
|
|
||
| # Variables to CMORize | ||
| variables: | ||
| alt: | ||
| mip: Lyr | ||
| raw: ALT | ||
| file: 'ESACCI-PERMAFROST-L4-ALT-*-AREA4_PP-{year}-fv05.0.nc' | ||
| weights_dir: './esacci-permafrost-weights' | ||
| gtd: | ||
| mip: Lyr | ||
| raw: [GST, T1m, T2m, T5m, T10m] | ||
| file: 'ESACCI-PERMAFROST-L4-GTD-*-AREA4_PP-{year}-fv05.0.nc' | ||
| weights_dir: './esacci-permafrost-weights' | ||
| pfr: | ||
| mip: Lyr | ||
| raw: PFR | ||
| file: 'ESACCI-PERMAFROST-L4-PFR-*-AREA4_PP-{year}-fv05.0.nc' | ||
| weights_dir: './esacci-permafrost-weights' |
This file contains hidden or 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
73 changes: 73 additions & 0 deletions
73
esmvaltool/cmorizers/data/downloaders/datasets/esacci_permafrost.py
This file contains hidden or 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,73 @@ | ||
| """Script to download ESACCI-PERMAFROST.""" | ||
|
|
||
| import datetime | ||
| import logging | ||
|
|
||
| from dateutil import relativedelta | ||
|
|
||
| from esmvaltool.cmorizers.data.downloaders.wget import WGetDownloader | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def download_dataset( | ||
| original_data_dir, | ||
| dataset, | ||
| dataset_info, | ||
| start_date, | ||
| end_date, | ||
| overwrite, | ||
| ) -> None: | ||
| """Download dataset. | ||
|
|
||
| Parameters | ||
| ---------- | ||
| original_data_dir : Path | ||
| Directory where original data will be stored. | ||
| 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 start_date is None: | ||
| start_date = datetime.datetime(1997, 1, 1, tzinfo=datetime.UTC) | ||
| if end_date is None: | ||
| end_date = datetime.datetime(2023, 12, 31, tzinfo=datetime.UTC) | ||
|
|
||
| downloader = WGetDownloader( | ||
| original_data_dir=original_data_dir, | ||
| dataset=dataset, | ||
| dataset_info=dataset_info, | ||
| overwrite=overwrite, | ||
| ) | ||
|
|
||
| version = "v05.0" | ||
|
|
||
| path = "https://dap.ceda.ac.uk/neodc/esacci/permafrost/data/" | ||
|
|
||
| ccivars = [ | ||
| "active_layer_thickness", | ||
| "ground_temperature", | ||
| "permafrost_extent", | ||
| ] | ||
|
|
||
| # download cci variables active layer thickness, ground temperature and | ||
| # permafrost extent | ||
| loop_date = start_date | ||
| while loop_date <= end_date: | ||
| for var in ccivars: | ||
| folder = ( | ||
| path | ||
| + f"{var}/L4/area4/pp/{version}/northern_hemisphere/{loop_date.year}/" | ||
| ) | ||
| downloader.download_folder( | ||
| folder, | ||
| wget_options=["-e robots=off", "--no-parent", "--accept=nc"], | ||
| ) | ||
| loop_date += relativedelta.relativedelta(years=1) |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.