Skip to contents

Reads the partitioned Arrow CSV dataset written by get_clim_monthly(), summarizes the requested variables by (Year, Month, EcoID), applies unit conversions to match LANDIS-II conventions, and pivots to the wide format ingested by LandisClimateConfig. The result has the same shape that prep_monthly_weather() returns and is suitable for writeClimateData().

Usage

assemble_climate_library_file_monthly(
  dataset_path,
  vars,
  id_col = "EcoID",
  cell_eco = NULL,
  cell_ids = NULL
)

Arguments

dataset_path

character. Path to the Climatic_Monthly Arrow dataset directory (containing YEAR=.../BatchID=.../part-0.csv partitions).

vars

character vector of BioSIM column names to retain (e.g. c("TotalPrcp", "MeanTmin", "MeanTmax", "WndS", "WndD")).

id_col

character. Name of the ecoregion-id column. Default "EcoID".

cell_eco

optional data.frame mapping CellID -> ecoregion id (id_col). Supply for the GLOBAL per-cell store (which is climate-only, no EcoID): the ecoregion grouping is study-area-specific and is applied here by joining this map. When NULL, the dataset is assumed to already carry id_col.

cell_ids

optional integer vector of CellIDs to retain (the calling study area's cells); used to filter a shared global store down to one study area before summarising. NULL keeps all cells.

Value

tbl_df with columns Year, Month, Variable, and one column per ecoregion id.

Details

Unit conversions applied:

  • TotalPrcp (mm) \(\to\) cm (\(\div 10\))

  • WndS (km/h) \(\to\) m/s (\(\div 3.6\))

BioSIM WndD is reported as the wind from-direction (degrees), which is what the LANDIS-II Climate Library expects. The monthly value here is a frequency-weighted circular mean across the model's 36 direction bins (see get_clim_monthly()); when summarising across cells within an ecoregion the same arithmetic-mean convention as the daily pipeline is applied.