/submonthly-spi-python

Sub-montly standard precipitation index calculation in Python

Primary LanguagePython

Sub-monthly Standardised Precipitation Index in Python

Here i tried to build a function to calculate spi index in sub-monthly basis (like weeks) using numpy and scipy. For my project, i needed to calculate spi value for less than 1-month time scale. So i implemented the spi procedure in python and hope it will help many people like me to understand the spi calculation. Anyone can change the code to work for their own project. A sample input file 'Barishal.csv' is provided. Please remember, i have not included null value consideration in my function, so null values will be considered as 0. Output file 'spi.csv' is also provided which is the spi value for Cumulative 01 weeks for the period of 9th July to 23rd July. Please change the time scale as per your requirements

My sole purpose was to show the procedure of spi calculation. The python scripts are very simple as i am not an expert coder.