-
Notifications
You must be signed in to change notification settings - Fork 129
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
Cmorise cci lst v3 #3656
Open
morobking
wants to merge
26
commits into
main
Choose a base branch
from
cmorise_cci_lst_v3
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
Cmorise cci lst v3 #3656
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
a74c966
cmorizer python and yml config file added
4985426
All variables now included
bdc92b5
Simple diagnostic to test CMORized V3 data. Not best practice but priβ¦
45438fb
Correct DAY to NIGHT for tsNight variable in the filename
d634622
Flake8 and yamllint tidy of code
c85cce0
minor edits
6ba03d3
try/except added around load_cubes to prevent missing or bad files crβ¦
224d890
Add Total uncertainty and LST Variance
ed18b08
update to run 2003-2018 land cover for MODISA
e239ec5
Attempt to fix long int error in LC variable
09484bd
try normal array for LC instead of masked arry
409ec28
using np.float32 to try and solve issue
3babc17
trying to remove any values in LC outside 0-255
f4191a0
Another thing to try solve the int issue
c279353
try plus zero to keep as int
7501183
Revert to *1.0 and a tidy
8a6de39
Testing, probably wont need
df03155
Tidy ready for PR
b70455c
Update datasets.yml to reflect LST V3 and CEDA as source
6a6bfd5
Reference and check_obs updated
d58aefa
Update to address some Codacy issues
616ac09
Removed unused lst_testing.py
94726a4
Codacy fixes
1043ab2
f string error fixed
234a21b
added downloader for ESACCI-LST
axel-lauer 766a025
Merge branch 'main' into cmorise_cci_lst_v3
valeriupredoi 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 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
90 changes: 90 additions & 0 deletions
90
esmvaltool/cmorizers/data/downloaders/datasets/esacci_lst.py
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,90 @@ | ||
"""Script to download ESACCI-LST 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): | ||
"""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 start_date is None: | ||
start_date = datetime(2003, 1, 1) | ||
if end_date is None: | ||
end_date = datetime(2018, 12, 31) | ||
loop_date = start_date | ||
|
||
downloader = CCIDownloader( | ||
config=config, | ||
dataset=dataset, | ||
dataset_info=dataset_info, | ||
overwrite=overwrite, | ||
dataset_name='land_surface_temperature', | ||
) | ||
downloader.connect() | ||
|
||
# download daily data | ||
|
||
# loop_date = start_date | ||
# rel_base_dir = 'AQUA_MODIS/L3C/0.01/v3.00/daily' | ||
# while loop_date <= end_date: | ||
# 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.set_cwd(f'{rel_base_dir}/{loop_date.year}/' | ||
# f'{loop_date.month:02}') | ||
# if downloader.exists(f'{loop_date.day:02}'): | ||
# downloader.download_folder(f'{loop_date.day:02}', | ||
# sub_folder=f'{loop_date.year}_daily') | ||
# else: | ||
# logger.info('%d/%d/%d: no data found', loop_date.year, | ||
# loop_date.month, loop_date.day) | ||
# loop_date += relativedelta.relativedelta(days=1) | ||
# else: | ||
# logger.info('%d/%d: no data found', loop_date.year, | ||
# loop_date.month) | ||
# loop_date += relativedelta.relativedelta(months=1) | ||
# else: | ||
# logger.info('%d: no data found', loop_date.year) | ||
# loop_date += relativedelta.relativedelta(years=1) | ||
|
||
# download monthly data | ||
|
||
loop_date = start_date | ||
rel_base_dir = 'AQUA_MODIS/L3C/0.01/v3.00/monthly' | ||
while loop_date <= end_date: | ||
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}') | ||
else: | ||
logger.info('%d/%d: no data found', loop_date.year, | ||
loop_date.month) | ||
loop_date += relativedelta.relativedelta(months=1) | ||
else: | ||
logger.info('%d: no data found', loop_date.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.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it'd be useful to either remove commented out code, if you know for sure it's not needed no more, or place in a callable function/object so that it can be used at a later stage