filterTran | R Documentation |
High and low level interface to achieving colour and simple offset filter conversions. These functions can work on simulated or observed data.
filterTranMags(mag_in, mag_out, return = 'all')
filterTranBands(filt_in, filt_out, zrange = c(0,0.5), Nsamp = 1e3, seed = 666,
return = 'all')
mag_in |
Numeric matrix, data.frame or vector; columns should be observed magnitudes from bluest (LHS) to reddest (RHS). If mag_in is a vector then only the offset beta is computed, not colour terms, i.e. mag_out ~ mag_in + beta. |
mag_out |
Numeric vector; magnitudes of target filter to map. |
return |
Character scalar; either 'all' (returning all fit combinations); 'bestalpha' (returning just the best in terms of alpha, where smallest alpha term is preferred); 'bestbeta' (returning just the best in terms of beta, where smallest beta term is preferred); 'bestscat' (returning just the best in terms of scatter, where smallest scat term is preferred); 'bestall' (returning the best for all terms, where the smallest sum of 2.alpha^2 + beta^2 + scat^2 is preferred). |
filt_in |
List of functions; filters to be used to calculate filter conversions. In general these should at least be near each other in wavelength. If only one filter function is provided then only the beta offset is computed, i.e. filt_out ~ filt_in + beta. |
filt_out |
Function; filter to be targetted for filter conversions. |
zrange |
Numeric vector; length=2, specifying the lower and upper limits of the redshift range to sample. |
Nsamp |
Integer scalar; number of sample to make. |
seed |
Integer scalar; random seed to use for sampling. |
These functions are used to find filter conversions.
filterTranMags
returns the functional mappings for all sensible combinations of mag_in. This will create a mapping based on a filter mag, colour term and offset. If mag_in is a vector then only the offset is calculated (it is not possible to compute a colour term), i.e. mag_out ~ mag_in + beta. In all cases the scatter around the best solution is also provided (scat). In general smaller scatter is better, but sometimes it is better to have a smaller alpha since colour noise can be the dominant error.
filterTranBands
returns the functional mappings, but it also does the SFH sampling to create the magnitude inputs for filterTranMags
. This means it is the higher level function, and will likely be how most people do the filter transformations.
Aaron Robotham
ProFiltTrans
, getfilt
, EAZY_filters
, runShinySED
## Not run:
#Using filterTranBands
filters = c('g_SDSS', 'r_SDSS', 'i_SDSS')
filt_in = {}
for(i in filters){filt_in=c(filt_in,list(approxfun(getfilt(i))))}
names(filt_in) = filters
filt_out = approxfun(getfilt('r_VST'))
filterTranBands(filt_in, filt_out)
#Using filterTranMags with Shark SFH samples:
data(ProFiltTrans_Shark)
filterTranMags(ProFiltTrans_Shark$maglist$Age3[,c("g_SDSS", "r_SDSS", "i_SDSS")],
ProFiltTrans_Shark$maglist$Age3[,"r_VST"])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.