GetERA5DailyHeatIndexData: Download ERA5 data and calculate heat stress indices

View source: R/heat_stress.R

GetERA5DailyHeatIndexDataR Documentation

Download ERA5 data and calculate heat stress indices

Description

This function downloads ERA5 temperature, dewpoint, and wind data for a region. Then it calculates the heat stress indices.

Usage

GetERA5DailyHeatIndexData(
  request_id,
  start_date,
  end_date,
  json_file = NULL,
  north = NULL,
  south = NULL,
  east = NULL,
  west = NULL,
  solar_load = FALSE,
  resolution = 0.25,
  use_cache = TRUE,
  verbose = FALSE
)

get_era5_daily_heat_index_data(
  request_id,
  start_date,
  end_date,
  json_file = NULL,
  north = NULL,
  south = NULL,
  east = NULL,
  west = NULL,
  solar_load = FALSE,
  resolution = 0.25,
  use_cache = TRUE,
  verbose = FALSE
)

GetERA5DailyHeatData(
  request_id,
  start_date,
  end_date,
  json_file = NULL,
  north = NULL,
  south = NULL,
  east = NULL,
  west = NULL,
  solar_load = FALSE,
  resolution = 0.25,
  use_cache = TRUE,
  verbose = FALSE
)

get_era5_daily_heat_data(
  request_id,
  start_date,
  end_date,
  json_file = NULL,
  north = NULL,
  south = NULL,
  east = NULL,
  west = NULL,
  solar_load = FALSE,
  resolution = 0.25,
  use_cache = TRUE,
  verbose = FALSE
)

Arguments

request_id

Unique identifier for the data request

start_date

Start date in "YYYY-MM-DD" format

end_date

End date in "YYYY-MM-DD" format

json_file

Path to the GeoJSON file that defines the region (for the geojson method)

north

Northern latitude boundary (for the bbox method)

south

Southern latitude boundary (for the bbox method)

east

Eastern longitude boundary (for the bbox method)

west

Western longitude boundary (for the bbox method)

solar_load

If TRUE, include solar radiation in the calculations (default: FALSE). If TRUE, the function downloads solar radiation data and uses these data for WBGT and UTCI.

resolution

Spatial resolution in degrees (default: 0.25)

use_cache

If TRUE, the function uses cached data when the data is available (default: TRUE)

verbose

If TRUE, the function prints progress messages (default: FALSE)

Value

data.frame with columns: date, latitude, longitude, temp_c, dewpoint_c, wind_speed, rh, wet_bulb, heat_index, wbgt, utci, humidex, wbgt_risk, heat_index_risk, utci_stress. If solar_load=TRUE, the data.frame also contains solar_radiation.

Examples


region <- system.file("extdata", "region.geojson", package = "varunayan")
heat_data <- GetERA5DailyHeatIndexData(
  request_id = "india_heat_2023",
  start_date = "2023-05-01",
  end_date = "2023-05-31",
  json_file = region
)

# With solar radiation for outdoor WBGT
heat_data <- GetERA5DailyHeatIndexData(
  request_id = "india_heat_2023_solar",
  start_date = "2023-05-01",
  end_date = "2023-05-31",
  json_file = region,
  solar_load = TRUE
)


varunayan documentation built on Oct. 30, 2026, 1:07 a.m.