monocongo/climate_indices

Precipitation units causing error (ValueError: Unsupported precipitation units: kg m-2 s-1)

Closed this issue · 1 comments

I'm trying to compute 30, 60, and 90 days SPI with:
"
process_climate_indices --index spi --periodicity daily --netcdf_precip /home/ama/Documents/HistoricalData/GFDL_.nc --var_name_precip pr --output_file_base /home/ama/Documents/HistoricalData/GFDL_spi --scales 30 60 90 --calibration_start_year 1983 --calibration_end_year 2014 --multiprocessing all
"

It's giving me this error:
"
2023-08-11 07:28:51 INFO Start time: 2023-08-11 07:28:51.006978
2023-08-11 07:28:51 INFO Computing 30-day SPI/Pearson
2023-08-11 07:28:51 ERROR Failed to complete
Traceback (most recent call last):
File "/home/ama/.local/lib/python3.10/site-packages/climate_indices/main.py", line 1715, in main
_compute_write_index(kwrgs)
File "/home/ama/.local/lib/python3.10/site-packages/climate_indices/main.py", line 778, in _compute_write_index
raise ValueError(f"Unsupported precipitation units: {precip_unit}")
ValueError: Unsupported precipitation units: kg m-2 s-1
Traceback (most recent call last):
File "/home/ama/.local/bin/process_climate_indices", line 8, in
sys.exit(main())
File "/home/ama/.local/lib/python3.10/site-packages/climate_indices/main.py", line 1715, in main
_compute_write_index(kwrgs)
File "/home/ama/.local/lib/python3.10/site-packages/climate_indices/main.py", line 778, in _compute_write_index
raise ValueError(f"Unsupported precipitation units: {precip_unit}")
ValueError: Unsupported precipitation units: kg m-2 s-1

"
Expected behavior
I expected the climate-indices package to compute the SPI without any issues.

I just want to know the standard units climate_indices is using for precipitation.

I changed the unit to mm and it worked