From 1af9f585d1e23f4d6413fc5ccc180ab3a66667c5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 05:25:24 +0000 Subject: [PATCH 1/4] Use ParmOff in ProSpectSEDlike for bounds/logged and function dispatch Agent-Logs-Url: https://github.com/asgr/ProSpect/sessions/20970253-fcc0-468d-9a54-4254b92e17f4 Co-authored-by: asgr <5617132+asgr@users.noreply.github.com> --- R/ProSpect.R | 103 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 41 deletions(-) diff --git a/R/ProSpect.R b/R/ProSpect.R index 9ffda0f..b123c19 100644 --- a/R/ProSpect.R +++ b/R/ProSpect.R @@ -533,6 +533,21 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { } names(parm) = Data$parm.names + + if (!requireNamespace("ParmOff", quietly = TRUE)) { + stop("The ParmOff package is needed for parameter mapping in ProSpectSEDlike. Please install it from GitHub/asgr/ParmOff.", call. = FALSE) + } + + logged_parm_names = NULL + if (!is.null(Data$logged)) { + if (length(Data$logged) == 1) { + if (Data$logged) { + logged_parm_names = Data$parm.names + } + } else { + logged_parm_names = Data$parm.names[Data$logged] + } + } if(is.null(Data$photom) & isTRUE(Data$mode == 'photom')){ Data$photom = Data$flux @@ -573,7 +588,7 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { z_genSF = Data$arglist$z_genSF ## What redshift should we start star formation? ztest = parm["z"] - if(Data$logged[Data$parm.names == "z"]){ + if("z" %in% logged_parm_names){ ztest = 10^ztest } @@ -622,26 +637,28 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { parm = Data$constraints(parm) } + parm_lower = NULL + parm_upper = NULL if (!is.null(Data$intervals)) { - #parm[parm < Data$intervals$lo] = Data$intervals$lo[parm < Data$intervals$lo] - #parm[parm > Data$intervals$hi] = Data$intervals$hi[parm > Data$intervals$hi] - parm = pmin(pmax(parm, Data$intervals$lo), Data$intervals$hi) - } - - if (!is.null(Data$logged)) { - if (length(Data$logged) == 1) { - if (Data$logged) { - parmlist = 10 ^ parm - } else{ - parmlist = parm - } - } else{ - parmlist = parm - parmlist[Data$logged] = 10 ^ parm[Data$logged] - } - } else{ - parmlist = parm - } + parm_lower = Data$intervals$lo + parm_upper = Data$intervals$hi + names(parm_lower) = Data$parm.names + names(parm_upper) = Data$parm.names + } + + parmlist = ParmOff::ParmOff( + .func = ProSpectSED, + .args = as.list(parm), + .lower = parm_lower, + .upper = parm_upper, + .logged = logged_parm_names, + .return = 'args', + .check = FALSE + )$current_args + if(any(lengths(parmlist) != 1L)){ + stop('All fitting parameters must be scalar values.') + } + parmlist = unlist(parmlist, recursive = FALSE, use.names = TRUE) if (Data$verbose) { message(parmlist) @@ -666,20 +683,22 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { } if (returnall) { - SEDout = do.call( - 'ProSpectSED', - args = c( - parmlist, - list(SFH = quote(Data$SFH)), - list(speclib = quote(Data$speclib)), - list(Dale = quote(Data$Dale)), - list(AGN = quote(Data$AGN)), - list(filtout = quote(filtout)), + SEDout = ParmOff::ParmOff( + .func = ProSpectSED, + .args = c( + as.list(parmlist), + list(SFH = Data$SFH), + list(speclib = Data$speclib), + list(Dale = Data$Dale), + list(AGN = Data$AGN), + list(filtout = filtout), list(filters = NULL), list(returnall = TRUE), - list(Dale_M2L_func = quote(Data$Dale_M2L_func)), + list(Dale_M2L_func = Data$Dale_M2L_func), Data$arglist - ) + ), + .return = 'func', + .check = FALSE ) if(is.null(Data$filtout) | isTRUE(Data$mode == 'spec') | isTRUE(Data$mode == 'both')){ #this means we are in spec-z mode @@ -718,19 +737,21 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { } } else{ - Photom = do.call( - 'ProSpectSED', - args = c( - parmlist, - list(SFH = quote(Data$SFH)), - list(speclib = quote(Data$speclib)), - list(Dale = quote(Data$Dale)), - list(AGN = quote(Data$AGN)), - list(filtout = quote(filtout)), + Photom = ParmOff::ParmOff( + .func = ProSpectSED, + .args = c( + as.list(parmlist), + list(SFH = Data$SFH), + list(speclib = Data$speclib), + list(Dale = Data$Dale), + list(AGN = Data$AGN), + list(filtout = filtout), list(filters = NULL), list(returnall = FALSE), Data$arglist - ) + ), + .return = 'func', + .check = FALSE ) if(is.null(filtout)){ From 3444d84a81cd2c10ae710d5380fd780790764532 Mon Sep 17 00:00:00 2001 From: Aaron Robotham Date: Thu, 14 May 2026 17:48:24 +0800 Subject: [PATCH 2/4] Fix! --- R/ProSpect.R | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/R/ProSpect.R b/R/ProSpect.R index b123c19..fe7dac8 100644 --- a/R/ProSpect.R +++ b/R/ProSpect.R @@ -637,18 +637,27 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { parm = Data$constraints(parm) } + if('scat_scale' %in% Data$parm.names){ + sel = which('scat_scale' == Data$parm.names) + scat_scale = parmlist[sel] + parmlist = parmlist[-sel] + Data$parm.names = Data$parm.names[-sel] + }else{ + scat_scale = 1 + } + parm_lower = NULL parm_upper = NULL if (!is.null(Data$intervals)) { - parm_lower = Data$intervals$lo - parm_upper = Data$intervals$hi + parm_lower = as.list(Data$intervals$lo) + parm_upper = as.list(Data$intervals$hi) names(parm_lower) = Data$parm.names names(parm_upper) = Data$parm.names } - + parmlist = ParmOff::ParmOff( .func = ProSpectSED, - .args = as.list(parm), + .args = parm, .lower = parm_lower, .upper = parm_upper, .logged = logged_parm_names, @@ -664,15 +673,6 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { message(parmlist) } - if('scat_scale' %in% Data$parm.names){ - sel = which('scat_scale' == Data$parm.names) - scat_scale = parmlist[sel] - parmlist = parmlist[-sel] - Data$parm.names = Data$parm.names[-sel] - }else{ - scat_scale = 1 - } - Monitor = {} if(isTRUE(Data$mode == 'spec') | isTRUE(Data$mode == 'both')){ From a8be65d691e4fccb6fd260d98c24eda8ccbcc968 Mon Sep 17 00:00:00 2001 From: Aaron Robotham Date: Tue, 19 May 2026 17:21:39 +0800 Subject: [PATCH 3/4] Some tweaks. Can use .rem.args --- R/ProSpect.R | 48 +++++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/R/ProSpect.R b/R/ProSpect.R index fe7dac8..07b5008 100644 --- a/R/ProSpect.R +++ b/R/ProSpect.R @@ -533,19 +533,23 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { } names(parm) = Data$parm.names - + if (!requireNamespace("ParmOff", quietly = TRUE)) { stop("The ParmOff package is needed for parameter mapping in ProSpectSEDlike. Please install it from GitHub/asgr/ParmOff.", call. = FALSE) } - + logged_parm_names = NULL if (!is.null(Data$logged)) { - if (length(Data$logged) == 1) { - if (Data$logged) { - logged_parm_names = Data$parm.names + if(is.logical(Data$logged)){ + if (length(Data$logged) == 1) { + if (Data$logged) { + logged_parm_names = Data$parm.names + } + } else { + logged_parm_names = Data$parm.names[Data$logged] } - } else { - logged_parm_names = Data$parm.names[Data$logged] + }else{ + logged_parm_names = Data$logged } } @@ -637,15 +641,6 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { parm = Data$constraints(parm) } - if('scat_scale' %in% Data$parm.names){ - sel = which('scat_scale' == Data$parm.names) - scat_scale = parmlist[sel] - parmlist = parmlist[-sel] - Data$parm.names = Data$parm.names[-sel] - }else{ - scat_scale = 1 - } - parm_lower = NULL parm_upper = NULL if (!is.null(Data$intervals)) { @@ -654,7 +649,7 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { names(parm_lower) = Data$parm.names names(parm_upper) = Data$parm.names } - + parmlist = ParmOff::ParmOff( .func = ProSpectSED, .args = parm, @@ -664,13 +659,22 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { .return = 'args', .check = FALSE )$current_args + if(any(lengths(parmlist) != 1L)){ stop('All fitting parameters must be scalar values.') } - parmlist = unlist(parmlist, recursive = FALSE, use.names = TRUE) + + if('scat_scale' %in% Data$parm.names){ + scat_scale = parmlist[['scat_scale']] + #parm = parm[-sel] + #Data$parm.names = Data$parm.names[-sel] + }else{ + scat_scale = 1 + } if (Data$verbose) { - message(parmlist) + parmlist_print = unlist(parmlist, recursive = FALSE, use.names = TRUE) + message(parmlist_print) } Monitor = {} @@ -686,7 +690,7 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { SEDout = ParmOff::ParmOff( .func = ProSpectSED, .args = c( - as.list(parmlist), + parmlist, list(SFH = Data$SFH), list(speclib = Data$speclib), list(Dale = Data$Dale), @@ -697,6 +701,7 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { list(Dale_M2L_func = Data$Dale_M2L_func), Data$arglist ), + .rem_args = 'scat_scale', .return = 'func', .check = FALSE ) @@ -740,7 +745,7 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { Photom = ParmOff::ParmOff( .func = ProSpectSED, .args = c( - as.list(parmlist), + parmlist, list(SFH = Data$SFH), list(speclib = Data$speclib), list(Dale = Data$Dale), @@ -750,6 +755,7 @@ ProSpectSEDlike = function(parm = c(8, 9, 10, 10, 0, -0.5, 0.2), Data) { list(returnall = FALSE), Data$arglist ), + .rem_args = 'scat_scale', .return = 'func', .check = FALSE ) From b8d686798adb3df125917749b652c04e2dcdb51d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 26 May 2026 04:26:09 +0000 Subject: [PATCH 4/4] Add package anchors for external Rd link targets Agent-Logs-Url: https://github.com/asgr/ProSpect/sessions/00d739b7-d48d-426a-ae77-0fcc76ea6e83 Co-authored-by: asgr <5617132+asgr@users.noreply.github.com> --- man/AGNinterp.Rd | 2 +- man/Dale_interp.Rd | 8 ++++---- man/ProSpectSED.Rd | 22 +++++++++++----------- man/SFH.Rd | 10 +++++----- man/dust.Rd | 2 +- man/dustmass.Rd | 4 ++-- man/filterTranMags.Rd | 2 +- man/greybody.Rd | 2 +- man/interp_param.Rd | 2 +- man/kcorr.Rd | 2 +- man/photom.Rd | 2 +- man/radiocont.Rd | 2 +- man/runShinySED.Rd | 6 +++--- man/speclib_download.Rd | 4 ++-- 14 files changed, 35 insertions(+), 35 deletions(-) diff --git a/man/AGNinterp.Rd b/man/AGNinterp.Rd index dd16f8f..54191fc 100644 --- a/man/AGNinterp.Rd +++ b/man/AGNinterp.Rd @@ -82,7 +82,7 @@ Stalevski et al, 2016, MNRAS, 458, 2288 Aaron Robotham & Adam Marshall } \seealso{ -\code{\link{Fritz}}, \code{\link{SKIRTOR}} +\code{\link[ProSpectData:Fritz]{Fritz}}, \code{\link[ProSpectData:SKIRTOR]{SKIRTOR}} } \examples{ \dontrun{ diff --git a/man/Dale_interp.Rd b/man/Dale_interp.Rd index 4af13dd..6dd2cef 100644 --- a/man/Dale_interp.Rd +++ b/man/Dale_interp.Rd @@ -19,14 +19,14 @@ Numeric scalar; desired interpolated alpha slope of the star forming population. Numeric scalar; desired interpolated AGN fraction linearly mixed in energy over the range 5-20 microns (see Dale 2014). } \item{type}{ -Character scalar; type of Dale template to interpolate. One of: Orig, Msol, NormTot, NormAGN, NormSFR (see \code{\link{Dale}}). +Character scalar; type of Dale template to interpolate. One of: Orig, Msol, NormTot, NormAGN, NormSFR (see \code{\link[ProSpectData:Dale]{Dale}}). } \item{Dale}{ -Pass in the Dale dust library directly. Must be one of \code{\link{Dale_Orig}}, \code{\link{Dale_Msol}}, \code{\link{Dale_NormTot}}, \code{\link{Dale_NormAGN}}, \code{\link{Dale_NormSFR}}. Doing this speeds up the compute time, since there is no need to lazy load from the package. +Pass in the Dale dust library directly. Must be one of \code{\link[ProSpectData:Dale_Orig]{Dale_Orig}}, \code{\link[ProSpectData:Dale_Msol]{Dale_Msol}}, \code{\link[ProSpectData:Dale_NormTot]{Dale_NormTot}}, \code{\link[ProSpectData:Dale_NormAGN]{Dale_NormAGN}}, \code{\link[ProSpectData:Dale_NormSFR]{Dale_NormSFR}}. Doing this speeds up the compute time, since there is no need to lazy load from the package. } } \details{ -This function does a simple 2D bilinear interpolation to create templates for values of \option{AGNfrac} and \option{alpha_SF} that are not precisely provided by \code{\link{Dale}}. +This function does a simple 2D bilinear interpolation to create templates for values of \option{AGNfrac} and \option{alpha_SF} that are not precisely provided by \code{\link[ProSpectData:Dale]{Dale}}. } \value{ Two column data.frame containing the wavelength (Wave) and the interpolated luminosity values (Aspec) in the same units as the input Dale dust library (from argument \option{Dale}). @@ -38,7 +38,7 @@ Dale et al, 2014, ApJ, 784, 11 Aaron Robotham } \seealso{ -\code{\link{Dale}}, \code{\link{interp_param}} +\code{\link[ProSpectData:Dale]{Dale}}, \code{\link{interp_param}} } \examples{ #Example output showing also the 4 surrounding interpolation points used. diff --git a/man/ProSpectSED.Rd b/man/ProSpectSED.Rd index 65b4ee6..b25e4e9 100644 --- a/man/ProSpectSED.Rd +++ b/man/ProSpectSED.Rd @@ -50,13 +50,13 @@ Numeric scalar; power to further raise the dust attenuation of the dust screen. Numeric scalar; power to further raise the dust attenuation of the AGN torus. See \code{\link{CF_screen}}. } \item{alpha_SF_birth}{ -Numeric scalar; alpha slope of the birth cloud dust. Lower values mean hotter dust. See \code{\link{Dale}}. +Numeric scalar; alpha slope of the birth cloud dust. Lower values mean hotter dust. See \code{\link[ProSpectData:Dale]{Dale}}. } \item{alpha_SF_screen}{ -Numeric scalar; alpha slope of the screen dust. Lower values mean hotter dust. See \code{\link{Dale}}. +Numeric scalar; alpha slope of the screen dust. Lower values mean hotter dust. See \code{\link[ProSpectData:Dale]{Dale}}. } \item{alpha_SF_AGN}{ -Numeric scalar; alpha slope of the AGN torus dust. Lower values mean hotter dust. See \code{\link{Dale}}. +Numeric scalar; alpha slope of the AGN torus dust. Lower values mean hotter dust. See \code{\link[ProSpectData:Dale]{Dale}}. } \item{AGNlum}{ Numeric scalar; AGN bolometric luminosity in erg/s for both the Fritz and SKIRTOR. @@ -65,13 +65,13 @@ Numeric scalar; AGN bolometric luminosity in erg/s for both the Fritz and SKIRTO Numeric scalar; amount of sparse sampling of the spectra to make. } \item{speclib}{ -Object; optional. Pass in the spectral library directly. Must be one of \code{\link{BC03lr}}, \code{\link{BC03hr}}, \code{\link{EMILES}} or \code{\link{BPASS}}. Default of NULL will load the \code{\link{BC03lr}} library, but faster to pass it in if being used for e.g. fitting. +Object; optional. Pass in the spectral library directly. Must be one of \code{\link[ProSpectData:BC03lr]{BC03lr}}, \code{\link[ProSpectData:BC03hr]{BC03hr}}, \code{\link[ProSpectData:EMILES]{EMILES}} or \code{\link[ProSpectData:BPASS]{BPASS}}. Default of NULL will load the \code{\link[ProSpectData:BC03lr]{BC03lr}} library, but faster to pass it in if being used for e.g. fitting. } \item{Dale}{ -Object or scalar logical; optional. Pass in the Dale dust library \code{\link{Dale_NormTot}} directly (otherwise will run, but not work correctly). Default of NULL will load the \code{\link{Dale_NormTot}} library, but faster to pass it in if being used for e.g. fitting. If FALSE it will not re-emit the attenuated light in the MIR/FIR using Dale templates. This might be desired if the range of interest is purely the UV-NIR and you want faster generation/fitting (since the re-emitted dust will not be notable until at least the MIR). +Object or scalar logical; optional. Pass in the Dale dust library \code{\link[ProSpectData:Dale_NormTot]{Dale_NormTot}} directly (otherwise will run, but not work correctly). Default of NULL will load the \code{\link[ProSpectData:Dale_NormTot]{Dale_NormTot}} library, but faster to pass it in if being used for e.g. fitting. If FALSE it will not re-emit the attenuated light in the MIR/FIR using Dale templates. This might be desired if the range of interest is purely the UV-NIR and you want faster generation/fitting (since the re-emitted dust will not be notable until at least the MIR). } \item{AGN}{ -Object; optional. Pass in the AGN template to use. Must be one of \code{\link{AGN_UnOb}}, \code{\link{AGN_UnOb_Sparse}}, \code{\link{Fritz}}, or \code{\link{SKIRTOR}}. These objects have classes attached, when ensures the correct AGN code is executed (so users should not simply try to load their own specific AGN model). +Object; optional. Pass in the AGN template to use. Must be one of \code{\link{AGN_UnOb}}, \code{\link{AGN_UnOb_Sparse}}, \code{\link[ProSpectData:Fritz]{Fritz}}, or \code{\link[ProSpectData:SKIRTOR]{SKIRTOR}}. These objects have classes attached, when ensures the correct AGN code is executed (so users should not simply try to load their own specific AGN model). } \item{filtout}{ @@ -81,7 +81,7 @@ Object; required. Pass in the photometric filters directly (either matrices of f Character vector; names of filters to use. See \code{\link{filters}} for options. Default 'all' selects all filters, 'GAMA' returns just the classic GAMA survey filters. Can also be a list of matrices or functions to pass into \code{\link{bandpass}}. This creates increasingly faster code, but requires more user effort. } \item{Dale_M2L_func}{ -Function; if dust masses and luminosities are desired then the user should supply a function to convert \option{alpha_SF} to mass-to-light, e.g. \code{\link{Dale_M2L_func}} +Function; if dust masses and luminosities are desired then the user should supply a function to convert \option{alpha_SF} to mass-to-light, e.g. \code{\link[ProSpectData:Dale_M2L_func]{Dale_M2L_func}} } \item{returnall}{ Logical; if true then returns all the various sub SEDs. See Details. If FALSE then code just returns \option{photom_out} (photometry in Jansky). @@ -99,7 +99,7 @@ Numeric scalar; Omega Lambda today (default is for a flat Universe with OmegaL = Numeric vector; desired output log10 wavelength grid to use in Ang. Default covers typical range of galaxy SED data at a resolution good enough for broad band photometry. Spectroscopic work requires the resolution to be increase by a factor ~10. If \option{emission}=TRUE (to be passed down to \code{\link{SFHfunc}}) and \option{waveout} is missing (so not explicitly supplied by the user) then \option{waveout} is internally set to NULL, meaning the full available resolution is used to ensure a good reproduction of the emission features. This operation is generally desirable, since it would be a bad idea to produce emission features, but then sample the wavelength range too coarsely to see any! } \item{ref}{ -The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See \code{\link{cosref}} for details. +The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See \code{\link[celestial:cosref]{cosref}} for details. } \item{unimax}{ Numeric scalar; maximum allowed age of any stellar population relative to z=0 (i.e. today) in years. Any star formation that is older than this will be set to 0. Overridden by \option{agemax} if that is provided. @@ -111,7 +111,7 @@ Numeric scalar; maximum allowed age of any stellar population relative to the re Numeric scalar; Luminosity distance computed in units of cm. Default is NULL. The luminosity distance can be supplied for repeated computations when the redshift of the object is constant. This should be supplied using the "correct" cosmology (as near as possible), i.e. using H0 ~ 70 km/s/Mpc (not 100). } \item{addradio_SF}{ -Logical scalar; should free-free and synchrotron radio continuum linked to star-formation be computed and appended to the spectrum? If TRUE, emission range is controlled by \option{waveout}. Uses the \code{\link{radiocont}} function to compute and append the radio continuum (see there for details). Note that even with this set to FALSE (default) the output spectrum will still have the radio continuum computed for the \code{\link{Dale}} templates. The default arguments almost perfectly reproduce the \code{\link{Dale}} results, so it is only necessary to set \option{addradio_SF} = TRUE if you want to change the \option{Te}, \option{ff_frac}, \option{ff_power} and \option{sy_power} parameters to non-default values. +Logical scalar; should free-free and synchrotron radio continuum linked to star-formation be computed and appended to the spectrum? If TRUE, emission range is controlled by \option{waveout}. Uses the \code{\link{radiocont}} function to compute and append the radio continuum (see there for details). Note that even with this set to FALSE (default) the output spectrum will still have the radio continuum computed for the \code{\link[ProSpectData:Dale]{Dale}} templates. The default arguments almost perfectly reproduce the \code{\link[ProSpectData:Dale]{Dale}} results, so it is only necessary to set \option{addradio_SF} = TRUE if you want to change the \option{Te}, \option{ff_frac}, \option{ff_power} and \option{sy_power} parameters to non-default values. } \item{Te_SF}{ Numeric scalar; effective HII nebular plasma temperature in Kelvin used in \code{\link{radiocont}}. Leave as the default (10,000 K), unless you know what you are doing. @@ -126,7 +126,7 @@ Numeric scalar; power-law slope of the free-free nebular plasma thermal radio em Numeric scalar; power-law slope of the synchrotron radio emission associated with star-formation used in \code{\link{radiocont}} (should be between -0.8 and -0.6 typically). } \item{addradio_AGN}{ -Logical; should separate free-free and synchrotron radio continuum associated with an AGN be added? Uses the \code{\link{radiocont}} function to compute and append the radio continuum (see there for details). If FALSE (default) then any radio continuum computed for the AGN component within \code{\link{Dale}} will be subtracted regardless of the value of \option{addradio_SF}. +Logical; should separate free-free and synchrotron radio continuum associated with an AGN be added? Uses the \code{\link{radiocont}} function to compute and append the radio continuum (see there for details). If FALSE (default) then any radio continuum computed for the AGN component within \code{\link[ProSpectData:Dale]{Dale}} will be subtracted regardless of the value of \option{addradio_SF}. } \item{Te_AGN}{ Numeric scalar; effective HII nebular plasma temperature in Kelvin used in \code{\link{radiocont}} for the AGN component. Leave as the default (10,000 K), unless you know what you are doing. @@ -216,7 +216,7 @@ List, optional; named arguments and values that are passed directly into \code{P There are also additional arguments for redshift fitting mode: 'photoz', Boolean, fit for redshift or not; 'IGMfunc', a function that takes in z and returns IGM absorption between 0 and 1, can also be numeric/NULL/'Inoue14', if numeric this is the same as function(z)\{const\} where const is some constant IGM absorption value, if NULL no IGM absorption, if "Songaila04" use pnorm(z,3.2,1.8), if 'Inoue14' use IGM absorption from Inoue (2014); z_genSF, numeric scalar, redshift at which stars began forming, if NULL then stars start forming at the beginning of the Universe. } \item{Data$speclib}{ -List, optional but recommended; pass in the spectral library directly. Must be one of \code{\link{BC03lr}}, \code{\link{BC03hr}}, \code{\link{EMILES}}. +List, optional but recommended; pass in the spectral library directly. Must be one of \code{\link[ProSpectData:BC03lr]{BC03lr}}, \code{\link[ProSpectData:BC03hr]{BC03hr}}, \code{\link[ProSpectData:EMILES]{EMILES}}. } \item{Data$Dale}{ List, optional but recommended; pass in the Dale dust library directly (should be one of \option{Dale_NormTot}, \option{Dale_NormSFR} otherwise will run, but not work correctly). If set to FALSE then there will be no FIR re-emission. diff --git a/man/SFH.Rd b/man/SFH.Rd index 36349d4..c9433ed 100644 --- a/man/SFH.Rd +++ b/man/SFH.Rd @@ -67,10 +67,10 @@ Logical or numeric scalar; if FALSE then the stellar mass is directly computed f Numeric scalar; scaling to apply to the ages (which will passed in years) to \option{massfunc}. E.g. if left at \option{agescale}=1 then \option{massfunc} is expecting the age in years, but if set to 1e-6/1e-9 then \option{massfunc} is expecting the age in Myrs/Gyrs. } \item{stellpop}{ -Character scalar; which stellar population library to use, one of \code{\link{BC03lr}} (default), \code{\link{BC03hr}}, \code{\link{EMILES}}. +Character scalar; which stellar population library to use, one of \code{\link[ProSpectData:BC03lr]{BC03lr}} (default), \code{\link[ProSpectData:BC03hr]{BC03hr}}, \code{\link[ProSpectData:EMILES]{EMILES}}. } \item{speclib}{ -Pass in the spectral library directly. Must be one of \code{\link{BC03lr}}, \code{\link{BC03hr}}, \code{\link{EMILES}}. Doing this speeds up the compute time, since there is no need to lazy load from the package. +Pass in the spectral library directly. Must be one of \code{\link[ProSpectData:BC03lr]{BC03lr}}, \code{\link[ProSpectData:BC03hr]{BC03hr}}, \code{\link[ProSpectData:EMILES]{EMILES}}. Doing this speeds up the compute time, since there is no need to lazy load from the package. } \item{tau_birth}{ Numeric scalar; dust tau of birth clouds. Associated with sub 10 Myr star formation. See \code{\link{CF_birth}}. @@ -88,7 +88,7 @@ Numeric scalar; power to further raise the dust attenuation of the dust screen. Character vector; names of filters to use. See \code{\link{filters}} for options. Default 'all' selects all filters, 'GAMA' returns just the classic GAMA survey filters. Can also be a list of matrices or functions to pass into \code{\link{bandpass}}. This creates increasingly faster code, but requires more user effort. Setting to NULL will not process the spectrum through filters at all, which is useful if you just want some of the other output which are quicker to produce. } \item{Z}{ -Numeric integer/scalar (\code{SFHfunc}, \code{SFHburst}), or a function (\code{SFHfunc}); specifies which metallicity to use for each star formation phase. If integer \option{Z} is the vector location \option{Z} in BC03lr$Z / BC03hr$Z / EMILES$Z., i.e. the index 5 for BC03lr is solar (BC03lr$Z[5]=0.02). For \code{SFHfunc} the functional form takes age as an input (in units of \option{agescale}) and outputs the target metallicity in terms of Z (so 0.02 for solar). \option{Z} function arguments can be passed down via the \dots (useful for fitting), so be careful to give additional arguments unique names compared to \code{SFHfunc}. For convenience, if a non-integer value is provided then this is interpreted as the desired metallicity value (so Z=0.02 for solar etc), and converted into the appropriate function internally, e.g. \option{Z}=5 and \option{Z}=0.02 will give the same outputs for \code{\link{BC03}}. Now we are using a wider variety of SPLs and SSPs, \option{Z} = 0.02 is the default (so output should be close to solar). +Numeric integer/scalar (\code{SFHfunc}, \code{SFHburst}), or a function (\code{SFHfunc}); specifies which metallicity to use for each star formation phase. If integer \option{Z} is the vector location \option{Z} in BC03lr$Z / BC03hr$Z / EMILES$Z., i.e. the index 5 for BC03lr is solar (BC03lr$Z[5]=0.02). For \code{SFHfunc} the functional form takes age as an input (in units of \option{agescale}) and outputs the target metallicity in terms of Z (so 0.02 for solar). \option{Z} function arguments can be passed down via the \dots (useful for fitting), so be careful to give additional arguments unique names compared to \code{SFHfunc}. For convenience, if a non-integer value is provided then this is interpreted as the desired metallicity value (so Z=0.02 for solar etc), and converted into the appropriate function internally, e.g. \option{Z}=5 and \option{Z}=0.02 will give the same outputs for \code{\link[ProSpectData:BC03]{BC03}}. Now we are using a wider variety of SPLs and SSPs, \option{Z} = 0.02 is the default (so output should be close to solar). } \item{emission}{ Logical; should emission features be added to the spectrum? This will be done using \code{\link{emissionLines}}. @@ -133,7 +133,7 @@ Numeric scalar; Omega Matter today (default is 0.308). Numeric scalar; Omega Lambda today (default is for a flat Universe with OmegaL = 1 - OmegaM = 0.692). } \item{ref}{ -The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See \code{\link{cosref}} for details. +The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See \code{\link[celestial:cosref]{cosref}} for details. } \item{unimax}{ Numeric scalar; maximum allowed age in years of any stellar population relative to z=0 (i.e. today). Any star formation that is older than this will be set to 0. Overridden by \option{agemax} if that is provided. @@ -209,7 +209,7 @@ Aaron Robotham } \seealso{ -\code{\link{ProSpectSED}}, \code{\link{photom}}, \code{\link{BC03lr}}, \code{\link{BC03hr}}, \code{\link{EMILES}}, \code{\link{massfunc}}, \code{\link{emissionLines}} +\code{\link{ProSpectSED}}, \code{\link{photom}}, \code{\link[ProSpectData:BC03lr]{BC03lr}}, \code{\link[ProSpectData:BC03hr]{BC03hr}}, \code{\link[ProSpectData:EMILES]{EMILES}}, \code{\link{massfunc}}, \code{\link{emissionLines}} } \examples{ #A pretty full example showing some low level things: diff --git a/man/dust.Rd b/man/dust.Rd index e8ee87f..3cf9dbc 100644 --- a/man/dust.Rd +++ b/man/dust.Rd @@ -59,7 +59,7 @@ Numeric scalar; desired interpolated alpha slope of the star forming population. Pass in the Dale dust library directly (should be one of \option{Dale_NormTot}, \option{Dale_NormSFR}). } \item{Dale_M2L_func}{ -Function; if dust masses are desired then the user should supply a function to convert \option{alpha_SF} to mass-to-light, e.g. \code{\link{Dale_M2L_func}} +Function; if dust masses are desired then the user should supply a function to convert \option{alpha_SF} to mass-to-light, e.g. \code{\link[ProSpectData:Dale_M2L_func]{Dale_M2L_func}} } \item{waveout}{ Numeric vector; desired output wavelength grid to use for adding together spectra. See \code{\link{addspec}}. diff --git a/man/dustmass.Rd b/man/dustmass.Rd index ede64e6..de815b6 100644 --- a/man/dustmass.Rd +++ b/man/dustmass.Rd @@ -25,7 +25,7 @@ Numeric vector; predicted attenuated stellar luminosity in units Lsol / Ang (for Numeric vector; observed dust wavelength in Angstroms (same number of elements as \option{lum_dust}). } \item{lum_dust}{ -Numeric vector; observed luminosity in units Lsol / Ang (for 1 Msol of dust), as per \code{\link{blackbody}}, \code{\link{greybody}} and \code{\link{Dale_Msol}}. +Numeric vector; observed luminosity in units Lsol / Ang (for 1 Msol of dust), as per \code{\link{blackbody}}, \code{\link{greybody}} and \code{\link[ProSpectData:Dale_Msol]{Dale_Msol}}. } } \details{ @@ -39,7 +39,7 @@ Aaron Robotham } \seealso{ -\code{\link{blackbody}}, \code{\link{greybody}}, \code{\link{Dale_Msol}} +\code{\link{blackbody}}, \code{\link{greybody}}, \code{\link[ProSpectData:Dale_Msol]{Dale_Msol}} } \examples{ #Let's try varying our burst mass and seeing what happen to various outputs: diff --git a/man/filterTranMags.Rd b/man/filterTranMags.Rd index a33bfa9..a73db2b 100644 --- a/man/filterTranMags.Rd +++ b/man/filterTranMags.Rd @@ -53,7 +53,7 @@ Aaron Robotham } \seealso{ -\code{\link{ProFiltTrans}}, \code{\link{getfilt}}, \code{\link{EAZY_filters}}, \code{\link{runShinySED}} +\code{\link[ProSpectData:ProFiltTrans]{ProFiltTrans}}, \code{\link{getfilt}}, \code{\link{EAZY_filters}}, \code{\link{runShinySED}} } \examples{ \dontrun{ diff --git a/man/greybody.Rd b/man/greybody.Rd index fcaa2f9..67adf2a 100644 --- a/man/greybody.Rd +++ b/man/greybody.Rd @@ -55,7 +55,7 @@ Aaron Robotham } \seealso{ -\code{\link{dust}}, \code{\link{Dale}} +\code{\link{dust}}, \code{\link[ProSpectData:Dale]{Dale}} } \examples{ #The greybody_norm function can take vector inputs: diff --git a/man/interp_param.Rd b/man/interp_param.Rd index 18b512c..3fdf173 100644 --- a/man/interp_param.Rd +++ b/man/interp_param.Rd @@ -24,7 +24,7 @@ Numeric vector; the values to be interpolated. Logical scalar; should the interpolation be done in linear space (\option{log}=FALSE, the default), or log space (\option{log}=TRUE). } \item{method}{ -One of “constant", “linear", “nearest", “spline", or “cubic"; default is “linear". This is passed to \code{\link{interp1}}. +One of “constant", “linear", “nearest", “spline", or “cubic"; default is “linear". This is passed to \code{\link[pracma:interp1]{interp1}}. } } \details{ diff --git a/man/kcorr.Rd b/man/kcorr.Rd index 0208f8b..09b3584 100644 --- a/man/kcorr.Rd +++ b/man/kcorr.Rd @@ -107,7 +107,7 @@ This version of the D-correction can only create more flux in AbsMag_unatten com \code{Vmax_hunt} returns a list with: \item{z_range}{Numeric vector; lower and upper redshift bounds. The lower comes from the specified input argument, the upper limit will have been updated during the internal Vmax optimisation process when calcuting at what redshift the ProSpect SED hits the \option{ApMag_lim} given the target filter} -\item{Vmax}{Numeric vector; the output of \code{\link{cosvol}} computed based on the combination of the lower/upper limit of \option{z_range} and the \option{area} for the specified cosmology. This is a 3 element vector. The first element (voltot) specifies the comoving volume of the requested cone segment in Gpc^3, the second element (volmeanz) specifies the mean redshift when mass is uniformly distributed in the volume, the third element (volmedz) specifies the median redshift when mass is uniformly distributed in the volume.} +\item{Vmax}{Numeric vector; the output of \code{\link[celestial:cosvol]{cosvol}} computed based on the combination of the lower/upper limit of \option{z_range} and the \option{area} for the specified cosmology. This is a 3 element vector. The first element (voltot) specifies the comoving volume of the requested cone segment in Gpc^3, the second element (volmeanz) specifies the mean redshift when mass is uniformly distributed in the volume, the third element (volmedz) specifies the median redshift when mass is uniformly distributed in the volume.} \code{Dcorr} returns a list with: diff --git a/man/photom.Rd b/man/photom.Rd index d272b51..8515b8e 100644 --- a/man/photom.Rd +++ b/man/photom.Rd @@ -53,7 +53,7 @@ Numeric scalar; Omega Matter today (default is 0.3). Numeric scalar; Omega Lambda today (default is for a flat Universe with OmegaL = 1-OmegaM-OmegaR = 0.7). } \item{ref}{ -The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See \code{\link{cosref}} for details. +The name of a reference cosmology to use, one of 137 / 737 / Planck / Planck13 / Planck15 / Planck18 / WMAP / WMAP9 / WMAP7 / WMAP5 / WMAP3 / WMAP1 / Millennium / GiggleZ. Planck = Planck18 and WMAP = WMAP9. The usage is case insensitive, so wmap9 is an allowed input. This overrides any other settings for H0, OmegaM and OmegaL. If OmegaR is missing from the reference set then it is inherited from the function input (0 by default). See \code{\link[celestial:cosref]{cosref}} for details. } \item{LumDist_Mpc}{ Numeric scalar; Luminosity distance computed in units of cm. Default is NULL. The luminosity distance can be supplied for repeated computations when the redshift of the object is constant. This should be supplied using the "correct" cosmology (as near as possible), i.e. using H0 ~ 70 km/s/Mpc (not 100). diff --git a/man/radiocont.Rd b/man/radiocont.Rd index 4a7cd56..35d5b6d 100644 --- a/man/radiocont.Rd +++ b/man/radiocont.Rd @@ -66,7 +66,7 @@ Marvil et al, 2015, AJ, 149, 32 Aaron Robotham } \seealso{ -\code{\link{Dale}} +\code{\link[ProSpectData:Dale]{Dale}} } \examples{ data('BC03lr') diff --git a/man/runShinySED.Rd b/man/runShinySED.Rd index 6d51027..57f97d7 100644 --- a/man/runShinySED.Rd +++ b/man/runShinySED.Rd @@ -51,13 +51,13 @@ Numeric scalar; dust tau of the dust screen. See \code{\link{CF_screen}}. Numeric scalar; dust tau of the dust screen. See \code{\link{CF}}. } \item{alpha_SF_birth}{ -Numeric scalar; alpha slope of the birth cloud dust. Lower values mean hotter dust. See \code{\link{Dale}}. +Numeric scalar; alpha slope of the birth cloud dust. Lower values mean hotter dust. See \code{\link[ProSpectData:Dale]{Dale}}. } \item{alpha_SF_screen}{ -Numeric scalar; alpha slope of the screen dust. Lower values mean hotter dust. See \code{\link{Dale}}. +Numeric scalar; alpha slope of the screen dust. Lower values mean hotter dust. See \code{\link[ProSpectData:Dale]{Dale}}. } \item{alpha_SF_AGN}{ -Numeric scalar; alpha slope of the AGN taurus dust. Lower values mean hotter dust. See \code{\link{Dale}}. +Numeric scalar; alpha slope of the AGN taurus dust. Lower values mean hotter dust. See \code{\link[ProSpectData:Dale]{Dale}}. } \item{AGNlum}{ Numeric scalar; AGN bolometric luminosity in erg. diff --git a/man/speclib_download.Rd b/man/speclib_download.Rd index 3e93734..8d7c5a8 100644 --- a/man/speclib_download.Rd +++ b/man/speclib_download.Rd @@ -52,14 +52,14 @@ Logical; should the coverage (Z, Age, Wave) of \option{speclib} be checked? If T \details{ This interface has proven necessary in order to provide flexible SSPs without making the core package too big. We have also had issue with the package getting close to the file size limit of GitHub. In future all additional SSP will be provided through this mechanism. -Internally a \code{ProSpect} compatible format (e.g. as seen for \code{\link{BC03}} / \code{\link{EMILES}} / \code{\link{BPASS}}, as output by \code{speclib_FITSload}, and as verified with \code{speclib_check}) looks like a list containing: +Internally a \code{ProSpect} compatible format (e.g. as seen for \code{\link[ProSpectData:BC03]{BC03}} / \code{\link[ProSpectData:EMILES]{EMILES}} / \code{\link[ProSpectData:BPASS]{BPASS}}, as output by \code{speclib_FITSload}, and as verified with \code{speclib_check}) looks like a list containing: Z: Numeric vector of available template metallicities (ascending order). \cr Age: Numeric vector of available template ages in Yrs (ascending order). \cr AgeBins: Numeric vector of available template age bin limits in Yrs (ascending order, must be 1 longer than "Age" vector to cover lower and upper limits). \cr AgeWeights: Numeric vector of available template age weights (bin sizes) in Yrs (same length as "Age"). \cr Wave: Numeric vector of spectral wavelength in Angstroms (ascending order). \cr -Labels: List of the labels required for plotting (see \code{\link{BC03}}). \cr +Labels: List of the labels required for plotting (see \code{\link[ProSpectData:BC03]{BC03}}). \cr Zspec: List containing the spectra in units Lsun / Ang (for 1 Msun SF). The list must correspond to the 'Z' vector metallicities. Each list item is a numeric matrix of spectra with Nrow equal to the number of age bins (corresponding with 'Age') and Ncol the number of wavelength element (corresponding with 'Wave'). \cr Zevo: List containing the mean evolutionary tracks of the SSPs (as determined by the route isochrones). The list must correspond to the 'Z' vector metallicities. Each list item is a data.frame with columns 'SMstar' (fraction of mass in luminous stars) 'SMgas' (fraction of mass in gas) 'SMtot' (fraction of total mass, always 1 in practice) 'SFR' (star formation rate, always 0 in practice) 'SMrem' (fraction of mass in stellar remnants, e.g. black holes etc). Nrow should be equal to the number of age bins (corresponding with 'Age').