Reads compiled ENSO/IOD data from the enso-data Python pipeline repository and writes cleaned CSV files to the MOSAIC-data processed directory. Uses baseline-corrected values and retains the data source column for downstream forecast validation.
Usage
process_enso_data(PATHS, source = c("nmme", "bom"))Arguments
- PATHS
A list of paths generated by
get_paths(), must include:ENSO_DATA_REPO: Path to the enso-data repository.
DATA_ENSO: Path to the output directory for processed ENSO data.
- source
Character; which enso-data forecast source to read. One of
"nmme"(NOAA North American Multi-Model Ensemble, ENSMEAN; ~9-month forecast horizon and four ENSO/IOD indices; the default) or"bom"(Australian Bureau of Meteorology, ~6-month horizon). Both are resolved from the same enso-data repository viadownloads/<source>/LATEST. NMME is the operational default as of MOSAIC v0.55.5 (the IRI feed it replaces shut down; NMME provides the longer horizon and direct IOD coverage); pass"bom"for the legacy source.
Value
Invisibly returns the path to the output directory. Writes three CSV files:
enso_daily.csv, enso_weekly.csv, enso_monthly.csv.
Details
The function reads from the most recent compiled download for the chosen
source (resolved via the downloads/<source>/LATEST pointer file).
Both sources emit the same four ENSO/IOD variables (ENSO3, ENSO34, ENSO4, IOD)
with continuous coverage from 1970 through the forecast horizon, combining NOAA
historical, observed, and source-specific forecast data.
The value_adj column (baseline-corrected to NOAA 1991-2020) is selected
and renamed to value. The data_source column is retained with
values: historical, observed, forecast. The NMME source
carries an extra model provenance column (e.g. ENSMEAN); it is
dropped here so the written schema is identical regardless of source.
