.. _MERPhotometryCookbook: MER Photometry Cookbook ======================= Introduction ____________ The MER :term:`Pipeline` performs four kinds of photometric measurements: - Aperture photometry, using A-PHOT (`Merlin et al. 2019 `_); - Template-fitting photometry, using T-PHOT (`Merlin et al. 2015 `_, `2016 `_); - Model-fitting photometry, using SourceXtractor++ and a Sersic model applied to all photometric bands (`Kuemmel et al. 2022 `_); - PSF fitting photometry in the VIS band. Sources are detected in the VIS :ref:`detection mosaic ` and in a NIR-stack :ref:`detection mosaic ` (the VIS detection has the priority). The ``VIS_DET`` column in the :ref:`MER final catalog ` provides the information about the provenance of each source. The scope of this cookbook is to give the user a quick overview on how to use the photometric information stored in the :ref:`MER final catalog `. Main information from the MER final catalog ___________________________________________ The :ref:`MER final catalog ` provides the following information: * ``FLUX_DETECTION_TOTAL``: flux measured within a Kron aperture in the :ref:`detection mosaic ` (VIS mosaic or NIR-stack mosaic, as indicated by the ``VIS_DET`` flag). It corresponds to the good old ``FLUX_AUTO`` in SExtractor. * ``FLUX SEGMENTATION``: flux within the segmented pixels of a source (``FLUX_ISO`` in SExtractor). * ``FLUX__nFWHM_APER``: these are fluxes measured in fixed circular apertures on images PSF-matched to the one with the worst resolution (typically EXT u). The apertures have a diameter of n FWHM of the worst band PSF, with n=1,2,3,4, and they are computed individually source by source (because the PSF varies across the FoV). The ``FWHM`` column lists the value in arcseconds used for each source. * ``FLUX__TEMPLFIT``: fluxes from template-fitting run on the given band. * ``FLUX_VIS_TO__TEMPLFIT``: fluxes from template-fitting run on the VIS image smoothed to the resolution of the given band. This is only useful to compute colors from template-fitting. * ``FLUX__SERSIC``: fluxes from model-fitting (single Sersic models) obtained using SourceXtractor++. * ``FLUX_VIS_PSF``: fluxes from PSF-fitting on VIS only. For all these flux estimates, the corresponding uncertainties are given in the columns named ``FLUXERR_*``. All fluxes in the :ref:`MER final catalog ` are in :math:`{\mu}Jy`. Photometry flags ________________ The reference photometic measurement is given by the ``FLUX_DETECTION_TOTAL`` column. It contains the flux measured within a Kron aperture in the :ref:`detection mosaic `. To assess the reliability of ``FLUX_DETECTION_TOTAL``, we provide a binary flag, ``DET_QUALITY_FLAG``, that encodes the following information: +---------+---------+------------------------------------------------------------------------+ | Bit set | Integer | Descriptiom | +=========+=========+========================================================================+ | 1 | 1 | Source contaminated by close neighbors or has bad pixels | +---------+---------+------------------------------------------------------------------------+ | 2 | 2 | Source blended with another one (must comply with ``PARENT_ID`` ≠ -1) | +---------+---------+------------------------------------------------------------------------+ | 3 | 4 | Source saturated | +---------+---------+------------------------------------------------------------------------+ | 4 | 8 | Source close to a border | +---------+---------+------------------------------------------------------------------------+ | 8 | 128 | Source within the VIS bright star mask | +---------+---------+------------------------------------------------------------------------+ | 9 | 256 | Source within the NIR bright star mask | +---------+---------+------------------------------------------------------------------------+ | 10 | 512 | Source within an extended object area | +---------+---------+------------------------------------------------------------------------+ | 11 | 1024 | Source skipped by the deblending algorithm due to large pixel size | +---------+---------+------------------------------------------------------------------------+ Note that ``DET_QUALITY_FLAG`` contains more information than the single-band flags, ``FLAG_`` (e.g ``FLAG_VIS``, ``FLAG_Y``, ``FLAG_G_EXT_DECAM``), that only use bits from 1 to 4: +---------+---------+------------------------------------------------------------------------+ | Bit set | Integer | Descriptiom | +=========+=========+========================================================================+ | 1 | 1 | Source contaminated by closer neighbors or has bad pixels | +---------+---------+------------------------------------------------------------------------+ | 2 | 2 | Source blended with another one (must comply with ``PARENT_ID`` ≠ -1) | +---------+---------+------------------------------------------------------------------------+ | 3 | 4 | Source saturated | +---------+---------+------------------------------------------------------------------------+ | 4 | 8 | Source close to a border | +---------+---------+------------------------------------------------------------------------+ How to get the photometry you need? ___________________________________ Colors ^^^^^^ Colors can be obtained in three ways: * Using aperture photometry: e.g. .. math:: :label: phot_cookbook_equ_1 \textrm{H} - \textrm{g} = -2.5 \times \log_{10}\left(\frac{\textrm{FLUX_H_nFWHM_APER}}{\textrm{FLUX_g_nFWHM_APER}}\right) This is a color obtained with fixed apertures on PSF-matched images. * Using template fitting, with VIS only: e.g. .. math:: :label: phot_cookbook_equ_2 \textrm{H} - \textrm{VIS} = -2.5 \times \log_{10}\left(\frac{\textrm{FLUX_H_TEMPLFIT}}{\textrm{FLUX_VIS_TO_H_TEMPLFIT}}\right) This is a color obtained with VIS smoothed to the relevant band. * Using model fitting: e.g. .. math:: :label: phot_cookbook_equ_3 \textrm{g} - \textrm{J} = -2.5 \times \log_{10}\left(\frac{\textrm{FLUX_g_SERSIC}}{\textrm{FLUX_J_SERSIC}}\right) This is a color between two total fluxes estimated via model fitting. Total fluxes ^^^^^^^^^^^^ In the detection band, ``FLUX_DETECTION_TOTAL`` is the best estimate of the total flux of the source. This is the VIS Kron flux for the VIS detected sources, i.e. ``VIS_DET`` = 1 and a (non-physical) NIR-stack flux for NIR detected sources. In all other bands, there is the possibility is to scale the detection flux with a color term: - Using aperture photometry: total fluxes are obtained by scaling ``FLUX_DETECTION_TOTAL`` with the aperture color between the relevant band and the detection band (both PSF-matched to the worst resolution); e.g. .. math:: :label: phot_cookbook_equ_4 F_{\textrm{H, tot}} = \textrm{FLUX_DETECTION_TOTAL} \times \frac{\textrm{FLUX_H_nFWHM_APER}}{\textrm{FLUX_VIS_nFWHM_APER}} if the source is detected in VIS (i.e. has ``VIS_DET`` = 1), and .. math:: :label: phot_cookbook_equ_5 F_{\textrm{H, tot}} = \textrm{FLUX_DETECTION_TOTAL} \times \frac{\textrm{FLUX_H_nFWHM_APER}}{\textrm{FLUX_NIR_STACK_nFWHM_APER}} if the source is detected in the NIR-stack (i.e. has ``VIS_DET`` = 0). - Using template fitting: by color-correcting the detection flux. In this case the relevant column is ``VIS_TO_`` (because here VIS is smoothed to the relevant band); e.g. .. math:: :label: phot_cookbook_equ_6 F_{\textrm{H, tot}} = \textrm{FLUX_DETECTION_TOTAL} \times \frac{\textrm{FLUX_H_TEMPLFIT}}{\textrm{FLUX_VIS_TO_H_TEMPLFIT}} Alternatively, ``FLUX__TEMPLFIT`` can be taken directly as a total flux, especially for EXT bands. Finally, also ``FLUX__SERSIC`` columns provide total flux estimates from the model fitting. Magnitudes ^^^^^^^^^^ As fluxes are in :math:`{\mu}Jy`, the Zero Point to get AB magnitudes out of (above) fluxes is ZP = 23.9 in all bands: .. math:: :label: phot_cookbook_equ_7 m_{\textrm{AB}} = -2.5 \times \log_{10}\left(\textrm{flux}_{{\mu}Jy}\right) + 23.9