diff --git a/modules/data.atmosphere/DESCRIPTION b/modules/data.atmosphere/DESCRIPTION index 9b9d5706e3a..b07be4c42d9 100644 --- a/modules/data.atmosphere/DESCRIPTION +++ b/modules/data.atmosphere/DESCRIPTION @@ -36,7 +36,6 @@ Imports: jsonlite, lubridate (>= 1.6.0), magrittr, - maptools, MASS, mgcv, ncdf4 (>= 1.15), @@ -53,6 +52,7 @@ Imports: sf, sp, stringr (>= 1.1.0), + suntools, terra, testthat (>= 2.0.0), tibble, diff --git a/modules/data.atmosphere/R/met_temporal_downscale.Gaussian_ensemble.R b/modules/data.atmosphere/R/met_temporal_downscale.Gaussian_ensemble.R index 1082ffb60e3..a241d1fbe5f 100644 --- a/modules/data.atmosphere/R/met_temporal_downscale.Gaussian_ensemble.R +++ b/modules/data.atmosphere/R/met_temporal_downscale.Gaussian_ensemble.R @@ -216,11 +216,11 @@ met_temporal_downscale.Gaussian_ensemble <- function(in.path, in.prefix, outfold day <- as.POSIXct(sprintf("%s 12:00:00", date), tz = tz) sequence <- seq(from = day, length.out = span, by = "days") - sunrise <- maptools::sunriset(lon.lat, sequence, direction = "sunrise", + sunrise <- suntools::sunriset(lon.lat, sequence, direction = "sunrise", POSIXct.out = TRUE) - sunset <- maptools::sunriset(lon.lat, sequence, direction = "sunset", + sunset <- suntools::sunriset(lon.lat, sequence, direction = "sunset", POSIXct.out = TRUE) - solar_noon <- maptools::solarnoon(lon.lat, sequence, POSIXct.out = TRUE) + solar_noon <- suntools::solarnoon(lon.lat, sequence, POSIXct.out = TRUE) data.frame(date = as.Date(sunrise$time), sunrise = as.numeric(format(sunrise$time, "%H%M")), solarnoon = as.numeric(format(solar_noon$time, "%H%M")),