A utility function to construct a ProFit
legal sigma map that can be input to profitSetupData
.
profoundMakeSigma(image = NULL, objects = NULL, sky = 0, skyRMS = 0, readRMS = 0,
darkRMS = 0, skycut = 0, gain = 1, image_units = 'ADU', sky_units = 'ADU',
read_units = 'ADU', dark_units = 'ADU', output_units = 'ADU', plot = FALSE, ...)
Numeric matrix; required, the image we want to analyse.
Boolean matrix; optional, object mask where 1 is object and 0 is sky. Pixels set to 0 are interpreted as sky, and set to zero for calculating object shot-noise. If provided, this matrix *must* be the same dimensions as image.
Numeric; the absolute sky level. Consider using the sky output from profoundSkyEst
or profoundMakeSkyGrid
. Can be a scalar (value uniformly applied to full sigma map) or a matrix matching the dimensions of image (allows values to vary per pixel). This will be subtracted off the image internally, so only provide this if the sky does need to be subtracted!
Numeric; the RMS of the sky. Consider using the skyRMS output from profoundSkyEst
or profoundMakeSkyGrid
. Can be a scalar (value uniformly applied to full sigma map) or a matrix matching the dimensions of image (allows values to vary per pixel).
Numeric; the RMS of the read-noise. If you have estimated the sky RMS from the image directly this should not be necessary since it naturally captures this component. Can be a scalar (value uniformly applied to full sigma map) or a matrix matching the dimensions of image (allows values to vary per pixel).
Numeric; the RMS of the dark-current-noise. If you have estimated the sky RMS from the image directly this should not be necessary since it naturally captures this component. Can be a scalar (value uniformly applied to full sigma map) or a matrix matching the dimensions of image (allows values to vary per pixel).
How many multiples of skyRMS above the sky to start calculating shot-noise based on the gain scaling of the image. If you are missing an object mask You almost certainly do not want this to be below 0 (else you will reduce the level of the sigma map just due to fluctuations in the sky), and in practice this should probably be set in the range 1-3.
Numeric; the gain (in photo-electrons per ADU). For a very rough estimate consider using the gain output from profoundGainEst
. Can be a scalar (value uniformly applied to full sigma map) or a matrix matching the dimensions of image (allows values to vary per pixel).
Character; the units of the image. Must either be 'ADU' for generic astronomical data units, or 'elec' for photo-electrons.
Character; the units of sky and skyRMS. Must either be 'ADU' for generic astronomical data units (the same type and scaling as per image), or 'elec' for photo-electrons.
Character; the units of read. Must either be 'ADU' for generic astronomical data units (the same type and scaling as per image), or 'elec' for photo-electrons.
Character; the units of dark. Must either be 'ADU' for generic astronomical data units (the same type and scaling as per image), or 'elec' for photo-electrons.
Character; the units of the output sigma map. Must either be 'ADU' for generic astronomical data units (the same type and scaling as per image), or 'elec' for photo-electrons.
Logical; should a magimage
plot of the output be generated?
Further arguments to be passed to magimage
. Only relevant is plot=TRUE.
Numeric matrix; a sigma map the same size as image. This should be appropriate for feeding into profitSetupData
.
This is a simple utility function, but useful for beginners if they are unsure of how the error terms should be propagated (in short: in quadrature).
# NOT RUN {
image=readFITS(system.file("extdata", 'VIKING/mystery_VIKING_Z.fits',
package="ProFound"))
profound=profoundProFound(image)
sigma_est=profoundMakeSigma(image$imDat, objects=profound$objects, sky=profound$sky,
skyRMS=profound$skyRMS)
# }
Run the code above in your browser using DataLab