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)

marsStormPeakIntensity_inhr(rainfall_in)

marsStormAverageIntensity_inhr(dtime, rainfall_in)

Arguments

rainfall_in

Vector of rainfall_in for a given storm (in inches)

dtime

Vector of datetimes for a given storm

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 June 14, 2025, 9 p.m.