MalariaIndicator.Rmd 5.72 KB
Newer Older
Martín Lotto Batista's avatar
Martín Lotto Batista committed
---
title: "Malaria Suitability Indicator"
author: "Earth Sciences department, Barcelona Supercomputing Center (BSC)"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteEngine{knitr::knitr}
  %\VignetteIndexEntry{Agricultural Indicators}
  %\usepackage[utf8]{inputenc}
---

<style>
body {
text-align: justify
}
</style>

```{r echo=FALSE}
knitr::opts_chunk$set(warnings=FALSE, message=FALSE)
```

Climate Suitability for Malaria Transmission
-----------------------------


## Introduction

Climate sensitive infectious diseases are a subject of major concern for public 
health agencies around the world in the context of global change. Malaria is an 
infectious disease caused by parasites of the genus _Plasmodium_ and transmitted 
by mosquitoes of the genus _Anopheles_. Although Europe has been free of endemic 
malaria circulation since the early 1970s as a result of improving socio-economic 
conditions, improving climatic conditions pose a risk of malaria re emergence in 
the continent. 

In the context of the Lancet Countdown in Europe collaboration, the Climate Suitability 
for Malaria indicator was created for tracking the climatic conditions for transmission 
of this disease in the continent between 1950 and 2021. This indicator is based 
on the climatic requirements from Plasmodium vivax, former parasite endemic to Europe.

In this vignette, we propose to show the computation of the Climate Suitability 
for Malaria indicator using the **TotalTimeExceedingThreshold -** function from 
the CSIndicators package. This function is able to operate with multidimensional 
arrays and s2dv_cube objects. In this example, we will make use of the 
**CST_TotalTimeExceedingThreshold** function, which was developed for the latter 
(For further information about the different types of objects visit the section 
about [Data retrieval and storage](https://cran.r-project.org/package=CSTools/vignettes/Data_Considerations.html) 
from CSTools package ).

## Load libraries

In addition to the functiosn from the **CSIndicators** package, we will make use 
of functions from the **CSTools** package.

```{r}
library(CSIndicators)
library(CSTools)
```

Temporary links to functions
```{r}
source("https://earth.bsc.es/gitlab/nperez/Flor/-/raw/master/CST_Load_devel_from_s2dv.R")
```


## 1. Data extraction
### 1.1 Area of interest
In this vignette, the malaria indicator between 2010 and 2020 will be computed 
for the Iberian Peninsula.

* Which countries?
* What coordinates?

[Wikipedia image](https://es.wikipedia.org/wiki/Pen%C3%ADnsula_ib%C3%A9rica#/media/Archivo:Espa%C3%B1a_y_Portugal.jpg)

### 1.2 Data extraction
To compute the malaria indicator, we will use reanalysis data from the ERA5-Land
repository. These data are produced by the Copernicus service and extracted and 
curated by the Earth Sciences department from the Barcelona Supercomputing Center.
The function `CST_Load` from the `CSTools` package allows the user to access the
processed data and to work with it using function from the `CSIndicators` package.

In order to extract data using `CST_Load`, there are some requirements to be met.
First, the path to the files is introduced using *whitecards* delimited by dollar
signs, which are useful for iterating over variables. Second, the temporal extent 
and resolution of the output is inputted with `sdates`, which takes a vector of all
necessary dates. The spatial extent is insputed within `lonmax`, `lonmin`, `latmax` 
and `latmin.`

```{r}
# Path to file locations using whitecards
path_ERA5_CDS <- list(path='/esarchive/recon/ecmwf/era5land/$STORE_FREQ$_mean/$VAR_NAME$_f1h/$VAR_NAME$_$YEAR$$MONTH$.nc')

# Temporal extent and resolution:
# We will work with all months from 2010 to 2020
year_in <- 2020 # initial year
year_fi <- 2021 # last year
month_in <- 1 # first month
month_fi <- 12 # last month

sdates <- paste0(year_in:year_fi, '0101')

# Extract data
vars <- c('tas', 'tdps', 'prlr')

out <- NULL
for(var in vars){
  out[[var]] <- CST_Load_s2dv(var = var,
                           exp = NULL, # We only require observved data
                           obs = list(path_ERA5_CDS),
                           sdates = sdates,
                           lonmax = 355, lonmin = 350,
                           latmax = 45, latmin = 43,
                           storefreq = 'monthly',
                           leadtimemin = month_in, 
                           leadtimemax = month_fi,
                           output = "lonlat")  
}
```

This function creates `s2dv_cube` objects, defined as XXXX. For further information
about these objects visit [Data retrieval and storage](https://cran.r-project.org/package=CSTools/vignettes/Data_Considerations.html). 

As an example, we will show the dimensions of near surface temperature

```{r}
dim(out$tas$data)
```
Near surface temperature is made up of 10 years with 12 months per year distributed
over a grid of XXxXX.


## 2. Data transformation
### 2.1 Near surface temperature and near surface dew point temperature
The first step before working with temperature is transforming their unit from
Kelvin (K) to Degrees Celsius (C).

```{r}
summary(out$tas$data)
```


```{r}
for(var in c('tas', 'tdps')){
  out[[var]]$data <- out[[var]]$data - 273.15
}

summary(out$tas$data)
```

### 2.2 Precipitation
```{r}
summary(out$prlr$data)
```


```{r}
out$prlr$data <- out$prlr$data*3600*24*30.41*1000

summary(out$prlr$data)
```

### 2.3 Relative humidity
```{r}
out$rh <- out$tas

out$rh$data <- 100*(exp((17.625*out$tdps$data)/(243.04+out$tdps$data)) / 
                      exp((17.625*out$tas$data) / (243.04+out$tas$data)))

summary(out$rh$data)
```

### 2.4 Land use
Add chunk

## 3. Compute indicator



## 4. Visualization
Add chunk

## 5. Summary statistics
Add chunk

## 6. Conclusions
Add chunk

## References
Add text