Daily_SPI_and_SPEI

Here is the core source code for our daily SPI (Gamma distribution) and SPEI (generalized extreme value distribution). This code is an example of the algorithm on the cell point. "main.py" is the main code. "pre031_394.csv" is the multi-year daily precipitation data of the sample pixel and it is also the input data for calculating the SPI. "prepet031_394.csv" is the daily accumulated precipitation deficit data for the sample cells and is also the input data for calculating SPEI. "SPI031_394.csv" and "SPEI031_394.csv" are the SPI and SPEI data output by the sample code for user inspection and comparison. Users can apply this source code to other cells and sites as needed and batch calculate daily SPI/SPEI datasets for site or raster.