Photometry
Methods related to galaxy photometry
- frb.galaxies.photom.merge_photom_tables(new_tbl, old_file, tol=<Quantity 1. arcsec>, debug=False)[source]
Merge photometry tables
- Args:
new_tbl (astropy.table.Table) – New table of photometry
old_file (str or Table) – Path to the old table
- Returns:
Merged tables
- Return type:
astropy.table.Table
- frb.galaxies.photom.photom_by_name(name, filelist)[source]
Generate a Table for a given galaxy from a list of photom files
Warning: Order matters! Use best data last
- Args:
name (str)
filelist (list)
- Return type:
astropy.table.Table
- frb.galaxies.photom.extinction_correction(filt, EBV, RV=3.1, max_wave=None, required=True)[source]
calculate MW extinction correction for given filter
Uses the Gordon 2024 extinction model
- Args:
filt (str) – filter name (name of file without .dat extension)
EBV (float) – E(B-V) (can get from frb.galaxies.nebular.get_ebv which uses IRSA Dust extinction query
RV – from gbrammer/threedhst eazyPy.py – characterizes MW dust
max_wave (float, optional) – If set, cut off the calculation at this maximum wavelength. A bit of a hack for the near-IR, in large part because the MW extinction curve ends at 1.4 microns.
required (bool, optional) – Crash out if the transmission curve is not present
- Returns:
linear extinction correction
- Return type:
- frb.galaxies.photom.correct_photom_table(photom, EBV, name, max_wave=None, required=True)[source]
Correct the input photometry table for Galactic extinction Table is modified in place
If there is SDSS photometry, we look for the extinction values provided by the Survey itself.
Uses extinction_correction()
- Args:
photom (astropy.table.Table) – Required keys: ‘Name’, filters
EBV (float) – E(B-V) (can get from frb.galaxies.nebular.get_ebv which uses IRSA Dust extinction query
name (str) – Name of the object to correct
required (bool, optional) – Crash out if the transmission curve is not present
- Returns:
- Return code
-1: No matches to the input name 0: One match
- Return type:
- frb.galaxies.photom.sb_at_frb(host, cut_dat: ndarray, cut_err: ndarray, wcs: WCS, fwhm=3.0, physical=False, min_uncert=2)[source]
Measure the surface brightness at an FRB location in a host galaxy
- Args:
host (Host object) – host galaxy object from frb repo
cut_dat (np.ndarray) – data (data from astorpy 2D Cutout object)
cut_err (np.ndarray) – inverse variance of data (from astropy 2D Cutout object)
wcs (WCS) – WCS for the cutout
fwhm (float, optional) – FWHM of the PSF of the image in either pixels or kpc. Defaults to 3 [pix].
physical (bool, optional) – If True, FWHM is in kpc. Defaults to False.
min_uncert (int, optional) – Minimum localization unceratainty for the FRB, in pixels. Defaults to 2.
- Returns:
sb_average, sb_average_err [counts/sqarcsec]
- Return type:
- frb.galaxies.photom.fractional_flux(cutout, frbdat, hg, nsig=3.0)[source]
Calculate the fractional flux at the FRB location
- Args:
cutout (WCS Cutout2D) – astropy 2D Cutout of data around host galaxy
frbdat (frb.FRB) – frb object loaded from frb repo
hg (frb.galaxies.frbgalaxy.FRBHost) – host galaxy object loaded from frb repo
nsig (float, optional) – sigma for FRB localization within which the measurement should be made. Defaults to 3.
- Returns:
- median_ff, sig_ff, ff_weight [no units]
Median fractional flux, uncertainty
- Return type:
Note
This module uses dust_extinction and photutils for key workflows.
Ensure optional dependencies are available for extinction and
aperture-photometry operations.