exosim.plots.focalPlanePlotter#

Attributes#

Classes#

FocalPlanePlotter

Focal plane plotter.

Module Contents#

cmap_band[source]#
cmap[source]#
class FocalPlanePlotter(input)[source]#

Bases: exosim.log.Logger

Focal plane plotter. This class handles the methods to plot the focal palnes produced by exosim.

Variables:
Parameters:

input (str) –

Examples

The following example, given the test_file.h5 produced by exosim, plots the focal plane at the first time stamp and stores the figure as focal_plane.png.

>>> from exosim.plots import FocalPlanePlotter
>>> focalPlanePlotter = FocalPlanePlotter(input='./test_file.h5')
>>> focalPlanePlotter.plot_focal_plane(time_step=0)
>>> focalPlanePlotter.save_fig('focal_plane.png')
load_focal_plane(ch, time_step)[source]#

It loads the channel focal plane from the input file:

Parameters:
  • ch (str) – channel name

  • time_step (int) – time step to plot

Returns:

Return type:

Tuple[numpy.ndarray, int]

plot_focal_plane(time_step=0, scale='linear')[source]#

It plots the focal planes at a specific time. For each channel it adds a Axes to a figure. It returns a Figure with two rows: on the first row are reported the oversampled focal planes. In the second row are reported the extracted focal plane, where the oversampling is removed. The focal plane plotted is the combination of the source focal plane plus the foreground focal plane.

Parameters:
  • time_step (int) – time step identifier

  • scale (str (optional)) – scale to use for the plot. If ‘dB’ the plot is in dB. Default is ‘linear’.

Returns:

populated figure

Return type:

matplotlib.figure.Figure

plot_bands(ax, scale='log', channel_edges=True, add_legend=True)[source]#

It plots the channels bands behind the indicated axes.

Parameters:
  • ax (matplotlib.axes.Axes) – axes where to plot the bands

  • scale (str) – x axes scale. Default is log.

  • channel_edges (bool) – if True the x axes ticks are placed at the channel edges. Default is True.

  • add_legend (bool) –

Returns:

axes with channel bands added

Return type:

matplotlib.axes.Axes

plot_efficiency(scale='log', channel_edges=False, ch_lengend=False, efficiency='all')[source]#

It produces a figure with efficiencies for the input table.

Parameters:
  • scale (str) – x axes scale. Default is log.

  • channel_edges (bool) – if True the x axes ticks are placed at the channel edges. Default is True.

  • ch_lengend (bool) – if True add a legend for the channels color. Default is True.

  • efficiency (str) – what efficiency to plot. Options are “optical efficiency”, “responsivity”, “quantum efficiency”, “photon conversion efficiency” and “all”. Default is “all”.

Returns:

Return type:

Tuple[matplotlib.pyplot.Figure, List[matplotlib.axes.Axes]]

save_fig(name)[source]#

It saves the produced figure.

Parameters:

name (str) – figure name

Return type:

None