R/get_time_bounds_doy.R

Defines functions get_time_bounds_doy

get_time_bounds_doy <- function(times, doy) {
  time_bnds <- array(NA, dim = c(2, length(unique(doy))))

  count <- 1
  for (j in sort(unique(doy))) {
    day_dummy <- which(doy == j)
    time_bnds[1, count] <- times[min(day_dummy)]
    time_bnds[2, count] <- times[max(day_dummy)]
    count <- count + 1
  }

  return(time_bnds)
}

Try the cmsafops package in your browser

Any scripts or data that you put into this service are public.

cmsafops documentation built on Sept. 18, 2023, 5:16 p.m.