From dfb71c23e1d3a99f280f5393b675daee4903d3ba Mon Sep 17 00:00:00 2001 From: fangyuedong Date: Tue, 30 Jul 2024 20:06:33 +0800 Subject: [PATCH] magnitude ('mag_use_normal') calculations for galaxies and QSOs now is only based on their SEDs --- catalog/C9_Catalog.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/catalog/C9_Catalog.py b/catalog/C9_Catalog.py index 590dda6..146205d 100644 --- a/catalog/C9_Catalog.py +++ b/catalog/C9_Catalog.py @@ -557,8 +557,22 @@ class Catalog(CatalogBase): # erg/s/cm2/A --> photon/s/m2/A all_sed = y * lamb / (cons.h.value * cons.c.value) * 1e-13 sed = Table(np.array([lamb, all_sed]).T, names=('WAVELENGTH', 'FLUX')) - if obj.type == 'quasar': - # integrate to get the magnitudes + # if obj.type == 'quasar': + # # integrate to get the magnitudes + # sed_photon = np.array([sed['WAVELENGTH'], sed['FLUX']]).T + # sed_photon = galsim.LookupTable(x=np.array(sed_photon[:, 0]), f=np.array( + # sed_photon[:, 1]), interpolant='nearest') + # sed_photon = galsim.SED( + # sed_photon, wave_type='A', flux_type='1', fast=False) + # interFlux = integrate_sed_bandpass( + # sed=sed_photon, bandpass=self.filt.bandpass_full) + # obj.param['mag_use_normal'] = getABMAG( + # interFlux, self.filt.bandpass_full) + # # mag = getABMAG(interFlux, self.filt.bandpass_full) + # # print("mag diff = %.3f"%(mag - obj.param['mag_use_normal'])) + + # integrate to get the magnitudes + if obj.type == 'quasar' or obj.type == 'galaxy': sed_photon = np.array([sed['WAVELENGTH'], sed['FLUX']]).T sed_photon = galsim.LookupTable(x=np.array(sed_photon[:, 0]), f=np.array( sed_photon[:, 1]), interpolant='nearest') -- GitLab