LePhare
In addition to SED fitting with EAZY, we also include functionality to run SED fitting with LePhare, which is an older code based in Fortran.
[1]:
import astropy.units as u
from galfind import Catalogue_Creator, Data, LePhare
from galfind.Data import morgan_version_to_dir
Reading GALFIND config file from: /nvme/scratch/work/austind/GALFIND/galfind/../configs/galfind_config.ini
WARNING:galfind:Aperture corrections for VISTA not found in /nvme/scratch/work/austind/GALFIND/galfind/Aperture_corrections/VISTA_aper_corr.txt
WARNING:galfind:Aperture corrections for VISTA not found in /nvme/scratch/work/austind/GALFIND/galfind/Aperture_corrections/VISTA_aper_corr.txt
Failed to `import dust_attenuation`
Install from the repo with $ pip install git+https://github.com/karllark/dust_attenuation.git
[2]:
# Load in a JOF data object
survey = "JOF"
version = "v11"
instrument_names = ["NIRCam"]
aper_diams = [0.32] * u.arcsec
forced_phot_band = ["F277W", "F356W", "F444W"]
min_flux_pc_err = 10.
JOF_data = Data.pipeline(
survey,
version,
instrument_names = ["NIRCam"],
version_to_dir_dict = morgan_version_to_dir,
aper_diams = aper_diams,
forced_phot_band = forced_phot_band,
min_flux_pc_err = min_flux_pc_err
)
INFO:galfind:Loaded aper_diams=<Quantity [0.32] arcsec> for F277W+F356W+F444W
INFO:galfind:Combined mask for NIRCam/F277W+F356W+F444W already exists at /raid/scratch/work/austind/GALFIND_WORK/Masks/JOF/combined/JOF_F277W+F356W+F444W_auto.fits
WARNING: hdu= was not specified but multiple tables are present, reading in first available table (hdu=1) [astropy.io.fits.connect]
WARNING:astroquery:hdu= was not specified but multiple tables are present, reading in first available table (hdu=1)
WARNING:galfind:Aperture correction columns already in /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits
Calculating depths: 0%| | 0/15 [00:00<?, ?it/s]
INFO:galfind:Calculated/loaded depths for JOF v11 NIRCam
INFO:galfind:Local depth columns already exist in /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits
[3]:
cat_path = JOF_data.phot_cat_path
filterset = JOF_data.filterset
cat_creator = Catalogue_Creator(survey, version, cat_path, filterset, aper_diams)
cat = cat_creator()
INFO:galfind:Loaded 'has_data_mask' from /raid/scratch/work/austind/GALFIND_WORK/Masks/JOF/has_data_mask/JOF_MASTER_Sel-F277W+F356W+F444W_v11.h5
INFO:galfind:Making JOF v11 JOF_MASTER_Sel-F277W+F356W+F444W_v11 catalogue!
WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys(['ZP', 'min_flux_pc_err'])! Setting to aper_diams=<Quantity [0.32] arcsec>
WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys(['ZP', 'min_flux_pc_err'])! Setting to aper_diams=<Quantity [0.32] arcsec>
WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys([])! Setting to aper_diams=<Quantity [0.32] arcsec>
WARNING:galfind:cat_type = cat_type='selection' not in ['ID', 'sky_coord', 'phot', 'mask', 'depths'] and not a valid HDU extension in /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits!
WARNING:galfind:selection tab is None!
INFO:galfind:Made /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits catalogue!
[4]:
SED_fit_params = {"GAL_TEMPLATES": "BC03_Chabrier2003_Z(m42_m62)"}
LePhare_fitter = LePhare(SED_fit_params)
LePhare_fitter.compile(filterset, types = ["STAR"])#, "QSO"])
print(SED_fit_params)
#LePhare_fitter.compile_templates(filterset)
#LePhare_fitter._compile_templates(input_filterset)
#LePhare_SED_results_arr = LePhare_fitter(cat, aper_diams[0])
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 3
1 SED_fit_params = {"GAL_TEMPLATES": "BC03_Chabrier2003_Z(m42_m62)"}
2 LePhare_fitter = LePhare(SED_fit_params)
----> 3 LePhare_fitter.compile(filterset, types = ["STAR"])#, "QSO"])
4 print(SED_fit_params)
File /nvme/scratch/work/austind/GALFIND/galfind/LePhare.py:229, in LePhare.compile(self, filterset, types, template_save_suffix)
222 def compile(
223 self,
224 filterset: Multiple_Filter,
(...)
227 ) -> NoReturn:
228 # determine appropriate input filterset
--> 229 input_filterset = self.get_input_filterset(filterset)
230 self.compile_filters(input_filterset)
231 for _type in types:
AttributeError: 'LePhare' object has no attribute 'get_input_filterset'