diff --git a/R/terminator_lat_lon.R b/R/terminator_lat_lon.R index 826fa84..0c2fe2f 100644 --- a/R/terminator_lat_lon.R +++ b/R/terminator_lat_lon.R @@ -1,11 +1,16 @@ #' Generate a full set of terminator frames #' -#' @param day,from,to,by setup for the hours sequence +#' @param day,hrs_from,hrs_to,hrs_by setup for the hours sequence +#' @param lon_from,lon_to,lon_by latitude sequence setup #' @export -terminator_lat_lon <- function(day = Sys.Date(), from=0, to=23, by=1) { +terminator_lat_lon <- function(day = Sys.Date(), hrs_from=0, hrs_to=23, hrs_by=1, + lon_from=-180, lon_to=190, lon_by=0.5) { - purrr::map_df(seq(0, 23, 1), ~{ - out <- terminator(as.integer((as.POSIXct(day) + (60*60*.x))), -180, 190, 0.5) + purrr::map_df(seq(hrs_from, hrs_to, hrs_by), ~{ + terminator( + as.integer((as.POSIXct(day) + (60*60*.x))), + -lon_from, lon_to, lon_by + ) -> out out$frame <- .x out }) diff --git a/man/terminator_lat_lon.Rd b/man/terminator_lat_lon.Rd index 52db851..957330c 100644 --- a/man/terminator_lat_lon.Rd +++ b/man/terminator_lat_lon.Rd @@ -4,10 +4,13 @@ \alias{terminator_lat_lon} \title{Generate a full set of terminator frames} \usage{ -terminator_lat_lon(day = Sys.Date(), from = 0, to = 23, by = 1) +terminator_lat_lon(day = Sys.Date(), hrs_from = 0, hrs_to = 23, + hrs_by = 1, lon_from = -180, lon_to = 190, lon_by = 0.5) } \arguments{ -\item{day, from, to, by}{setup for the hours sequence} +\item{day, hrs_from, hrs_to, hrs_by}{setup for the hours sequence} + +\item{lon_from, lon_to, lon_by}{latitude sequence setup} } \description{ Generate a full set of terminator frames diff --git a/src/terminator-main.cpp b/src/terminator-main.cpp index 7b0b676..7fe8b27 100644 --- a/src/terminator-main.cpp +++ b/src/terminator-main.cpp @@ -49,8 +49,9 @@ inline double ecliptic_obliquity(double j_day) { T * (0.0001831 / 3600.0 + T * (0.00200340 / 3600.0 - T * (0.576e-6 / 3600.0 - - T * 4.34e-8 / 3600.0) + T * 4.34e-8 / 3600.0 ) + ) ) ) ); @@ -137,7 +138,7 @@ DataFrame terminator(int time, double from = -180, double to = 180, double by = _["lon"] = out_lon ); - df.attr("class") = CharacterVector::create("tbl_df", "tbl", "data.frame"); + df.attr("class") = CharacterVector::create("terminator_df", "tbl_df", "tbl", "data.frame"); return(df);