plot_grid
- zdm.figures.plot_grid(zDMgrid, zvals, dmvals, zmax=1, DMmax=1000, norm=0, log=True, name='temp.pdf', label='$\\log_{10}p(DM_{\\rm EG},z)$', xlabel='z', ylabel='${\\rm DM}_{\\rm EG}$ (pc cm$^{-3}$)', logrange=4, project=False, conts=False, FRBZs=None, FRBDMs=None, plt_dicts=None, cont_dicts=None, cmap=None, Aconts=None, Macquart=None, title=None, H0=None, showplot=False, DMlines=None, DMlims=None, clim=False, special=None, pdmgz=None, save=True, othergrids=None, othernames=None, c_cmap=None, cont_clrs=None)[source]
Very complicated routine for plotting 2D zdm grids
- Parameters:
zDMgrid (2D array) – P(z,DM) grid
zvals (1D array) – z values corresponding to zDMgrid
dmvals (1D array) – DM values corresponding to zDMgrid
zmax (int, optional) – Maximum z value to display
DMmax (int, optional) – Maximum DM value to display
norm (int, optional) – Method to normalise zDMgrid. 0: No normalisation 1: Normalise by dm bin 2: Normalise by sum of zDMgrid 3: Normalise by max value of zDMgrid 4: Set peak value at each z to unity
log (bool, optional) – Plot P(z,DM) in log space
name (str, optional) – Outfile name
label (str, optional) – Colourbar label
xlabel (str,optional) – Label on x axis of plot
ylabel (str,optional) – Label on y axis of plot
logrange (float,optional) – range in logspace of the z axis (defaults to 4)
project (bool, optional) – Add projections of P(z) and P(DM)
conts (bool, optional) – create contours in probability p(dm|z), at fractional levels set by conts. Defaults to False.
FRBZs (list of 1D arrays, optional) – List of FRB Zs to plot (each list can have customised plotting styles, e.g. for different surveys)
FRBDMs (list of 1D arrays, optional) – List of FRB DMs to plot (corrseponding to FRBZs)
plt_dicts (list of dictionaries, optional) – List of dictionaries containing the plotting parameters for each ‘set’ of data points (corresponding to FRBZs and FRBDMs). E.g. can contain marker, color, label etc
cmap (str, optional) – Alternate color map for PDF
Aconts (bool, optional) – Create contours in 2D probabilty space, at fractional levels set by Aconts. Defaults to False.
Macquart (state, optional) – state object. Used to generate the Maquart relation. Defaults to None, i.e. do not show the Macquart relation.
title (str, optional) – Title of the plot
H0 ([type], optional) – [description]. Defaults to None.
showplot (bool, optional) – use plt.show to show plot. Defaults to False.
DMlines (list, optional) – plot lines for unlocalised FRBs at these DMs
DMlims (list, optional) – plot horizontal lines to indicate the maximum searched DM of a given survey
clim ([float,float], optional) – pair of floats giving colorbar limits. Defaults to False (automatic limit)
special (list,optional) – list of [z,dm] values to show as a special big star
pdmgz (list of floats, optional) – a list of cumulative values of p(DM|z) to plot. Must range from 0 to 1.
othergrids (list of grids) – a list of grids to plot contours for. Uses Aconts
othernames (list of names) – list of names for original and other grid. Used only if othergrids is not None. Must be length of othergrids +1.
c_cmap (string) – Name of colormap used to plot “Acont” contours
cont_clrs (float, np.ndarray) – list of colors in colourmap to use for contours