storm: Return storm attributes

stormR Documentation

Return storm attributes

Description

Return storm depth, duration, average intensity, and peak intensity of an event processed using marsDetectEvents.

Usage

marsStormDepth_in(rainfall_in)

marsStormDuration_hr(dtime_est)

marsStormPeakIntensity_inhr(dtime_est, rainfall_in)

marsStormAverageIntensity_inhr(dtime_est, rainfall_in)

Arguments

rainfall_in

vector, num, rainfall depth in inches representing a single rain event

dtime_est

vector, POSIXct date times representing a single rain event

Value

marsStormDepth_in

Output will be total rainfall depth for the event, in inches.

marsStormDuration_hr

Output will be a double with the duration of the event, in hours.

marsStormPeakIntensity_inhr

Output will be a number representing the event's peak intensity in inches/hour.

marsStormAverageIntensity_inhr

Output will be a number representing the event's average intensity in inches/hour.

See Also

group_by, arrange, mutate, filter, summarise, select

Examples

rain_newevents <- marsSampleRain %>%  #use dplyr pipe to update dataframe
 dplyr::group_by(gage_uid) %>% 
  dplyr::arrange(dtime_est) %>% 
  dplyr::mutate(event_id = marsDetectEvents(dtime_est, rainfall_in)) %>%
  dplyr::group_by(gage_uid, event_id) %>%
  dplyr::summarize(eventdatastart_edt = dplyr::first(dtime_est),
            eventdataend_edt = dplyr::last(dtime_est),
            eventduration_hr = marsStormDuration_hr(dtime_est),
            eventpeakintensity_inhr = marsStormPeakIntensity_inhr(dtime_est, rainfall_in),
            eventavgintensity_inhr = marsStormAverageIntensity_inhr(dtime_est, rainfall_in),
            eventdepth_in = marsStormDepth_in(rainfall_in))

taywater/pwdgsi documentation built on May 9, 2024, 8:21 p.m.