Skip to content
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

process_climate_indices crashes if daily input data does not end on Dec. 31 #575

Open
david-e-rupp opened this issue Feb 23, 2025 · 0 comments

Comments

@david-e-rupp
Copy link

Describe the bug
I'm trying to update SPI daily using the most recent data every day. However, if the ppt input data does not end on Dec. 31, process_climate_indices fails. I have tried using data files that end on other days (Dec. 31, Jan. 31, Feb. 22, etc.) but they all fail.

One solution could be to create a file that ends at the end of this year but is filled with made of up values for future days (i.e., zero), but I rather not if there is a better way.

Expected behavior
I expect SPI to be calculated for every day in the input even if the record does not end on Dec. 31.

Screenshots
Here is the call to process_climate_indices and just snippet of the error message:

process_climate_indices --index spi --periodicity daily --netcdf_precip ppt_1981-01-01_2025-01-31.nc --var_name_precip prcp --output_file_base test --scales 30 --calibration_start_year 1991 --calibration_end_year 2020 --multiprocessing all

prismcpx6 498% ./spi_daily_test.bash
2025-02-23 08:07:51 INFO Start time: 2025-02-23 08:07:51.604848
2025-02-23 08:07:51 INFO Computing 30-day SPI/Pearson
2025-02-23 08:07:51 ERROR Failed to complete
Traceback (most recent call last):
....
/climate_indices/utils.py", line 367, in transform_to_366day
all_leap[all_leap_index: (all_leap_index + 59)] = original[original_index: (original_index + 59)]
ValueError: could not broadcast input array from shape (31,) into shape (59,)

Desktop (please complete the following information):

  • OS: Linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant