Skip to contents

Attempts to match column names in a meteorological data frame to AEME standard variable names using guess_aeme_vars(), then detects the likely input units of each variable from its values and converts to the units expected by the package.

Usage

standardise_met(met, verbose = TRUE)

Arguments

met

data.frame; meteorological data with a Date column and one or more meteorological variable columns.

verbose

logical; if TRUE (default), emit cli_inform messages describing each detected unit conversion applied. Set to FALSE for quiet operation inside pipelines.

Value

The input data frame with column names remapped to AEME standard names and values converted to AEME standard units where a conversion was necessary. Columns that could not be matched are retained unchanged with a warning. A warning is also emitted if any required variable (MET_radswd, MET_tmpair, MET_wndspd, MET_pprain) is absent after renaming.

AEME standard variables and units

VariableNameUnitRequired
Shortwave radiationMET_radswdW/m²Yes
Air temperatureMET_tmpair°CYes
Wind speedMET_wndspdm/sYes
RainfallMET_pprainmm/dayYes
SnowfallMET_ppsnowmm/dayNo (defaults to 0)
u wind componentMET_wnduvum/sNo (derivable)
v wind componentMET_wnduvvm/sNo (derivable)
Sea-level pressureMET_prmslpPaNo (derivable)
Station pressureMET_prsttnPaNo (derivable)
Cloud coverMET_cldcvr1 (fraction)No (derivable)
Longwave radiationMET_radlwdW/m²No (derivable)
Dew point temp.MET_tmpdew°CNo (derivable)
Vapour pressureMET_prvaprhPaNo (derivable)
Relative humidityMET_humrel\ Wind directionMET_wnddir