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 Module Contents --------------- .. py:function:: plot_catalogs(out_directory, stacked_images, catalogs, show, save) Plot the source catalogs. Parameters ---------- out_directory : str The directory path to which the resulting plot will be saved. filters : List[str] The catalog filters. stacked_images : Dict[str, NDArray] The stacked images for each filter {filter: image}. 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 : str The directory path to which the resulting plot will be saved. camera_files : Dict[str, List[str]] The file paths separated by camera {filter: file paths}. bmjds : Dict[str, float] The file time stamps {file path: 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 : str 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 of some images. Parameters ---------- out_directory : str The path to the output directory. images : Dict[str, NDArray] The images. The keys should give the filters (or file names) and the values should be the images. 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 a 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, fltr, 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. fltr : str The filter. a : float The semimajor standard deviation of the PSF. b : float The semiminor standard deviation of the PSF. out_directory : str, 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 : str The light curve directory path. save_dir : str 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 : str 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, show, save) Plot the S/N for each source. Parameters ---------- out_directory : str The output directory. files : Dict[str, str] The reference files for each filter {filter: path to image}. 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}. photometer : BasePhotometer The photometer to use for measuring noise. 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, show, save) Plot the various noise contributions and compare them to the measured noise for a series of images. Parameters ---------- out_directory : str The output directory. files : Dict[str, str] The reference files for each filter {filter: path to image}. 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}. photometer : BasePhotometer The photometer to use for measuring noise. 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, fltr, show, save) Plot the specified aperture over each target source. Parameters ---------- out_directory : str 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. fltr : str The image filter. 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 The image data. cat : QTable The source catalog. psf_params : Dict[str, float] The PSF parameters. Returns ------- int The maximum region size.