I were using the FLUXMAG0 in the header of CORR-*fits to calculate the zero point (and magnitude) for the data processed with hscPipe 5. But this information is no longer in the data processed with hscPipe 7.9.1.
I wonder if anyone can give me a hint for how to calculate/obtain the apparent magnitude from the output of hscPipe 7.9.1, which has T_MAGZER =0 in the header and only has many *instFlux in the SRC-*.fits.
I believe the plan is to add this header back, but in the meantime you can get it from the photoCalib() associated with the calexp, e.g. fluxMag0 = calexp.getPhotoCalib().getInstFluxAtZeroMagnitude()
I think you can just use the ce.instFluxToMagnitude method. There are a few different overloads. You can see the documentation (in c++ but it mostly carries through to the python) here
If you have an exposure and the source catalog derived from it and want to compute the fluxes and magnitudes for all of the fields in that catalog, you are best off using calexp.getPhotoCalib().calibrateCatalog().
Yes, that should be the best way to get the PhotoCalib associated with that exposure.
Note that we strongly recommend using the built-in PhotoCalib methods (e.g. instFluxToNanojansky, instFluxToMagnitude, calibrateCatalog, and calibrateImage) instead of doing your own math with an exposure-averaged flux magnitude zero point, because the calibration factor may vary across the image.
I got an additional question: how can I get the zero point of single warp image (e.g.: warp-HSC-G-0-14,11-34490.fits) and stacked image (e.g.:calexp-HSC-G-0-14,11.fits).
I can get a value from following code, but I don’t sure what is I obtained: