From aa3b8ccb3c616818e6d8d5bdc64e78b1de640053 Mon Sep 17 00:00:00 2001 From: Michael Sumner Date: Thu, 17 Oct 2024 12:34:14 +1100 Subject: [PATCH] fix time_since_melt --- DESCRIPTION | 4 ++-- NEWS.md | 2 +- R/deriv.R | 10 ++++++++-- man/extract.Rd | 2 +- man/raadtools-package.Rd | 8 ++++++++ 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 6804f67..b0a2ba1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: raadtools Type: Package Title: Tools for Synoptic Environmental Spatial Data -Version: 0.7.0 +Version: 0.7.0.2 Authors@R: c( person("Michael D.","Sumner", role = c("aut", "cre"), email = "michael.sumner@aad.gov.au"), person("Ben", "Raymond", role = "ctb", email = "ben.raymond@aad.gov.au") @@ -46,5 +46,5 @@ BugReports: https://github.com/AustralianAntarcticDivision/raadtools/issues Description: Tools for reading, plotting and manipulating spatial data, particularly from remote sensing and model output. License: GPL-3 -RoxygenNote: 7.2.3 +RoxygenNote: 7.3.2 Remotes: AustralianAntarcticDivision/raadfiles diff --git a/NEWS.md b/NEWS.md index 965589d..c7067c8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -6,7 +6,7 @@ * `readtopo()` now defaults to GEBCO 2023. -* Replace old form of time_since_melt with fancy new duckdb process. +* Replace old form of time_since_melt with fancy new duckdb process and checked it's working with extract(). * Fixed matching files bug for 8 day intervals. diff --git a/R/deriv.R b/R/deriv.R index 8c8582f..8ec623e 100644 --- a/R/deriv.R +++ b/R/deriv.R @@ -119,8 +119,14 @@ readderivice <- function(date, date <- timedateFrom(date) files <- .processFiles(date, files, time.resolution) - - out <- raster::stack(lapply(files$date, calc_time_since_melt, trx = cfiles0)) + + ## doesn't matter which file for "time_since_melt" + if (product == "time_since_melt") { + + out <- raster::stack(lapply(files$date, calc_time_since_melt, trx = files$fullname[1L])) + } else { + print("only product 'time_since_melt' currently supported ") + } setZ(out, files$date) } diff --git a/man/extract.Rd b/man/extract.Rd index 1925394..3df50ab 100644 --- a/man/extract.Rd +++ b/man/extract.Rd @@ -5,7 +5,7 @@ \alias{extract,function,data.frame-method} \title{extract} \usage{ -\S4method{extract}{`function`,data.frame}(x, y, ctstime = FALSE, fact = NULL, verbose = TRUE, ...) +\S4method{extract}{function,data.frame}(x, y, ctstime = FALSE, fact = NULL, verbose = TRUE, ...) } \arguments{ \item{x}{A raadtools read function.} diff --git a/man/raadtools-package.Rd b/man/raadtools-package.Rd index 42097af..591ecfe 100644 --- a/man/raadtools-package.Rd +++ b/man/raadtools-package.Rd @@ -11,6 +11,14 @@ used at the Australian Antarctic Division (AAD). \details{ read functions like \code{\link{readsst}} will read a data set by date-time vector, with a set of shared arguments that work the same and documented against this dummy function. +} +\seealso{ +Useful links: +\itemize{ + \item \url{https://github.com/AustralianAntarcticDivision/raadtools} + \item Report bugs at \url{https://github.com/AustralianAntarcticDivision/raadtools/issues} +} + } \author{ Michael D. Sumner \email{michael.sumner@aad.gov.au}