
Assemble LANDIS-II Climate Library wide-format table from a monthly BioSIM Arrow dataset
assemble_climate_library_file_monthly.RdReads 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_MonthlyArrow dataset directory (containingYEAR=.../BatchID=.../part-0.csvpartitions).- 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, noEcoID): the ecoregion grouping is study-area-specific and is applied here by joining this map. WhenNULL, the dataset is assumed to already carryid_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.NULLkeeps all cells.
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.