This function works with the virtual snow sensor of TRUE/FALSE which is the output of mc_calc_snow(). So, before calling mc_calc_snow_agg you need to calculate or import mc_read_ TRUE/FALSE snow sensor. mc_calc_snow_agg returns the summary table of snow sensor (e.g number of days with snow cover, first and last date of continual snow cover longer than input period). The snow summary is returned for whole date range provided. And is returned as new data.frame in contrast with other mc_calc functions returning virtual sensors.

mc_calc_snow_agg(
  data,
  snow_sensor = "snow",
  localities = NULL,
  period = 3,
  use_utc = FALSE
)

Arguments

data

cleaned myClim object see myClim-package with TRUE/FALSE snow sensor see mc_calc_snow()

snow_sensor

name of snow sensor containing TRUE/FALS snow detection, suitable for virtual sensors created by function mc_calc_snow; (default "snow")

localities

optional subset of localities where to run the function (list of locality_ids); if NULL then return all localities (default NULL)

period

number of days defining the continual snow cover period of interest (default 3 days)

use_utc

if set FALSE then time is shifted based on offset provided in locality metadata tz_offset, see e.g. mc_prep_solar_tz(), mc_prep_meta_locality(); (default FALSE)

Value

Returns data.frame with columns:

  • locality - locality id

  • snow_days - number of days with snow cover

  • first_day - first day with snow

  • last_day - last day with snow

  • first_day_period - first day of period with continual snow cover based on period parameter

  • last_day_period - last day of period with continual snow cover based on period parameter

Details

Primary designed for virtual snow sensor calculated by mc_calc_snow(), but accepts any sensor with TRUE/FLAST snow event detection. If snow_sensor on the locality is missing, then locality is skipped.

Examples

data <- mc_calc_snow(mc_data_example_agg, "TMS_T2", output_sensor="TMS_T2_snow",
                     localities = c("A2E32", "A6W79"))
mc_calc_snow_agg(data, "TMS_T2_snow")
#>   locality_id snow_days  first_day   last_day first_day_period last_day_period
#> 1       A2E32         0       <NA>       <NA>             <NA>            <NA>
#> 2       A6W79        23 2021-01-07 2021-01-31       2021-01-07      2021-01-31