Browse Source

terminator_lat_lon() didn't pass params through to terminator()

master
boB Rudis 6 years ago
parent
commit
2526ae0bc0
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 13
      R/terminator_lat_lon.R
  2. 7
      man/terminator_lat_lon.Rd
  3. 5
      src/terminator-main.cpp

13
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
})

7
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

5
src/terminator-main.cpp

@ -49,7 +49,8 @@ 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);

Loading…
Cancel
Save