ccatkidlib.analysis.viz package
Submodules
ccatkidlib.analysis.viz.viz_utils module
Library of helper functions for plotting KID data.
- ccatkidlib.analysis.viz.viz_utils.cycle_cmap(cmap: str, num_colors: int, cmap_range: tuple[float, float] = (0, 1)) Cycle | None
Create Holoviews Cycle object of specified matplotlib color map discretized into
num_colorscolors- Parameters:
cmap – Matplotlib color map
num_colors – Number of colors to include
cmap_range – Range of colors to use from color map. Defaults to a range of (0, 1) for use with continuous color maps.
- Returns:
Holoviews Cycle object with
num_colorscolors from specified color map or None if invalid color map is specified
- ccatkidlib.analysis.viz.viz_utils.save_fig(obj: Data | Detector | Network, plot_func: Callable, data: Any, plot_opts: list[Options], *args, save_fig: bool | None = None, figs_per_file: int | None = None, overwrite: bool | None = None, save_dir: str | Path | None = None, save_name: str | None = None, save_fmt: Format | None = None, blocking: bool = False, **kwargs) None
Create a Holoviews figure using the specified plotting function and save figure to disk
- Parameters:
obj – ccatkidlib Data, Detector, or Network object
plot_func – Function that generates Holoviews figure
data – Data to be passed to
plot_funcfor creating figureplot_opts – List of Holoviews Options to be passed to
plot_funcfor styling figureargs – Positional arguments to pass to
plot_funcsave_fig – Whether to save figure. Defaults to that specified in viz configuration file
figs_per_file – Number of figures to save in a single file. Will make a \(\sqrt{\text{figs_per_file}} \times \sqrt{\text{figs_per_file}}\) grid of figures. Defaults to that specified in viz configuration file
overwrite – Whether to overwrite figure files that already exist. Defaults to that specified in viz configuration file
save_dir – Directory where figure should be saved. Defaults to the
fig_dirofobjsave_name – Save name of file. Will always append
obj.timestampto the end of file name. Defaults to that specified in viz configuration filesave_fmt – Format to save figure as. Defaults to that specified in viz configuration file
kwargs – Key word arguments to pass to
plot_func