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 in ss for a match, computes the zdm-derived apparent magnitude prior (if usemodel=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_wrapper per grid (from make_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 wrappers and estimate P_U from the model. If False, use PATH’s built-in inverse prior and the supplied fixed P_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 AppMags grid. Entries are None when usemodel=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 allPU across all FRBs.

  • sumPUx (float) – Sum of allPUx across 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.