Skip to content
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: Rfits
Type: Package
Title: FITS Readers and Writers
Version: 1.20.0
Date: 2026-09-18
Version: 1.23.0
Date: 2026-09-23
Authors@R: c(
person(given='Aaron', family='Robotham', email='aaron.robotham@uwa.edu.au',
role=c('aut', 'cre'), comment=c(ORCID='0000-0003-0429-3579')),
Expand All @@ -11,8 +11,8 @@ Authors@R: c(
Maintainer: Aaron Robotham <aaron.robotham@uwa.edu.au>
Description: Read and write FITS images, tables and headers. Has a mixture of fairly low level and very high level routines. Many methods for conveniently operating on FITS files are included.
License: LGPL-3
Imports: Rcpp, bit64, checkmate, foreach, doParallel, magicaxis
Suggests: data.table, FITSio, testthat, hdf5r, zarr, paws.storage (>= 0.9), ProFound, tdigest, R.utils, Rwcs (>= 1.8.7), knitr, rmarkdown, jsonlite
Imports: Rcpp, bit64, checkmate, foreach, doParallel, parallel, magicaxis
Suggests: data.table, FITSio, testthat, withr, hdf5r, zarr, paws.storage (>= 0.9), arrow, ProFound, tdigest, R.utils, Rwcs (>= 1.8.7), knitr, rmarkdown, jsonlite, shiny, bslib, plotly, DT, zip, fontawesome, promises, future, digest
Remotes:
asgr/Rwcs,
asgr/ProFound
Expand Down
7 changes: 6 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import("doParallel")

#import functions

importFrom("utils", "object.size")
importFrom("utils", "object.size", "head")
importFrom("graphics", "plot", "lines")
importFrom("magicaxis", "magimage")

Expand Down Expand Up @@ -110,6 +110,10 @@ export(Rfits_inspect_zarr)
export(Rfits_s3_store_new)
export(Rfits_dir_to_zarr)
export(Rfits_cutout_zarr_dir)
export(Rfits_cutout_app)
export(Rfits_zarr_index)
export(Rfits_zarr_index_query)
export(Rfits_zarr_index_info)

export(Rfits_length)
export(Rfits_dim)
Expand Down Expand Up @@ -150,6 +154,7 @@ S3method("print", Rfits_vector)
S3method("print", Rfits_pointer)
S3method("print", Rfits_pointer_zarr)
S3method("print", Rfits_header)
S3method("print", Rfits_zarr_index_info)
#S3method("print", Rfits_keylist)
S3method("print", Rfits_list)

Expand Down
42 changes: 42 additions & 0 deletions R/Rfits_cutout_app.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#Launch the bundled Shiny app for browsing and cutting out Zarr stores.
#
#The app itself is a single file under inst/shiny, so it can also be run directly with
#shiny::runApp(system.file('shiny', 'Rfits_cutout_app', package = 'Rfits')). This wrapper
#exists so that the dependency checks happen once, in R, where they can name the missing
#package, rather than as a failed requireNamespace deep inside the app's UI.

Rfits_cutout_app = function(launch.browser = getOption('shiny.launch.browser', interactive()),
display.mode = c('normal', 'static'),
port = NULL, ...){
#The same list the app checks for itself, so that a missing package is named here
#rather than reported from inside the app's own startup
need = c('shiny', 'bslib', 'plotly', 'Rwcs', 'arrow', 'data.table')
missing = need[!vapply(need, requireNamespace, logical(1), quietly = TRUE)]
if(length(missing) > 0){
stop('Rfits_cutout_app needs: ', paste(missing, collapse = ', '),
'. Please install them from CRAN.', call. = FALSE)
}
app = system.file('shiny', 'Rfits_cutout_app', package = 'Rfits')
if(!nzchar(app) || !file.exists(file.path(app, 'app.R'))){
#An empty path is what a namespace installed without its inst directory looks like,
#which is worth saying plainly rather than letting runApp report a missing app_dir
stop('The bundled app was not found inside the Rfits installation. Reinstall the ',
'package from source.', call. = FALSE)
}
#Optional in the same sense the app treats them: a table without pagination and a
#download that cannot be zipped are both worse than useful, so they are advice rather
#than a refusal
for(opt in c('DT', 'zip')){
if(!requireNamespace(opt, quietly = TRUE)){
message('Install the ', opt, ' package for ',
if(opt == 'DT') 'paged tables in the app.' else 'bulk downloads from the app.')
}
}
display.mode = match.arg(display.mode)
args = list(appDir = app, launch.browser = launch.browser,
display.mode = display.mode)
if(!is.null(port)){
args$port = port
}
return(do.call(shiny::runApp, c(args, list(...))))
}
Loading
Loading