TerraClimate Example

Khaled Al-Shamaa

2023-03-28

QBMS

Linking data management systems to analytics is an important step in breeding digitalization. Breeders can use this R package to Query the Breeding Management System(s) like BMS, BreedBase, and GIGWA (using BrAPI calls) and help them to retrieve phenotypic and genotypic data directly into their analyzing pipelines developed in R statistical environment.

TerraClimate

TerraClimate is a dataset of monthly climate and climatic water balance for global terrestrial surfaces from 1958-2019. These data provide important inputs for ecological and hydrological studies at global scales that require high spatial resolution and time-varying data. All data have monthly temporal resolution and a ~4-km (1/24th degree) spatial resolution. The data cover the period from 1958-2020. We plan to update these data periodically (annually).

###Reference: Abatzoglou, J., Dobrowski, S., Parks, S. et al. TerraClimate, a high-resolution global dataset of monthly climate and climatic water balance from 1958–2015. Sci Data 5, 170191 (2018). https://doi.org/10.1038/sdata.2017.191

Install

install.packages("remotes")
remotes::install_github("icarda-git/QBMS")

Example

# load the QBMS library
library(QBMS)

# ICARDA Tal-Hadya station, Syria
data <- get_terraclimate(36.016, 36.943, '1979-09-01', '2012-06-30')

View(data$climate[[1]])

View(data$biovars[[1]])

# 1. ICARDA Merchouch station, Morocco
# 2. ICARDA Terbol station, Lebanon
# 3. ICARDA Amlaha station, India

x <- c(-6.716, 35.917, 76.884)
y <- c(33.616, 33.833, 23.111)

# ICARDA stations (WorldClim temporal range)
worldclim_range <- get_terraclimate(y, x, '1970-01-01', '2000-12-31', c('ppt', 'tmin', 'tmax'))

# ?calc_biovars
worldclim_norm  <- apply(worldclim_range$biovars[[2]][,1:19], 2, function(x) round(mean(x), 1))

# biovars       bio1   bio2   bio3   bio4   bio5   bio6   bio7   bio8   bio9  bio10  bio11
# terraclimate  16.2   13.5   41.4   713.5  33.8   1.0    32.8   8.0    24.3  24.5   7.4
# worldclim/10  15.5   13.6   43.0   631.0  33.0   1.6    31.4   7.3    23.2  23.2   7.3
#
# NOTE: all worldcim biovars derivative from temperature (i.e., bio1-bio11) have a scale factor of 10 
#       except bio3 because it is a ratio.
#
# biovars(cont) bio12  bio13  bio14  bio15  bio16  bio17  bio18  bio19
# terraclimate  661.0  182.1  0.0    113.5  419.2  0.3    0.9    398.5
# worldclim     592.0  140.0  0.0    99.0   368.0  1.0    2.0    368.0