10

Palmer drought severity index is one of the most popular moisture/drought indices around. There is a package in R called a SPEI that allows calculation of two other popular drought indices (Standardised precipitation index and Standardised precipitation and evapotranspiration Index ). I think there should be some package to calculate other moisture indices and particularly PDSI but i have been unable to find one myself.

user2760
  • 2,273
  • 7
  • 25
  • 34
  • 1
    you might try this on the `r-sig-ecology@r-project.org` mailing list (make sure to mention that you're cross-posting). `library(sos); findFn("drought"); findFn("drought Palmer")` gets 28 hits for the first query, none (oh well) for the second – Ben Bolker Jan 26 '12 at 19:45
  • 1
    PS: looking at http://journals.ametsoc.org/doi/abs/10.1175/1520-0450%281984%29023%3C1100%3ATPDSIL%3E2.0.CO%3B2 quickly, I understand why no-one has tried to implement it in R. Looks like a pain. I wonder how many independent implementations of the algorithm there are ... ? – Ben Bolker Jan 26 '12 at 20:52
  • I personally knew two implementations an old one in FORTRAN and a new one in C++ that is provided by national drought mitigation center on its website – user2760 Jan 26 '12 at 21:37
  • If either of them is freely available or (preferably) FOSS, it might not be too hard to make a minimal wrapper for the C++/FORTRAN code that could then be used in R. (A quick google didn't find the code: I got as far as http://drought.unl.edu/MonitoringTools/DownloadableSPIProgram.aspx but didn't see anything for Palmer) – Ben Bolker Jan 26 '12 at 21:56
  • If you download the compressed file from here it contains a .exe file as well as C++ source code. I believe it is in the public domain as it is a available freely for download and is maintained by a university and Govt funds http://greenleaf.unl.edu/downloads/ – user2760 Jan 26 '12 at 22:00
  • How badly do you want this, and how thoroughly integrated with R do you want it? (Feel free to take this off-SO, to e-mail.) – Ben Bolker Jan 26 '12 at 22:07
  • pages 18-20 of Liu Sun's thesis seems to provide some relevant formulae: http://cemml.carleton.ca/davidson/publications/2009/Msc%20Thesis_Liu%20Sun.pdf – jbaums Feb 05 '12 at 14:29
  • TY...i have a code in C++, i was curious whether anyone is working on it in R... – user2760 Feb 09 '12 at 17:05

4 Answers4

4

It looks like we can thank Christian Zang for finally solving the problem: https://github.com/cszang/pdsi

Edit from 2018: This answer was just accepted so I have decided to fork the above-linked repo to my github to guard against future link rot. It will stay there indefinitely.

HFBrowning
  • 2,196
  • 3
  • 23
  • 42
4

This is the link for .exe file / C++ code that achieves the same.

It contains a manual that describes the input/ output file formats.

I hope that someones skilled enough can write a wrapper for this

http://greenleaf.unl.edu/downloads/

user2760
  • 2,273
  • 7
  • 25
  • 34
2

A tool has been created for MatLab:

Jacobi, J., D. Perrone, L. L. Duncan, and G. Hornberger (2013), A tool for calculating the Palmer drought indices, Water Resour. Res., 49, doi:10.1002/wrcr.20342.

RioRaider
  • 121
  • 4
2

Now library scPDSI is available in R for calculation of Palmer Drought Severity Index.

Update

The package has been removed from the CRAN repository. But you can use the following code to install the latest archived version

install.packages("https://cran.r-project.org/src/contrib/Archive/scPDSI/scPDSI_0.1.3.tar.gz", 
                 repo=NULL, type="source")
UseR10085
  • 7,120
  • 3
  • 24
  • 54