Key Indicators of Stress - Rwema25/AE-project GitHub Wiki

I. Direct Environmental Indicators:

These are measurements of the climatic factors themselves and their deviations from the norm. This section helps to gain a better understanding of the climatic stresses affecting crop production in a given area and makes informed decisions to mitigate potential negative impacts. It provides definitions, calculation methods, formulas, and relevant R and Python packages:

1. Temperature Extremes

Definition of Terms

Term Definition
Daily Maximum Temperature (Tmax) The highest temperature recorded within a 24-hour period (typically from midnight to midnight local time).
Daily Minimum Temperature (Tmin) The lowest temperature recorded within a 24-hour period.
Heatwave A prolonged period of abnormally hot weather, often defined based on local climatological conditions (e.g., a certain number of consecutive days exceeding a specific temperature threshold). The threshold and duration can vary.
Hot Day A day when the daily maximum temperature exceeds a specific threshold (e.g., 30°C, 35°C, or a percentile of historical data).
Hot Night A night when the daily minimum temperature exceeds a specific threshold (e.g., 20°C, 25°C, or a percentile of historical data).
Frost Day A day when the daily minimum temperature falls below 0°C.

Hazards

Hazard Type Index/Indicator Full Name / Description Example / Application Category
Drought Stress NDD Number of Dry Days: Counts days with little or no rainfall (P < 1 mm), indicating dry spells. 45 dry days during the growing season may lead to crop wilting and reduced yields. No significant stress: < 15, Moderate: 15 to 20, Severe: 20 to 25, Extreme: > 25
NDWS Number of Soil Moisture Stress Days: Days when soil moisture is below a critical level. 20 days with soil moisture below 40% FC signals irrigation need for maize. No significant stress: < 15, Moderate: 15 to 20, Severe: 20 to 25, Extreme: > 25
TAI Thornthwaite’s Aridity Index: Quantifies long-term dryness using precipitation and PET. TAI < 0.5 indicates arid conditions, guiding drought preparedness plans. No significant stress: <40, Moderate stress: 40–60, Severe: 60–80, Extreme: >80
Heat Stress NTx35 Number of Heat Stress Days (Tmax > 35ºC): Days with max tempperature above 35ºC for crops. 12 days >35ºC during flowering can cause rice sterility and yield loss. No significant stress: < 10, Moderate: 10 – 20, Severe: 20 – 25, Extreme: > 25
NTx40 Number of Extreme Heat Stress Days (Tmax > 40ºC): Days with max temperature above 40ºC. 5 days >40ºC may cause maize leaf scorching and kernel abortion. No significant stress: 0, Moderate: 1 – 5, Severe: 5 – 10, Extreme: > 10
HSM_NTx35 Heat Stress for Maize (NTx35 during maize season): Days >35ºC during maize growth. 10 days >35ºC in maize growing period may reduce grain fill and final yield. No significant stress: < 10, Moderate: 10 – 20, Severe: 20 – 25, Extreme: > 25
HSH Human Heat Stress Index: Combines temperature and humidity to assess human heat risk. HSH > threshold triggers public health warnings during heatwaves. Mild or no stress: < 27, Caution: 27–32, Extreme caution: 32-41, Danger & Extreme danger: > 41 (with extreme danger being > 54)
THI Cattle Thermal Humidity Index: Assesses heat stress risk for livestock. THI > 72 signals risk of reduced milk yield and heat stress in dairy cattle. No stress: ≤ 72, Mild stress: 73–78, Moderate stress: 79–89, Severe stress: ≥90
Waterlogging & Flooding NDWL0 Days with Soil Waterlogging at Saturation: Days with soil moisture at or above saturation. 10 days of saturation after heavy rain may cause root rot in soybeans. No significant stress: < 2, Moderate: 2 to 5, Severe: 5 to 8, Extreme: > 8
NDWL50 Days with Waterlogging at 50% FC-Sat: Days soil is midway between field capacity & sat. 15 days in this state can delay wheat planting and reduce seedling emergence. No significant stress: < 2, Moderate: 2 to 5, Severe: 5 to 8, Extreme: > 8

