Skip to content

CarlosMendez1997Col/Evaluate-hydrological-and-meteorological-droughts-using-C-and-R

Repository files navigation

Evaluation and analysis of drought using the SPI, SPEI and PDSI index

Description

Evaluation of the SPI, SPEI and PDSI , using C++ and R languages.

Each section is described below:

  1. The first section shows the SPI and SPEI index

  2. The second section explain the PDSI index

  3. The third section include animations and videos

  4. The fourth and final section share the data and files

Prerequisites and libraries

PDSI in C++

#include <stdlib.h>
#include <math.h>
#include <cstring>
#include <stdio.h>
#include <ctype.h>
#include <direct.h> 

SPI and SPEI in R

#install.packages("SPEI")
#install.packages("readr")
#install.packages("gganimate")
#install.packages("tidyverse")
library(SPEI)
library(tidyverse)
library(gganimate)
library(readr)
library(dplyr)

Data acquisition and download

PDSI

The data used to calculate the PDSI are from stations and time series collected during the following research: Link

SPEI and SPI

The data used to calculate SPI and SPEI (precipitation and potential evapotranspiration) were downloaded from the Nasa Earth repository, using the Giovanni program (Geospatial Interactive Online Visualization ANd aNalysis Infrastructure), available at: Giovanni Website

Credits and more information

The SPI and SPEI index, were used with the CRAN package SPEI Version: 1.8.1 in R language, available at: Oficial Website and GitHub Repository

The PDSI index, was modified following the original code, available at: GitHub Repository

Conflict of Interest.

The author declare that there is no conflict of interest in the publication of this data and have approved it for publication.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

About

Evaluation and analysis of drought using the SPI, SPEI and PDSI index

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published