Input Data and Specification
Input Data and Specification#
SPI and SPEI requires monthly precipitation and potential evapotranspiration data, and there are many source providing global high-resolution gridded monthly precipitation data:
and monthly potential evapotranspiration data:
For better result, SPI and SPEI required minimum 30-years of data.
We provide 4 different approach to prepare precipitation data ready to use as SPI input. For learning matters, you may follow all the approach. Or you can choose which one is suit for you depend on the data source and format:
If you are prefer to use your own dataset also fine, you can still follow this guideline and adjust some steps and code related to filename, unit, format and structure.
The climate-indices python package enables the user to calculate SPI using any gridded netCDF dataset. However, there are certain specifications for input files that vary based on input type.
Variable name on precipitation
--var_name_precip
, usually TerraClimate data useppt
as name while other precipitation data like CHIRPS usingprecip
and IMERG usingprecipitation
as a variable name. To make sure, check using commandncdump -h file.nc
then adjust it in the script if needed.Variable name on potential evapotranspiration
--var_name_pet
, usually TerraClimate data usepet
as name.Precipitation unit must be written as
millimeters
,milimeter
,mm
,inches
,inch
orin
.Potential evapotranspiration unit must be written as
millimeters
,milimeter
,mm
,inches
,inch
orin
.Data dimension and order must be written as
lat
,lon
,time
(Windows machine required this order) ortime
,lat
,lon
(Works tested on Mac/Linux and Linux running on WSL).