Prepare Photometry
Source:vignettes/preparing-psf-matched-photometry.Rmd
preparing-psf-matched-photometry.RmdSagui expects a numeric array with dimensions
[x, y, band], or a FITS-like list with that array in
imDat. Before segmentation, every band should refer to the
same sky footprint and effective angular resolution.
Required checks
- Register every image to one pixel grid and WCS.
- Match all bands to a declared target PSF.
- Convert fluxes and uncertainties to compatible units.
- Keep the band order and effective wavelengths together.
- Record missing-data and foreground-mask conventions.
Sagui does not perform image registration or PSF matching.
Assemble the cube
band_files <- c("F090W.fits", "F150W.fits", "F200W.fits", "F356W.fits")
bands <- c(0.90, 1.50, 2.00, 3.56)
planes <- lapply(band_files, function(path) FITSio::readFITS(path)$imDat)
stopifnot(length(unique(lapply(planes, dim))) == 1L)
cube <- simplify2array(planes)Apply the same geometric operations to the variance planes. Measure fluxes from the calibrated images, not display stretches.