{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Catalogue selection methods\n", "\n", "In this notebook, we will utilize the `Galaxy` class selection methods of galaxies stored in the `Catalogue` object to create boolean selection columns in the outputted fits table. These boolean columns can be loaded back in to new `Catalogue` objects directly from the fits catalogue upon load-in, handy for any subsequent plotting of cutouts, scaling relations, and UV LF / mass function generation. While the details on the available galaxy selection techniques are outlined in the [Galaxy selection notebook](galaxy_selection.ipynb), we will show the catalogue level implementation of the EPOCHS selection here. It is worth noting that all other galaxy selection options are also available on a catalogue scale." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING:galfind:Could not change permissions of /raid/scratch/work/austind/GALFIND_WORK/Log_files/2024-12-11.log to 777.\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Reading GALFIND config file from: /nvme/scratch/work/austind/GALFIND/galfind/../configs/galfind_config.ini\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "WARNING:galfind:Aperture corrections for VISTA not found in /nvme/scratch/work/austind/GALFIND/galfind/Aperture_corrections/VISTA_aper_corr.txt\n", "WARNING:galfind:Aperture corrections for VISTA not found in /nvme/scratch/work/austind/GALFIND/galfind/Aperture_corrections/VISTA_aper_corr.txt\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Failed to `import dust_attenuation`\n", "Install from the repo with $ pip install git+https://github.com/karllark/dust_attenuation.git\n" ] } ], "source": [ "# imports\n", "import astropy.units as u\n", "from galfind import EAZY, Catalogue, EPOCHS_Selector\n", "from galfind.Data import morgan_version_to_dir" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loaded aper_diams= for F277W+F356W+F444W\n", "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\n", "WARNING: hdu= was not specified but multiple tables are present, reading in first available table (hdu=1) [astropy.io.fits.connect]\n", "WARNING:astroquery:hdu= was not specified but multiple tables are present, reading in first available table (hdu=1)\n", "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\n", "Calculating depths: 0%| | 0/15 [00:00\n", "WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys(['ZP', 'min_flux_pc_err'])! Setting to aper_diams=\n", "WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys([])! Setting to aper_diams=\n", "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!\n", "INFO:galfind:Loaded FLUX_RADIUS from /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits saved as sex_Re for cat_band_properties[0].keys()=dict_keys(['F090W', 'F115W', 'F150W', 'F162M', 'F182M', 'F200W', 'F210M', 'F250M', 'F277W', 'F300M', 'F335M', 'F356W', 'F410M', 'F444W'])\n", "INFO:galfind:Making .in file for EAZY_fsps_larson_zmax=4.0 SED fitting for JOF v11 NIRCam\n", "INFO:galfind:Made .in file for EAZY_fsps_larson_zmax=4.0 SED fitting for JOF v11 NIRCam. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running SED fitting took 0.1s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Loading properties and associated errors took 1.4s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Constructing redshift PDFs: 100%|██████████| 16335/16335 [00:00<00:00, 57825.10it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n", "INFO:galfind:Loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "Constructing SEDs: 100%|██████████| 16335/16335 [00:01<00:00, 12404.10it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "INFO:galfind:Updating SED results in galfind catalogue object\n", "Updating galaxy SED results: 100%|██████████| 16335/16335 [00:00<00:00, 157758.30it/s]\n", "INFO:galfind:Making .in file for EAZY_fsps_larson_zmax=6.0 SED fitting for JOF v11 NIRCam\n", "INFO:galfind:Made .in file for EAZY_fsps_larson_zmax=6.0 SED fitting for JOF v11 NIRCam. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running SED fitting took 0.1s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Loading properties and associated errors took 1.3s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Constructing redshift PDFs: 100%|██████████| 16335/16335 [00:00<00:00, 58049.29it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n", "INFO:galfind:Loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "Constructing SEDs: 100%|██████████| 16335/16335 [00:01<00:00, 8771.30it/s] \n", "INFO:galfind:Finished loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "INFO:galfind:Updating SED results in galfind catalogue object\n", "Updating galaxy SED results: 100%|██████████| 16335/16335 [00:00<00:00, 114869.76it/s]\n", "INFO:galfind:Making .in file for EAZY_fsps_larson_zfree SED fitting for JOF v11 NIRCam\n", "INFO:galfind:Made .in file for EAZY_fsps_larson_zfree SED fitting for JOF v11 NIRCam. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running SED fitting took 0.1s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Loading properties and associated errors took 1.3s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Constructing redshift PDFs: 100%|██████████| 16335/16335 [00:00<00:00, 45896.80it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n", "INFO:galfind:Loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "Constructing SEDs: 100%|██████████| 16335/16335 [00:02<00:00, 7851.67it/s] \n", "INFO:galfind:Finished loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "INFO:galfind:Updating SED results in galfind catalogue object\n", "Updating galaxy SED results: 100%|██████████| 16335/16335 [00:00<00:00, 121496.96it/s]\n", "WARNING: hdu= was not specified but multiple tables are present, reading in first available table (hdu=1) [astropy.io.fits.connect]\n", "WARNING:astroquery:hdu= was not specified but multiple tables are present, reading in first available table (hdu=1)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "****************************************\n", "CATALOGUE(JOF,v11,NIRCam):\n", "----------\n", "CAT PATH = /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits\n", "TOTAL GALAXIES = 16335\n", "RA RANGE = [53.01070689 53.11059594] deg\n", "DEC RANGE = [-27.91226173 -27.83206063] deg\n", "----------\n", "****************************************\n", "MULTIPLE_FILTER\n", "----------\n", "FACILITY: JWST\n", "INSTRUMENT: NIRCam\n", "FILTERS: ['F090W', 'F115W', 'F150W', 'F162M', 'F182M', 'F200W', 'F210M', 'F250M', 'F277W', 'F300M', 'F335M', 'F356W', 'F410M', 'F444W']\n", "****************************************\n", "\n" ] } ], "source": [ "survey = \"JOF\"\n", "version = \"v11\"\n", "instrument_names = [\"NIRCam\"]\n", "aper_diams = [0.32] * u.arcsec\n", "forced_phot_band = [\"F277W\", \"F356W\", \"F444W\"]\n", "min_flux_pc_err = 10.\n", "SED_fit_params_arr = [\n", " {\"templates\": \"fsps_larson\", \"lowz_zmax\": 4.0},\n", " {\"templates\": \"fsps_larson\", \"lowz_zmax\": 6.0},\n", " {\"templates\": \"fsps_larson\", \"lowz_zmax\": None}\n", "]\n", "\n", "JOF_cat = Catalogue.pipeline(\n", " survey,\n", " version,\n", " instrument_names = instrument_names, \n", " version_to_dir_dict = morgan_version_to_dir,\n", " aper_diams = aper_diams,\n", " forced_phot_band = forced_phot_band,\n", " min_flux_pc_err = min_flux_pc_err\n", ")\n", "# load sextractor half-light radii\n", "JOF_cat.load_sextractor_Re()\n", "\n", "# load EAZY SED fitting results\n", "for SED_fit_params in SED_fit_params_arr:\n", " EAZY_fitter = EAZY(SED_fit_params)\n", " EAZY_fitter(JOF_cat, aper_diams[0], load_PDFs = True, load_SEDs = True, update = True)\n", "\n", "print(JOF_cat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Now that we have loaded the blank catalogue, we will perform the selection. Since we are running on a `Catalogue` this time around instead of a `Galaxy` (as in [Galaxy Selection, Example 4](../selection/galaxy_selection.ipynb)), we do not need to insert the catalogue filterset when instantiating `EPOCHS_Selector` as this information is already stored in the catalogue we are running." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Selecting bluewards_Lya_SNR<2.0_EAZY_fsps_larson_zfree_0.32as: 0%| | 0/16335 [00:005.0,5.0_widebands_EAZY_fsps_larson_zfree_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 27624.17it/s]\n", "WARNING:galfind:property_name='redwards_Lya_SNR>5.0,5.0_widebands_EAZY_fsps_larson_zfree_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting ALL_redwards_Lya_SNR>2.0_widebands_EAZY_fsps_larson_zfree_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 73698.42it/s]\n", "WARNING:galfind:property_name='ALL_redwards_Lya_SNR>2.0_widebands_EAZY_fsps_larson_zfree_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting red_chi_sq<3.0_EAZY_fsps_larson_zfree_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 90268.24it/s]\n", "WARNING:galfind:property_name='red_chi_sq<3.0_EAZY_fsps_larson_zfree_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting chi_sq_diff>4.0,dz>0.5_EAZY_fsps_larson_zfree_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 78391.61it/s]\n", "WARNING:galfind:property_name='chi_sq_diff>4.0,dz>0.5_EAZY_fsps_larson_zfree_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting zPDF>60%,|dz|/z<0.1_EAZY_fsps_larson_zfree_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 90060.12it/s]\n", "WARNING:galfind:property_name='zPDF>60%,|dz|/z<0.1_EAZY_fsps_larson_zfree_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F090W: 100%|██████████| 16335/16335 [00:00<00:00, 407806.60it/s]\n", "WARNING:galfind:property_name='unmasked_F090W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F115W: 100%|██████████| 16335/16335 [00:00<00:00, 428560.43it/s]\n", "WARNING:galfind:property_name='unmasked_F115W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F150W: 100%|██████████| 16335/16335 [00:00<00:00, 457834.09it/s]\n", "WARNING:galfind:property_name='unmasked_F150W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F162M: 100%|██████████| 16335/16335 [00:00<00:00, 465811.99it/s]\n", "WARNING:galfind:property_name='unmasked_F162M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F182M: 100%|██████████| 16335/16335 [00:00<00:00, 436605.97it/s]\n", "WARNING:galfind:property_name='unmasked_F182M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F200W: 100%|██████████| 16335/16335 [00:00<00:00, 416017.71it/s]\n", "WARNING:galfind:property_name='unmasked_F200W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F210M: 100%|██████████| 16335/16335 [00:00<00:00, 406425.29it/s]\n", "WARNING:galfind:property_name='unmasked_F210M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F250M: 100%|██████████| 16335/16335 [00:00<00:00, 350003.86it/s]\n", "WARNING:galfind:property_name='unmasked_F250M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F277W: 100%|██████████| 16335/16335 [00:00<00:00, 337517.15it/s]\n", "WARNING:galfind:property_name='unmasked_F277W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F300M: 100%|██████████| 16335/16335 [00:00<00:00, 339950.46it/s]\n", "WARNING:galfind:property_name='unmasked_F300M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F335M: 100%|██████████| 16335/16335 [00:00<00:00, 374540.56it/s]\n", "WARNING:galfind:property_name='unmasked_F335M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F356W: 100%|██████████| 16335/16335 [00:00<00:00, 345510.07it/s]\n", "WARNING:galfind:property_name='unmasked_F356W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F410M: 100%|██████████| 16335/16335 [00:00<00:00, 400964.20it/s]\n", "WARNING:galfind:property_name='unmasked_F410M' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_F444W: 100%|██████████| 16335/16335 [00:00<00:00, 365014.52it/s]\n", "WARNING:galfind:property_name='unmasked_F444W' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting unmasked_NIRCam: 100%|██████████| 16335/16335 [00:00<00:00, 474989.81it/s]\n", "WARNING:galfind:property_name='unmasked_NIRCam' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting bluest_band_SNR<2.0_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 69916.41it/s]\n", "WARNING:galfind:property_name='bluest_band_SNR<2.0_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting sex_Re_F277W>45.0mas: 100%|██████████| 16335/16335 [00:00<00:00, 97083.08it/s]\n", "WARNING:galfind:property_name='sex_Re_F277W>45.0mas' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting sex_Re_F356W>45.0mas: 100%|██████████| 16335/16335 [00:00<00:00, 94243.72it/s]\n", "WARNING:galfind:property_name='sex_Re_F356W>45.0mas' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting sex_Re_F444W>45.0mas: 100%|██████████| 16335/16335 [00:00<00:00, 83504.21it/s]\n", "WARNING:galfind:property_name='sex_Re_F444W>45.0mas' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting sex_Re_F277W+F356W+F444W>45.0mas: 100%|██████████| 16335/16335 [00:00<00:00, 349934.14it/s]\n", "WARNING:galfind:property_name='sex_Re_F277W+F356W+F444W>45.0mas' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "Selecting EPOCHS_NIRCam_EAZY_fsps_larson_zfree_0.32as: 100%|██████████| 16335/16335 [00:00<00:00, 88523.67it/s]\n", "WARNING:galfind:property_name='EPOCHS_NIRCam_EAZY_fsps_larson_zfree_0.32as' already appended to hdu='SELECTION' .fits table, not overwriting!\n", "INFO:galfind:deepcopy(Catalogue)\n" ] } ], "source": [ "# perform EPOCHS selection\n", "epochs_selector = EPOCHS_Selector(aper_diams[0], EAZY_fitter, allow_lowz = False, unmasked_instruments = \"NIRCam\")\n", "EPOCHS_JOF_cat = epochs_selector(JOF_cat, return_copy = True)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Of course we see that returning a deep copy of the catalogue object takes longer than not. Let's have a look at how this changes the `Catalogue` print statement." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "****************************************\n", "CATALOGUE(JOF,v11,NIRCam):\n", "----------\n", "CAT PATH = /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits\n", "TOTAL GALAXIES = 16335\n", "RA RANGE = [53.01070689 53.11059594] deg\n", "DEC RANGE = [-27.91226173 -27.83206063] deg\n", "----------\n", "****************************************\n", "MULTIPLE_FILTER\n", "----------\n", "FACILITY: JWST\n", "INSTRUMENT: NIRCam\n", "FILTERS: ['F090W', 'F115W', 'F150W', 'F162M', 'F182M', 'F200W', 'F210M', 'F250M', 'F277W', 'F300M', 'F335M', 'F356W', 'F410M', 'F444W']\n", "****************************************\n", "\n" ] } ], "source": [ "print(EPOCHS_JOF_cat)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Fantastic! We now have a catalogue that has been cropped to only the EPOCHS sample.\n", "\n", "Once the selection has been run on the `Catalogue` object, it is saved in the fits catalogue and is automatically loaded back in immediately when re-initializing the catalogue." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loaded aper_diams= for F277W+F356W+F444W\n", "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\n", "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\n", "Calculating depths: 0%| | 0/15 [00:00\n", "WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys(['ZP', 'min_flux_pc_err'])! Setting to aper_diams=\n", "WARNING:galfind:cat_aper_diams not in kwargs.keys()=dict_keys([])! Setting to aper_diams=\n", "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!\n", "INFO:galfind:Loaded FLUX_RADIUS from /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits saved as sex_Re for cat_band_properties[0].keys()=dict_keys(['F090W', 'F115W', 'F150W', 'F162M', 'F182M', 'F200W', 'F210M', 'F250M', 'F277W', 'F300M', 'F335M', 'F356W', 'F410M', 'F444W'])\n", "INFO:galfind:Making .in file for EAZY_fsps_larson_zmax=4.0 SED fitting for JOF v11 NIRCam\n", "INFO:galfind:Made .in file for EAZY_fsps_larson_zmax=4.0 SED fitting for JOF v11 NIRCam. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running SED fitting took 0.1s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Loading properties and associated errors took 1.3s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Constructing redshift PDFs: 100%|██████████| 16335/16335 [00:00<00:00, 52702.52it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n", "INFO:galfind:Loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "Constructing SEDs: 100%|██████████| 16335/16335 [00:01<00:00, 12606.34it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "INFO:galfind:Updating SED results in galfind catalogue object\n", "Updating galaxy SED results: 100%|██████████| 16335/16335 [00:00<00:00, 109341.89it/s]\n", "INFO:galfind:Making .in file for EAZY_fsps_larson_zmax=6.0 SED fitting for JOF v11 NIRCam\n", "INFO:galfind:Made .in file for EAZY_fsps_larson_zmax=6.0 SED fitting for JOF v11 NIRCam. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running SED fitting took 0.1s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Loading properties and associated errors took 2.7s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Constructing redshift PDFs: 100%|██████████| 16335/16335 [00:00<00:00, 50266.21it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n", "INFO:galfind:Loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "Constructing SEDs: 100%|██████████| 16335/16335 [00:01<00:00, 10613.19it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "INFO:galfind:Updating SED results in galfind catalogue object\n", "Updating galaxy SED results: 100%|██████████| 16335/16335 [00:00<00:00, 109709.92it/s]\n", "INFO:galfind:Making .in file for EAZY_fsps_larson_zfree SED fitting for JOF v11 NIRCam\n", "INFO:galfind:Made .in file for EAZY_fsps_larson_zfree SED fitting for JOF v11 NIRCam. \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Running SED fitting took 0.1s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Loading properties and associated errors took 1.3s\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Constructing redshift PDFs: 100%|██████████| 16335/16335 [00:00<00:00, 45106.84it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson property PDFs into JOF v11 NIRCam\n", "INFO:galfind:Loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "Constructing SEDs: 100%|██████████| 16335/16335 [00:01<00:00, 10576.12it/s]\n", "INFO:galfind:Finished loading EAZY_fsps_larson SEDs into JOF v11 NIRCam\n", "INFO:galfind:Updating SED results in galfind catalogue object\n", "Updating galaxy SED results: 100%|██████████| 16335/16335 [00:00<00:00, 107419.12it/s]\n" ] } ], "source": [ "JOF_cat_new = Catalogue.pipeline(\n", " survey,\n", " version,\n", " instrument_names = instrument_names, \n", " version_to_dir_dict = morgan_version_to_dir,\n", " aper_diams = aper_diams,\n", " forced_phot_band = forced_phot_band,\n", " min_flux_pc_err = min_flux_pc_err\n", ")\n", "# load sextractor half-light radii\n", "JOF_cat_new.load_sextractor_Re()\n", "\n", "# load EAZY SED fitting results\n", "for SED_fit_params in SED_fit_params_arr:\n", " EAZY_fitter = EAZY(SED_fit_params)\n", " EAZY_fitter(JOF_cat_new, aper_diams[0], load_PDFs = True, load_SEDs = True, update = True)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Catalogues are different\n" ] } ], "source": [ "if JOF_cat == JOF_cat_new:\n", " print(\"Catalogues are the same\")\n", "else:\n", " print(\"Catalogues are different\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Should you notice an error in, for instance, a custom selector, you can always delete the selection fits extension so that you don't keep re-loading the dodgy results." ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "INFO:galfind:Writing table to /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits\n", "INFO:galfind:Deleted hdu.upper()='SELECTION' from self.cat_path='/raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits'!\n", "WARNING: hdu= was not specified but multiple tables are present, reading in first available table (hdu=1) [astropy.io.fits.connect]\n", "WARNING:astroquery:hdu= was not specified but multiple tables are present, reading in first available table (hdu=1)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "****************************************\n", "CATALOGUE(JOF,v11,NIRCam):\n", "----------\n", "CAT PATH = /raid/scratch/work/austind/GALFIND_WORK/Catalogues/v11/NIRCam/JOF/(0.32)as/JOF_MASTER_Sel-F277W+F356W+F444W_v11.fits\n", "TOTAL GALAXIES = 16335\n", "RA RANGE = [53.01070689 53.11059594] deg\n", "DEC RANGE = [-27.91226173 -27.83206063] deg\n", "----------\n", "****************************************\n", "MULTIPLE_FILTER\n", "----------\n", "FACILITY: JWST\n", "INSTRUMENT: NIRCam\n", "FILTERS: ['F090W', 'F115W', 'F150W', 'F162M', 'F182M', 'F200W', 'F210M', 'F250M', 'F277W', 'F300M', 'F335M', 'F356W', 'F410M', 'F444W']\n", "****************************************\n", "\n" ] } ], "source": [ "JOF_cat_new.del_hdu(hdu = \"SELECTION\")\n", "\n", "print(JOF_cat_new)" ] } ], "metadata": { "kernelspec": { "display_name": "more_and_more_galfind", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.20" } }, "nbformat": 4, "nbformat_minor": 2 }