Skip to content

The --end-date for daymet dataset is not functioning properly #42

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
kasra-keshavarz opened this issue Mar 4, 2024 · 5 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@kasra-keshavarz
Copy link
Collaborator

The --end-date does not subset up to the day, but rather, looks at the yearly file. This needs to be addressed.

@kasra-keshavarz kasra-keshavarz added the bug Something isn't working label Mar 4, 2024
@kasra-keshavarz kasra-keshavarz self-assigned this Mar 4, 2024
@wknoben
Copy link

wknoben commented Jun 1, 2024

Could this explain why I'm missing a lot of files that should contain anywhere between 1 and 3 days of the 2023 data?

@kasra-keshavarz
Copy link
Collaborator Author

That is probably a cause, I will have a look. What days are you missing and what did you call with the scripts?

@kasra-keshavarz
Copy link
Collaborator Author

Could this explain why I'm missing a lot of files that should contain anywhere between 1 and 3 days of the 2023 data?

Is the problem still persisting? Can you give me a bit more detail?

@kasra-keshavarz
Copy link
Collaborator Author

@wknoben a ping on this.

@wknoben
Copy link

wknoben commented Jun 2, 2025

Sorry, I don't have the details anymore, but based on my notes this had something to do with asking for dates that are outside the time period covered by the data set, and dates that are not exactly at the start/end of a year. Snippet from my workaround code (https://github.com/CH-Earth/camels_spat/blob/864f47b63981adb55eff40e5036b74484fe7c503/7_forcing_data/6d_daymet_to_basins.py#L122-L132):

# Limit the dates to the Daymet period
# According to Kasra, datatool should be able to handle periods that are outside what the data has
# BUT this does not apply to Daymet (datatool: 2024-06-01)
if start_date.year < 1980:
    start_date = datetime(1980,1,1)
if final_date.year > 2023:
    final_date = datetime(2023,12,31)


# Fix a further issue where datatool doesn't like dates that are not on the start/end of the year
start_date = start_date.replace(day=1, month=1)
final_date = final_date.replace(day=31, month=12)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants