calc_path_priors
- zdm.optical_numerics.calc_path_priors(frblist, ss, gs, wrappers, verbose=True, usemodel=True, P_U=0.1)[source]
Run PATH on a list of FRBs and return priors, posteriors, and P_U values.
For each FRB in
frblist, searches all surveys inssfor a match, computes the zdm-derived apparent magnitude prior (ifusemodel=True), and runs PATH to produce host association posteriors. Results for all FRBs are collected into parallel lists (one entry per FRB).Also writes a CSV file
allgalaxies.csv(if it does not already exist) containing the magnitude and VLT/FORS2 R-band columns for all candidate host galaxies across all FRBs.- Parameters:
frblist (list of str) – TNS names of FRBs to process (e.g.
['FRB20180924B', ...]).ss (list of Survey) – Survey objects to search for each FRB. The first survey containing a given FRB is used.
gs (list of Grid) – zdm grids corresponding to each survey in
ss.wrappers (list of model_wrapper) – One
model_wrapperper grid (frommake_wrappers), used to compute DM-dependent apparent magnitude priors.verbose (bool, optional) – If True, print a warning for each FRB not found in any survey. Defaults to True.
usemodel (bool, optional) – If True, use the zdm-derived magnitude prior from
wrappersand estimate P_U from the model. If False, use PATH’s built-in inverse prior and the supplied fixedP_U. Defaults to True.P_U (float, optional) – Fixed prior probability that the host galaxy is undetected. Only used when
usemodel=False. Defaults to 0.1.
- Returns:
nfitted (int) – Number of FRBs successfully matched to a survey and processed.
AppMags (np.ndarray) – Internal apparent magnitude grid (from the last processed wrapper).
allMagPriors (list of np.ndarray) – One array per FRB giving p(m_r | DM_EG) on the
AppMagsgrid. Entries areNonewhenusemodel=False.allObsMags (list of np.ndarray) – One array per FRB listing the r-band magnitudes of PATH candidate host galaxies.
allPO (list of np.ndarray) – One array per FRB giving the PATH prior P_O for each candidate.
allPOx (list of np.ndarray) – One array per FRB giving the PATH posterior P(O|x) for each candidate.
allPU (list of float) – Prior P_U (probability of unseen host) for each FRB.
allPUx (list of float) – Posterior P(U|x) (probability host is unseen, given data) for each FRB.
sumPU (float) – Sum of
allPUacross all FRBs.sumPUx (float) – Sum of
allPUxacross all FRBs.frbs (list of str) – TNS names of the FRBs that were successfully matched and processed.
dms (list of float) – Extragalactic DM (pc cm⁻³) for each FRB in
frbs.