opticam.plotting.plots

Functions

plot_catalogs(out_directory, stacked_images, catalogs, ...)

Plot the source catalogs.

plot_time_between_files(out_directory, camera_files, ...)

Plot the times between files. Useful for identifying gaps.

plot_backgrounds(out_directory, t_ref, show, save)

Plot the time-varying background for each camera.

plot_background_meshes(out_directory, images, ...)

Plot the background mesh on top of some images.

plot_growth_curves(image, cat, targets, psf_params)

Plot the growth curves given a (stacked) image and a source catalog.

plot_psf(catalog, source_indx, stacked_image, fltr, a, ...)

Plot the PSF for given source.

plot_rms_vs_median_flux(lc_dir, save_dir, phot_label)

Plot the RMS as a function of the median flux for all catalog sources.

get_lc_rms_and_flux_dict(lc_dir)

Get the RMS and median flux for a series of light curves.

plot_snrs(out_directory, files, background, ...)

Plot the S/N for each source.

plot_noise(out_directory, files, background, ...)

Plot the various noise contributions and compare them to the measured noise for a series of images.

plot_apertures(out_directory, data, cat, targets, ...)

Plot the specified aperture over each target source.

get_max_region_size(targets, photometer, data, cat, ...)

Get the maximum region size for plotting apertures.

Module Contents

opticam.plotting.plots.plot_catalogs(out_directory, stacked_images, catalogs, show, save)

Plot the source catalogs.

Parameters

out_directorystr

The directory path to which the resulting plot will be saved.

filtersList[str]

The catalog filters.

stacked_imagesDict[str, NDArray]

The stacked images for each filter {filter: image}.

showbool

Whether to show the plot.

savebool

Whether to save the plot.

Parameters:
  • out_directory (str)

  • stacked_images (Dict[str, numpy.typing.NDArray])

  • catalogs (Dict[str, astropy.table.QTable])

  • show (bool)

  • save (bool)

Return type:

None

opticam.plotting.plots.plot_time_between_files(out_directory, camera_files, bmjds, show, save)

Plot the times between files. Useful for identifying gaps.

Parameters

out_directorystr

The directory path to which the resulting plot will be saved.

camera_filesDict[str, List[str]]

The file paths separated by camera {filter: file paths}.

bmjdsDict[str, float]

The file time stamps {file path: time stamp}.

showbool

Whether to show the plot.

savebool

Whether to save the plot.

Parameters:
  • out_directory (str)

  • camera_files (Dict[str, List[str]])

  • bmjds (Dict[str, float])

  • show (bool)

  • save (bool)

Return type:

None

opticam.plotting.plots.plot_backgrounds(out_directory, t_ref, show, save)

Plot the time-varying background for each camera.

Parameters

out_directorystr

The directory to which the background files, and where the resulting plot will be saved if save=True.

t_reffloat

The reference BMJD.

show: bool

Whether to display the plot.

savebool

Whether to save the plot.

Parameters:
  • out_directory (str)

  • t_ref (float)

  • show (bool)

  • save (bool)

Return type:

None

opticam.plotting.plots.plot_background_meshes(out_directory, images, background, show, save)

Plot the background mesh on top of some images.

Parameters

out_directorystr

The path to the output directory.

