SPCSim.utils package
Submodules
SPCSim.utils.plot_utils module
- SPCSim.utils.plot_utils.binlvl(idx, edh_len)[source]
Funciton to calculate and return the binning level for each index.
- Parameters:
idx (int) – EDH bin index
edh_len (int) – Total ED histogram bins
- Returns:
Boundary level
- Return type:
bdry_level
- SPCSim.utils.plot_utils.plot_edh(ebins_full, ax_, tr=None, plt_type='-g', crop_window=0, ymax=0.5, lw=1, ls='-', colors_list=['r', 'g', 'b', 'y', 'c', 'm'])[source]
Function to plot the ED histogram boundaries based on the levels for better understanding.
Note
This function supports plotting of bins only till 6th level i.e. till 64 bins
- Parameters:
ebins_full (np.ndarray) – ED histogram bins with the boundary bins
ax (_type_) – Matplotlib plotting axis
tr (np.ndarray, optional) – True transient or EW histogram with bins = ebins_full[-1]. Defaults to None.
plt_type (str, optional) – Used to change the line plot color and style for tr. Defaults to ‘-g’.
crop_window (int, optional) – Allows to zoom-in closer to the peak. Defaults to 0.
ymax (float, optional) – Height of ED histogram bins. Defaults to 0.5.
lw (int, optional) – Change the line width of ED histogram boundaries. Defaults to 1.
ls (str, optional) – Change the line style of ED histogram boundaries. Defaults to ‘-‘.
colors_list (list, optional) – List of color values used for ED boundaries of different levels. Defaults to [‘r’,’g’,’b’,’y’,’c’,’m’].
- SPCSim.utils.plot_utils.plot_edh_traj(ax, edh_list, gt_edh_list, tr, ewh=None, colors=None)[source]
Function to plot the EDH binner trajectories
- Parameters:
ax (_type_) – Matplotlib plotting axis
edh_list (_type_) – List of EDH binner CV values for each laser cycle
gt_edh_list (_type_) – List of true quantiles to be tracked by the EDH binners
tr (np.ndarray, optional) – True transient or EW histogram with bins = ebins_full[-1]. Defaults to None.
colors (list, optional) – List of color values used for ED boundaries of different levels. Defaults to None.
- SPCSim.utils.plot_utils.plot_ewh(ax, xbins, ewh, label=None, color=None)[source]
Function to plot EW histograms
- Parameters:
ax (_type_) – Matplotlib plotting axis
xbins (_type_) – EW histogram midpoint locations on time axis.
ewh (_type_) – EW histogram
label (_type_, optional) – Plot label for EW histogram. Defaults to None.
color (_type_, optional) – EW histogram edge color. Defaults to None.
- SPCSim.utils.plot_utils.plot_rgbd(fig, ax_rgb, ax_dist, rgb, dist, cmap='gray', axis='off', rgb_title='RGB image', show_cbar=False)[source]
Function to plot RGB and Distance images
- Parameters:
fig (_type_) – Matplotlib figure object
ax_rgb (_type_) – Matplotlib subplot axis for RGB image
ax_dist (_type_) – Matplotlib subplot axis for distance image
rgb (_type_) – RGB image
dist (_type_) – Distance image
cmap (str, optional) – Color map used to display the distance image. Defaults to “gray”.
axis_off (str, optional) – Remove image axis. Defaults to “off”.
rgb_title (str, optional) – Title for rgb image. Defaults to “RGB image”.
show_cbar (bool, optional) – Flag to select displaying color bar. Defaults to False.
- Returns:
Matplotlib imshow output object for further use.
- Return type:
im
- SPCSim.utils.plot_utils.plot_transient(ax, tr, plt_type='-g', label='True transient')[source]
Function to plot the true transients, photon densities and EW histograms with N_ewhbins = N_tbins
- Parameters:
ax (_type_) – Matplotlib plotting axis
tr (np.ndarray, optional) – True transient or EW histogram with bins = ebins_full[-1]. Defaults to None.
plt_type (str, optional) – Used to change the line plot color and style for tr. Defaults to ‘-g’.
label (str, optional) – Plot label for tr. Defaults to “True transient”.