Calculation Methods and Formulas

These indicators are typically calculated from daily temperature data (Tmax and Tmin).

Indicator Calculation Method & Formula
Heatwave
Method 1 (Absolute Threshold): Identify periods where Tmax exceeds a fixed threshold (e.g., 32°C) for a minimum number of consecutive days (e.g., 3 days)
Method 2 (Percentile-Based Threshold): Calculate a percentile (e.g., 90th percentile) of historical Tmax for a specific period. A heatwave occurs when Tmax exceeds this percentile for a certain number of consecutive days.
Number of Hot Days Count the number of days within a specific period (e.g., growing season, year) where Tmax > Threshold_Hot_Day.
Number of Hot Nights Count the number of days within a specific period where Tmin > Threshold_Hot_Night.
Number of Frost Days Count the number of days within a specific period where Tmin < 0°C.

R Packages:

Packages Description
tidyverse For data manipulation and filtering.
dplyr Part of tidyverse, excellent for filtering days based on temperature thresholds.
climatol Specifically designed for climatological analysis, can calculate percentile-based heatwaves and other climate indices.
RClimDex Provides functions to calculate a suite of extreme climate indices recommended by the Expert Team on Climate Change Detection and Indices (ETCCDI). This includes heatwave duration index, number of hot days, etc.
# The R code below performs a basic analysis of simulated daily temperature data. It calculates the number of hot days (Tmax > 30°C), frost days (Tmin < 0°C), and a simplified measure of heatwave days (Tmax > 32°C for at least 3 consecutive days).

library(dplyr)

# Example data frame with daily Tmax and Tmin
climate_data <- data.frame(
  date = seq(as.Date("2024-01-01"), as.Date("2024-12-31"), by = "day"),
  tmax = runif(366, 15, 40),
  tmin = runif(366, 5, 25)
)

# Number of hot days (threshold > 30°C)
hot_days <- climate_data %>% filter(tmax > 30) %>% nrow()
print(paste("Number of hot days:", hot_days))

# Number of frost days (threshold < 0°C)
frost_days <- climate_data %>% filter(tmin < 0) %>% nrow()
print(paste("Number of frost days:", frost_days))

# Identifying heatwaves (Tmax > 32°C for 3 consecutive days - simplified)
climate_data <- climate_data %>%
  mutate(hot_day = ifelse(tmax > 32, 1, 0)) %>%
  mutate(consecutive_hot = ave(hot_day, cumsum(hot_day == 0), FUN = cumsum))
heatwave_days <- climate_data %>% filter(consecutive_hot >= 3) %>% nrow()
print(paste("Number of heatwave days (simplified):", heatwave_days))

Python Packages:

Packages Description
pandas For data manipulation and filtering.
numpy For numerical operations.
xarray For working with multi-dimensional climate data (often in NetCDF format).
rioxarray Extends xarray for geospatial raster data.
climopy A Python package specifically designed for climate analysis, including the calculation of various climate indices.
ecopy Another Python package with some functions for ecological and climate data analysis.
import pandas as pd
import numpy as np

# Example DataFrame with daily Tmax and Tmin
dates = pd.to_datetime(pd.date_range('2024-01-01', '2024-12-31', freq='D'))
climate_data = pd.DataFrame({
    'date': dates,
    'tmax': np.random.uniform(15, 40, len(dates)),
    'tmin': np.random.uniform(5, 25, len(dates))
})

# Number of hot days (threshold > 30°C)
hot_days = len(climate_data[climate_data['tmax'] > 30])
print(f"Number of hot days: {hot_days}")

# Number of frost days (threshold < 0°C)
frost_days = len(climate_data[climate_data['tmin'] < 0])
print(f"Number of frost days: {frost_days}")

# Identifying heatwaves (Tmax > 32°C for 3 consecutive days - simplified)
climate_data['hot_day'] = (climate_data['tmax'] > 32).astype(int)
climate_data['consecutive_hot'] = (climate_data['hot_day']
                                   .groupby((climate_data['hot_day'] == 0).cumsum())
                                   .cumsum())