imagesDict[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.

showbool

Whether to show the plot.

savebool

Whether to save the plot.

Parameters:
Return type:

None

opticam.plotting.plots.plot_growth_curves(image, cat, targets, psf_params)

Plot the growth curves given a (stacked) image and a source catalog.

Parameters

imageNDArray

The image.

catQTable

The catalog corresponding to image.

targetsint | List[int]

The target(s) for which growth curves are to be computed.

psf_paramsDict

The PSF parameters.

Returns

Figure

The growth curve plots.

Parameters:
  • image (numpy.typing.NDArray)

  • cat (astropy.table.QTable)

  • targets (int | List[int])

  • psf_params (Dict)

Return type:

matplotlib.figure.Figure

opticam.plotting.plots.plot_psf(catalog, source_indx, stacked_image, fltr, a, b, out_directory)

Plot the PSF for given source.

Parameters

catalogQTable

The source catalog.

source_indxint

The index of the source in the catalog.

stacked_imageNDArray

The catalog image.

fltrstr

The filter.

afloat

The semimajor standard deviation of the PSF.

bfloat

The semiminor standard deviation of the PSF.

out_directorystr,

The save path.

Parameters:
  • catalog (astropy.table.QTable)

  • source_indx (int)

  • stacked_image (numpy.typing.NDArray)

  • fltr (str)

  • a (float)

  • b (float)

  • out_directory (str)

Return type:

None

opticam.plotting.plots.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_dirstr

The light curve directory path.

save_dirstr

The output directory path.

phot_labelstr

The photometry label.

showbool, optional

Whether to show the plot, by default True.

Parameters:
  • lc_dir (str)

  • save_dir (str)

  • phot_label (str)

  • show (bool)

Return type:

None

opticam.plotting.plots.get_lc_rms_and_flux_dict(lc_dir)

Get the RMS and median flux for a series of light curves.

Parameters

lc_dirstr

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.

Parameters:

lc_dir (str)

Return type:

Dict[str, Dict[str, Dict[str, float]]]

opticam.plotting.plots.plot_snrs(out_directory, files, background, psf_params, catalogs, show, save)

Plot the S/N for each source.

Parameters

out_directorystr

The output directory.

filesDict[str, str]

The reference files for each filter {filter: path to image}.

backgroundBaseBackground | Callable

The global background estimator.

psf_paramsDict[str, Dict[str, float]]

The PSF parameters for each filter {filter: psf parameters}.

catalogsDict[str, QTable]

The catalogs for each filter {filter: catalog}.

photometerBasePhotometer

The photometer to use for measuring noise.

showbool

Whether to show the plot.

savebool

Whether to save the plot.

Parameters:
opticam.plotting.plots.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_directorystr

The output directory.

filesDict[str, str]

The reference files for each filter {filter: path to image}.

backgroundBaseBackground | Callable

The global background estimator.

psf_paramsDict[str, Dict[str, float]]

The PSF parameters for each filter {filter: psf parameters}.

catalogsDict[str, QTable]

The catalogs for each filter {filter: catalog}.

photometerBasePhotometer

The photometer to use for measuring noise.

showbool

Whether to show the plot.

savebool

Whether to save the plot.

Parameters:
opticam.plotting.plots.plot_apertures(out_directory, data, cat, targets, photometer, psf_params, fltr, show, save)

Plot the specified aperture over each target source.

Parameters

out_directorystr

The output directory. Used to save the plot if save=True.

dataNDArray

The image data.

catQTable

The source catalog.

targetsList[int] | int

The target IDs to plot apertures for.

photometerAperturePhotometer

The AperturePhotometer instance.

psf_paramsDict[str, float]

The PSF parameters.

fltrstr

The image filter.

showbool

Whether to show the plot.

savebool

Whether to save the plot. If true, the plot is saved to out_directory/diag/apertures/fltr_apertures.pdf.

Parameters:
  • out_directory (str)

  • data (numpy.typing.NDArray)

  • cat (astropy.table.QTable)

  • targets (List[int] | int)

  • photometer (opticam.photometers.AperturePhotometer)

  • psf_params (Dict[str, float])

  • fltr (str)

  • show (bool)

  • save (bool)

opticam.plotting.plots.get_max_region_size(targets, photometer, data, cat, psf_params)

Get the maximum region size for plotting apertures.

Parameters

targetsList[int]

The target source IDs.

photometerAperturePhotometer

The AperturePhotometer instance.

dataNDArray

The image data.

catQTable

The source catalog.

psf_paramsDict[str, float]

The PSF parameters.

Returns

int

The maximum region size.

Parameters:
Return type:

int