Create a station metadata table either by:

  • loading from a CSV file,

  • accepting an existing data.frame,

  • or auto-generating synthetic stations within a bounding box.

create_stations(
  source = NULL,
  n = 10,
  bbox = c(-3.5, 1.5, 4.5, 11.5),
  derive_climate = TRUE,
  seed = NULL
)

Arguments

source

Path to CSV file OR a data.frame with Station/LON/LAT OR NULL (to generate synthetic stations).

n

Integer number of stations to generate when source = NULL. Default = 10.

bbox

Numeric vector: c(min_lon, max_lon, min_lat, max_lat). Default approximates Ghana's spatial extent.

derive_climate

Logical. If TRUE, additional climate metadata are derived for each station. Default = TRUE.

seed

Optional numeric seed for reproducibility.

Value

A data.frame containing:

Station

Station name

LON

Longitude

LAT

Latitude

ELEV

Synthetic elevation estimate (m)

CLIMATE_ZONE

Derived climate zone

COASTAL_INDEX

Relative coastal influence index

TEMP_BASE

Baseline temperature estimate

RAIN_REGIME

Derived rainfall regime

Details

The function also supports optional derivation of climate-related station attributes used by the CDSimX simulation engine.

Examples

create_stations(n = 5, seed = 42)
#> Generating synthetic station network...
#> Generated 5 synthetic stations within bounding box.
#> Deriving climate-aware station attributes...
#>     Station        LON      LAT  ELEV CLIMATE_ZONE COASTAL_INDEX TEMP_BASE
#> 1 Station_1  1.0740302 8.133672 366.2       Forest         0.639     28.50
#> 2 Station_2  1.1853771 9.656118 575.3     Savannah         1.000     27.22
#> 3 Station_3 -2.0693023 5.442666 747.7      Coastal         0.000     24.37
#> 4 Station_4  0.6522381 9.098946 204.3     Savannah         0.868     28.62
#> 5 Station_5 -0.2912724 9.435453 369.8     Savannah         0.948     27.72
#>   RAIN_REGIME
#> 1       Humid
#> 2   Monomodal
#> 3     Bimodal
#> 4   Monomodal
#> 5   Monomodal

create_stations(
  data.frame(
    Station = "Accra",
    LON = -0.18,
    LAT = 5.60
  )
)
#> Using station metadata from supplied data.frame
#> Deriving climate-aware station attributes...
#>   Station   LON LAT  ELEV CLIMATE_ZONE COASTAL_INDEX TEMP_BASE RAIN_REGIME
#> 1   Accra -0.18 5.6 723.2      Coastal           0.5     24.58     Bimodal