heatwave_days = len(climate_data[climate_data['consecutive_hot'] >= 3])
print(f"Number of heatwave days (simplified): {heatwave_days}")

2. Precipitation Anomalies

Definition of Terms

Term Definition
Daily Precipitation The amount of rainfall recorded in a 24-hour period (typically in millimeters or inches).
Dry Spell A period of consecutive days with rainfall below a certain threshold (e.g., < 1 mm per day). The duration can vary (e.g., 5, 10, or more consecutive dry days).
Season Rainfall Amount The total amount of rainfall received during a defined rainy season.
Rain Season Duration The length of the rainy season, often defined by the onset and cessation dates.
Onset of the Rainy Season The start date of the rainy season, often determined based on specific criteria involving cumulative rainfall over a short period after a certain date or a sequence of wet days. Various methodologies exist (e.g., simple threshold, moving average).
Cessation of the Rainy Season The end date of the rainy season, often determined by criteria involving a prolonged dry spell after a certain date or a sequence of dry days.
Intensity of Rainfall Events Measures like maximum daily rainfall, the number of heavy rainfall days (exceeding a certain threshold), or the Simple Daily Intensity Index (SDII - average rainfall on wet days).

Calculation Methods and Formulas

These indicators are calculated from daily precipitation data.

Indicator Calculation Method & Formula
Dry Spell Identify consecutive days where daily precipitation < Threshold_Dry_Day (e.g., 1 mm). The length of the dry spell is the number of such consecutive days.
Season Rainfall Amount Sum of daily precipitation within the defined rainy season (from onset to cessation). $$SeasonRainfall = \sum_{onset}^{cessation} Precipitation_t$$
Rain Season Duration Number of days between the onset and cessation dates (inclusive). $$Duration = CessationDate − OnsetDate + 1$$
Onset of the Rainy Season (Example Method - Simple Threshold) After a specific date (e.g., a climatological start of the season), look for a period of, say, 3 consecutive days with a total rainfall of at least 20 mm, with at least one day receiving more than 10 mm.
Cessation of the Rainy Season (Example Method - Fixed Date after Last Significant Rainfall)
1. Identify the last significant rainfall event (e.g., > 10 mm)
2. The cessation might be defined as a fixed number of days after this event, or when a prolonged dry spell begins.
Intensity of Rainfall Events
1. Maximum Daily Rainfall: The highest daily precipitation value within a period
2. Number of Heavy Rainfall Days: Count the number of days within a period where daily precipitation > Threshold_Heavy_Rain (e.g., 10 mm, 20 mm)
3. Simple Daily Intensity Index (SDII): Sum of daily precipitation on wet days (precipitation ≥ 1 mm) divided by the number of wet days in the period. $$SDII = \frac{\sum_{i=1}^{n} PR_i}{n_{wet}}$$ where $PR_i$ is daily precipitation on wet days, and $n_{wet}$ is the number of wet days.

R Packages:

Packages Description
tidyverse For data manipulation and filtering.
dplyr For filtering days based on precipitation thresholds.
rclimdex Can calculate indices related to precipitation extremes (e.g., consecutive dry days, heavy precipitation days).
SPEI Specifically designed to calculate the Standardized Precipitation-Evapotranspiration Index (SPEI) and also includes functionality for SPI calculation.
hydroTSM Provides functions for time series analysis in hydrology, which can be useful for analyzing precipitation patterns and identifying dry spells.
rainmaker Focuses on rainfall analysis, including onset and cessation of rainy seasons.

Python Packages:

Packages Description
pandas For data manipulation and filtering.
numpy For numerical operations.
xarray For working with multi-dimensional climate data.
rioxarray For geospatial raster data.
scipy.stats For statistical distributions needed for SPI calculation (e.g., gamma).
pySPI A dedicated Python package for calculating the Standardized Precipitation Index (SPI).
climatools A Python library with various climate analysis functions, potentially including precipitation-related indices.
esmtools A library for Earth System Model analysis, which might contain relevant functions for precipitation analysis.
⚠️ **GitHub.com Fallback** ⚠️