Skip to contents

Given vectors of integer years, integer days-of-year, and decimal hours, computes the first and last indices that fall between the given start and end times.

Usage

sipnet_time_range_idx(
  yrs,
  ydays,
  hrs,
  start_yr,
  start_yday,
  start_hr,
  end_yr,
  end_yday,
  end_hr
)

Arguments

yrs, ydays, hrs

vectors to be subset, containing respectively the year, day-of-year, and hour of day.

start_yr, start_yday, start_hr

year, day-of-year, and hour to start from, all scalar

end_yr, end_yday, end_hr

year, day-of-year, and hour to stop before, all scalar

Details

Assumes the inputs are sorted (as Sipnet requires), and specifically that the first and last rows are the earliest and latest timepoints. If they are not, the result will be unpredictable.

Author

Chris Black