PyPO User Manual
Plotter.py File Reference

File containing functions for generating plots. More...

Functions

def PyPO.Plotter.plotBeam2D (plotObject, field, contour, vmin, vmax, levels, amp_only, norm, aperDict, scale, project, units, titleA, titleP, unwrap_phase)
 Generate a 2D plot of a field or current. More...
 
def PyPO.Plotter.plot3D (plotObject, ax, fine, cmap, norm, foc1, foc2, plotSystem_f=False)
 Plot a 3D reflector. More...
 
def PyPO.Plotter.plotSystem (systemDict, ax, fine, cmap, norm, foc1, foc2, RTframes, RTcolor)
 Plot the system. More...
 
def PyPO.Plotter.plotBeamCut (x_cut, y_cut, x_strip, y_strip, vmin, vmax, units)
 Plot two beam cuts in the same figure. More...
 
def PyPO.Plotter.plotRTframe (frame, project, savePath, returns, aspect, units)
 Plot a ray-trace frame spot diagram. More...
 

Detailed Description

File containing functions for generating plots.

Function Documentation

◆ plot3D()

def PyPO.Plotter.plot3D (   plotObject,
  ax,
  fine,
  cmap,
  norm,
  foc1,
  foc2,
  plotSystem_f = False 
)

Plot a 3D reflector.

Parameters
plotObjectA reflDict containing surface on which to plot beam.
axAxis to use for plotting.
fineSpacing of normals for plotting.
cmapColormap of reflector.
normPlot reflector normals.
foc1Plot focus 1.
foc2Plot focus 2.
plotSystem_fWhether or not plot3D is called from plotSystem.

◆ plotBeam2D()

def PyPO.Plotter.plotBeam2D (   plotObject,
  field,
  contour,
  vmin,
  vmax,
  levels,
  amp_only,
  norm,
  aperDict,
  scale,
  project,
  units,
  titleA,
  titleP,
  unwrap_phase 
)

Generate a 2D plot of a field or current.

Parameters
plotObjectA reflDict containing surface on which to plot beam.
fieldPyPO field or current component to plot.
contourA PyPO field or current component to plot as contour.
vminMinimum amplitude value to display. Default is -30.
vmaxMaximum amplitude value to display. Default is 0.
levelsLevels for contourplot.
amp_onlyOnly plot amplitude pattern. Default is False.
normNormalise field (only relevant when plotting linear scale).
aperDictPlot an aperture defined in an aperDict object along with the field or current patterns. Default is None.
scalePlot amplitude in decibels, logarithmic or linear scale. Instance of Scales enum object.
projectSet abscissa and ordinate of plot. Should be given as an instance of the Projection enum.
unitsThe units of the axes. Instance of Units enum object.
titleATitle of the amplitude plot. Default is "Amp".
titlePTitle of the phase plot. Default is "Phase".
unwrap_phaseUnwrap the phase patter. Prevents annular structure in phase pattern. Default is False.
Returns
fig Figure object containing plot.
ax Axes containing the axes of the plot.
See also
aperDict

◆ plotBeamCut()

def PyPO.Plotter.plotBeamCut (   x_cut,
  y_cut,
  x_strip,
  y_strip,
  vmin,
  vmax,
  units 
)

Plot two beam cuts in the same figure.

Parameters
x_cutE-plane.
y_cutH-plane.
x_stripCo-ordinates for plotting E-plane.
y_stripCo-ordinates for plotting H-plane.
vminMinimum for plot range.
vmaxMaximum for plot range.
unitsUnit for x-axis. Instance of Units enum object.
Returns
fig Plot figure.
ax Plot axis.

◆ plotRTframe()

def PyPO.Plotter.plotRTframe (   frame,
  project,
  savePath,
  returns,
  aspect,
  units 
)

Plot a ray-trace frame spot diagram.

Parameters
frameA PyPO frame object.
projectSet abscissa and ordinate of plot. Should be given as an instance of the Projection enum.
savePathPath to save plot to.
returnsWhether to return figure object.
aspectAspect ratio of plot.
unitsUnits of the axes for the plot. Instance of Units enum object.

◆ plotSystem()

def PyPO.Plotter.plotSystem (   systemDict,
  ax,
  fine,
  cmap,
  norm,
  foc1,
  foc2,
  RTframes,
  RTcolor 
)

Plot the system.

Parameters
systemDictDictionary containing the reflectors to be plotted.
axAxis of plot.
fineSpacing of normals for plotting.
cmapColormap of reflector.
normPlot reflector normals.
foc1Plot focus 1.
foc2Plot focus 2.
RTframesList containing frames to be plotted.