opticam.plotting.plots ====================== .. py:module:: opticam.plotting.plots Functions --------- .. autoapisummary:: opticam.plotting.plots.plot_catalogs opticam.plotting.plots.plot_time_between_files opticam.plotting.plots.plot_backgrounds opticam.plotting.plots.plot_background_meshes opticam.plotting.plots.plot_growth_curves opticam.plotting.plots.plot_psf opticam.plotting.plots.plot_rms_vs_median_flux opticam.plotting.plots.get_lc_rms_and_flux_dict opticam.plotting.plots.plot_snrs opticam.plotting.plots.plot_noise opticam.plotting.plots.plot_apertures opticam.plotting.plots.get_max_region_size opticam.plotting.plots.plot_light_curves Module Contents --------------- .. py:function:: plot_catalogs(out_directory, stacked_images, catalogs, show, save) Plot the source catalogs. Parameters ---------- out_directory : Path The path to the directory in which the resulting plot will be saved. stacked_images : dict[str, NDArray] The stacked images for each filter {filter: image}. catalogs : dict[str, QTable] The source catalogs for each filter {filter: catalog}. show : bool Whether to show the plot. save : bool Whether to save the plot. .. py:function:: plot_time_between_files(out_directory, camera_files, bmjds, show, save) Plot the times between files. Useful for identifying gaps. Parameters ---------- out_directory : Path The directory path to which the resulting plot will be saved. camera_files : dict[str, list[MEFSlice]] The files separated by camera. bmjds : dict[str, float] The file time stamps {file path + extension: time stamp}. show : bool Whether to show the plot. save : bool Whether to save the plot. .. py:function:: plot_backgrounds(out_directory, t_ref, show, save) Plot the time-varying background for each camera. Parameters ---------- out_directory : Path The directory to which the background files, and where the resulting plot will be saved if `save=True`. t_ref : float The reference BMJD. show: bool Whether to display the plot. save : bool Whether to save the plot. .. py:function:: plot_background_meshes(out_directory, images, background, show, save) Plot the background mesh on top a series of images. Parameters ---------- out_directory : Path The path to the output directory. images : dict[str, NDArray[np.float64]] The images {string: image} background: BaseBackground The background estimator. show : bool Whether to show the plot. save : bool Whether to save the plot. .. py:function:: plot_growth_curves(image, cat, targets, psf_params) Plot the growth curves given a (stacked) image and corresponding source catalog. Parameters ---------- image : NDArray The image. cat : QTable The catalog corresponding to `image`. targets : int | list[int] The target(s) for which growth curves are to be computed. psf_params : dict The PSF parameters. Returns ------- Figure The growth curve plots. .. py:function:: plot_psf(catalog, source_indx, stacked_image, key, a, b, out_directory) Plot the PSF for given source. Parameters ---------- catalog : QTable The source catalog. source_indx : int The index of the source in the catalog. stacked_image : NDArray The catalog image. key : str The camera:filter key. a : float The semimajor standard deviation of the PSF. b : float The semiminor standard deviation of the PSF. out_directory : Path, The save path. .. py:function:: plot_rms_vs_median_flux(lc_dir, save_dir, phot_label, show = True) Plot the RMS as a function of the median flux for all catalog sources. Parameters ---------- lc_dir : Path The light curve directory path. save_dir : Path The output directory path. phot_label : str The photometry label. show : bool, optional Whether to show the plot, by default True. .. py:function:: get_lc_rms_and_flux_dict(lc_dir) Get the RMS and median flux for a series of light curves. Parameters ---------- lc_dir : Path The directory path to the light curves. Returns ------- dict[str, dict[str, dict[str, float]]] The median and RMS flux values for each light curve grouped by filter. .. py:function:: plot_snrs(out_directory, files, background, psf_params, catalogs, instrument, bias_corrector, dark_corrector, flat_corrector, show, save) Plot the S/N for each source. Parameters ---------- out_directory : Path The output directory. files : dict[str, MEFSlice] The reference file for each filter. background : BaseBackground | Callable The global background estimator. psf_params : dict[str, dict[str, float]] The PSF parameters for each filter {filter: psf parameters}. catalogs : dict[str, QTable] The catalogs for each filter {filter: catalog}. instrument : Instrument The instrument that produced the data. bias_corrector : BiasCorrector | None The bias corrector. dark_corrector : DarkNoiseCorrector | None The dark noise corrector. flat_corrector : FlatFieldCorrector | None The flat-field corrector. show : bool Whether to show the plot. save : bool Whether to save the plot. .. py:function:: plot_noise(out_directory, files, background, psf_params, catalogs, instrument, bias_corrector, dark_corrector, flat_corrector, show, save) Plot the various noise contributions and compare them to the measured noise for a series of images. Parameters ---------- out_directory : Path The output directory. files : dict[str, MEFSlice] The reference files for each filter. background : BaseBackground | Callable The global background estimator. psf_params : dict[str, dict[str, float]] The PSF parameters for each filter {filter: psf parameters}. catalogs : dict[str, QTable] The catalogs for each filter {filter: catalog}. instrument : Instrument The instrument that produced the data. bias_corrector : BiasCorrector | None The bias corrector. dark_corrector : DarkNoiseCorrector The dark noise corrector. flat_corrector : FlatFieldCorrector | None The flat-field corrector. show : bool Whether to show the plot. save : bool Whether to save the plot. .. py:function:: plot_apertures(out_directory, data, cat, targets, photometer, psf_params, key, show, save) Plot the specified aperture over each target source. Parameters ---------- out_directory : Path The output directory. Used to save the plot if `save=True`. data : NDArray The image data. cat : QTable The source catalog. targets : list[int] | int The target IDs to plot apertures for. photometer : AperturePhotometer The `AperturePhotometer` instance. psf_params : dict[str, float] The PSF parameters. key : str The camera:filter key. show : bool Whether to show the plot. save : bool Whether to save the plot. If true, the plot is saved to `out_directory/diag/apertures/fltr_apertures.pdf`. .. py:function:: get_max_region_size(targets, photometer, data, cat, psf_params) Get the maximum region size for plotting apertures. Parameters ---------- targets : list[int] The target source IDs. photometer : AperturePhotometer The `AperturePhotometer` instance. data : NDArray[np.float64] The image data. cat : QTable The source catalog. psf_params : dict[str, float] The PSF parameters. Returns ------- int The maximum region size. .. py:function:: plot_light_curves(keys, light_curves, t_ref, y_label = None) Plot a table of light curves using a dedicated subplot for each filter. Parameters ---------- keys : list[str] The light curve camera:filter keys. light_curves : TimeSeries The light curves. t_ref : Quantity The reference time. Light curves are plotted in seconds from this reference time. y_label : Any, optional The y-axis label, by default `None`. Returns ------- Figure The resulting figure.