Analysis Plotting Functions#

These functions are for plotting/displaying the results of invoking code of Analysis Functions.

skZemax.skZemax_subfunctions._analyses_plotting_functions.AnalysesPlotting_FFTMTF(self, fftmtf_X, fftmtf_Y, in_ax=None, title: str | None = None) None[source]#

Just calls AnalysesPlotting_LinePlotByField() with explicit formatting for FFTMTF plot.

Parameters:
  • fftmtf_X (_type_) – x-data of MTF analysis

  • fftmtf_Y (_type_) – y-data of MTF analysis

  • in_ax (_type_, optional) – plotting axis (will make one if not given), defaults to None

  • title (str, optional) – Title of plot, defaults to None

skZemax.skZemax_subfunctions._analyses_plotting_functions.AnalysesPlotting_LinePlotByField(self, X_data: ndarray, Y_data: ndarray, in_ax=None, line_style_label: str = '', line_style: str = '-', make_legend_labels: bool = True, line_colors: list | None = None) None[source]#

Line plotting function for some set of data x-y data which is separated by field.

If number of fields in data is more than the system fields, assumes the first index is diffraction limited data.

Parameters:
  • X_data (np.ndarray) – x_axis data [angular fields, x_data]

  • Y_data (np.ndarray) – x_axis data [angular fields, y_data]

  • in_ax (_type_, optional) – plotting axis (will make one if not given), defaults to None

  • line_style_label (str, optional) – if len(line_style_label)>0, will make label for type of line style, defaults to ‘’

  • line_style (str, optional) – line style of plotted lines, defaults to ‘-’

  • make_legend_labels (bool, optional) – if will make any labels for a legend, defaults to True

  • line_colors (_type_, optional) – line colors for each field angle, defaults to [‘tab:blue’, ‘tab:orange’, ‘tab:green’, ‘tab:red’, ‘tab:purple’, ‘tab:brown’, ‘tab:pink’, ‘tab:gray’, ‘tab:olive’, ‘tab:cyan’]

skZemax.skZemax_subfunctions._analyses_plotting_functions.AnalysisPlotting_Footprint(self, in_footprint_xarray: Dataset, ax: Axes = None, color_by_idx: int = 0) None[source]#

This function reproduces a footprint plot using the output of Analyses_Footprint()

Note that this footprint information does not capture any footprint descriptions beyond plotting an ellipse. Any more realistic ray-tracing is lost through the ZOS-API and needs to be examined directly in Zemax.

Parameters:
  • in_footprint_xarray (xr.Dataset) – Output of Analyses_Footprint().

  • ax (plt.Axes, optional) – axis to put the footprint plot on, defaults to None (makes a new plot)

  • color_by_idx (int, optional) – How to color the footprint plot. 0=configuration, 1=wavelength, 2=field, defaults to 0

skZemax.skZemax_subfunctions._analyses_plotting_functions.get_colormap(num_lines: int, should_reverse: bool = False, cmap_type='viridis') ndarray[source]#

Gets an array of color values for plotting based on a colormap.

Parameters:
  • num_lines – number of lines you plan to plot

  • should_reverse – If true will return the color map in inverse order

Returns:

colormap array