make_cumulative_plots
- zdm.optical_numerics.make_cumulative_plots(NMODELS, NFRB, AppMags, AppMagPriors, ObsMags, ObsPosteriors, PUobs, PUprior, plotfile, plotlabel, POxcut=None, abc=None, onlyobs=None, greyscale=[], addpriorlabel=True)[source]
Plot cumulative apparent magnitude distributions for multiple host models on one figure.
Computes the same normalised prior and observed CDFs as
calculate_ks_statistic, but forNMODELSmodels simultaneously, overlaying them on a single figure with distinct line styles.All list-valued parameters that appear in
calculate_ks_statisticgain an additional leading dimension of sizeNMODELShere.- Parameters:
NMODELS (int) – Number of models to plot.
NFRB (list of int, length NMODELS) – Number of FRBs for each model, used for normalisation.
AppMags (list of np.ndarray, length NMODELS) – Apparent magnitude grid for each model.
AppMagPriors (list of lists of np.ndarray, shape (NMODELS, NFRB, NMAG)) – Model prior p(m_r | DM_EG) for each model and FRB.
ObsMags (list of lists of np.ndarray, shape (NMODELS, NFRB, NCAND)) – Observed candidate magnitudes for each model and FRB.
ObsPosteriors (list of lists of np.ndarray, shape (NMODELS, NFRB, NCAND)) – PATH posteriors P(O_i|x) for each model and FRB.
PUobs (list, length NMODELS) – Posterior P(U|x) per model (not used directly in the plot).
PUprior (list, length NMODELS) – Prior P_U per model (not used directly in the plot).
plotfile (str) – Output file path for the saved figure.
plotlabel (list of str, length NMODELS) – Legend label prefix for each model.
POxcut (float or None, optional) – If not None, restrict to candidates with P(O|x) > POxcut and normalise CDFs to unity. Defaults to None.
abc (str or None, optional) – Panel label (e.g.
'(a)') placed in the upper-left corner in figure-coordinate space. Defaults to None.onlyobs (int or None, optional) – If not None, only draw the observed CDF for the model with this index (useful when all models share the same observations). The observed line is then labelled
"Observed"without a model prefix. Defaults to None.greyscale (list of int, optional) – Indices of models whose observed CDF should additionally be drawn in grey (for background reference). Defaults to
[].addpriorlabel (bool, optional) – If True (default), append
": Prior"to each model’s legend entry. Set to False to use onlyplotlabel[imodel]as the label.
- Return type:
None