getTimingHSAM function

Time of occurence of High Spectral Anomaly Magnitude (HSAM)

Time of occurence of High Spectral Anomaly Magnitude (HSAM)

Compute the number of days separating HSAM and reference point for each year.

getTimingHSAM(index.hsam, index.ref, years, for.year = NULL)

Arguments

  • index.hsam: A scalar/vector of index of HSAM values in given year/years
  • index.ref: A scalar/vector of index of reference point in given year/years
  • years: A vector of years corresponding to HSAM and ref values. This argument can be NULL if the HSAM and ref values are scalars.
  • for.year: (optional) Calculate timing (HSAM) only for the given year in this argument. If argument is omitted, timing (HSAM) values for all years are calculated.

Returns

Scalar timing HSAM value if the inputs are scalars, or a Data frame containing two Columns:

yearFirst column, represents year
timing.hsamSecond column, represents hsam timing values

Examples

# load sample data data("sycamore") x = sycamore # get streamflow object for the sample data x.streamflow = asStreamflow(x) # prepare baseline signal x.bl = prepareBaseline(x.streamflow) # get signal parts x.sp = getSignalParts(x.bl$pred2, candmin = c(40:125), candmax = c(190:330), years = x.streamflow$data$year, months = x.streamflow$data$month, jdays = x.streamflow$data$jday) # get HSAM values hsam = getHSAM(x.bl$resid.sig, x.streamflow$data$year) # timing HSAM thsam = getTimingHSAM(hsam$Index.all, x.sp$peak.index, x.sp$year)
  • Maintainer: Samarth Shah
  • License: GPL-3
  • Last published: 2019-03-08

Useful links