Magnitude zeropoint, reading catalog

Magnitude zeropoint in hscpipe7

In case of hscpipe6 or earlier, FLUXMAG0 is in the header of 1st HDU. In case of hscpipe7, magnitude zeropoint is moved to the data column of later HDU and it is not straightforward to extract.

Here we obtain FLUXMAG0 with hscpipe API.

※ It may be easier than to do with astropy.

#setup hscPipe7
setup-hscpipe

#Launch python
python

# load python module for image
>>> import lsst.afw.image as afwImage

#calcurate FLUXMAG0
>>> exp = afwImage.ExposureF(filepath_to_CORR)
>>> pc = exp.getPhotoCalib()
>>> FLUXMAG0 = pc.getInstFluxAtZeroMagnitude()

# calcurate FLUXMAG0ERR
>>> ref_flux = 1.0e23*1.0e9*10**(-0.4*48.6)
>>> FLUXMAG0ERR = FLUXMAG0 * pc.getCalibrationErr()/pc.getCalibrationMean()

FWHM PSF

FWHM PSF are calcurated from src_base_SdssShape_xx, src_base_SdssShape_yy, and src_base_SdssShape_xy by,

FWHM=0.168 * 2.354 *sqrt(sqrt(src_base_SdssShape_xx*src_base_SdssShape_yy - src_base_SdssShape_xy2))

See also https://classic.sdss.org/dr7/algorithms/adaptive.html

FLAG

FLAGS are in 2d array named flags. Please see FLAG numbers at fits header of forced*fits. If flags start from TFLAG=1 and you want to see the FLAG with TFRAG=56, you can get them by e.g.,

>>> from astropy import fits
>>> hdul=fits.open(“forced_*fits”)
>>> hdul[1].data[“flags”][…,56-1]

Note that TFLAG do not always correspond to same flag type. Please check your fits header every files.