This section contains a list of public PyPO
methods which are used for visualising systems, elements, frames and PO fields/currents.
More...
Functions | |
PyPO.System.System.plotBeamCut (self, name_field, comp, comp_cross=FieldComponents.NONE, vmin=None, vmax=None, center=True, align=True, mode=Modes.dB, units=Units.DEG, name="", show=True, save=False, ret=False) | |
Plot beam pattern cross sections. | |
PyPO.System.System.plotBeam2D (self, name_obj, comp=FieldComponents.NONE, contour=None, contour_comp=FieldComponents.NONE, vmin=None, vmax=None, levels=None, show=True, amp_only=False, save=False, interpolation=None, norm=True, aperDict=None, mode=Modes.dB, project=Projections.xy, units=Units.MM, name="", titleA="Power", titleP="Phase", unwrap_phase=False, ret=False) | |
Generate a 2D plot of a PO (scalar)field or current. | |
PyPO.System.System.plot3D (self, name_surface, cmap=cm.cool, norm=False, fine=2, show=True, foc1=False, foc2=False, save=False, ret=False) | |
Plot a 3D reflector. | |
PyPO.System.System.plotSystem (self, cmap=cm.cool, norm=False, fine=2, show=True, foc1=False, foc2=False, save=False, ret=False, select=None, RTframes=None, RTcolor="black") | |
Plot the current system. | |
PyPO.System.System.plotGroup (self, name_group, show=True, ret=False) | |
Plot a group of reflectors. | |
PyPO.System.System.plotRTframe (self, name_frame, project=Projections.xy, ret=False, aspect=1, units=Units.MM) | |
Create a spot diagram of a ray-trace frame. | |
This section contains a list of public PyPO
methods which are used for visualising systems, elements, frames and PO fields/currents.
PyPO.System.System.plot3D | ( | self, | |
name_surface, | |||
cmap = cm.cool, | |||
norm = False, | |||
fine = 2, | |||
show = True, | |||
foc1 = False, | |||
foc2 = False, | |||
save = False, | |||
ret = False ) |
Plot a 3D reflector.
Note that matplotlib offers custom control over figures in the matplotlib window. This means that most parameters described for this method can be adjusted in the matplotlib plotting window.
name_surface | Name of reflector to plot. |
cmap | Colormap of reflector. Default is cool. |
norm | Plot reflector normals. Default is False. |
fine | Spacing of normals for plotting. Default is 2. |
show | Show plot. Default is True. |
foc1 | Plot focus 1. Default is False. |
foc2 | Plot focus 2. Default is False. |
save | Save the plot. |
ret | Return Figure and Axis. Only used in GUI. |
PyPO.System.System.plotBeam2D | ( | self, | |
name_obj, | |||
comp = FieldComponents.NONE, | |||
contour = None, | |||
contour_comp = FieldComponents.NONE, | |||
vmin = None, | |||
vmax = None, | |||
levels = None, | |||
show = True, | |||
amp_only = False, | |||
save = False, | |||
interpolation = None, | |||
norm = True, | |||
aperDict = None, | |||
mode = Modes.dB, | |||
project = Projections.xy, | |||
units = Units.MM, | |||
name = "", | |||
titleA = "Power", | |||
titleP = "Phase", | |||
unwrap_phase = False, | |||
ret = False ) |
Generate a 2D plot of a PO (scalar)field or current.
Note that matplotlib offers custom control over figures in the matplotlib window. This means that most parameters described for this method can be adjusted in the matplotlib plotting window.
name_obj | Name of field or current to plot. |
comp | Component of field or current to plot. String of two characters; an uppercase {E, H, J, M} for field followed by a lowercase {x, y, z} for component. (e.g: 'Jz') |
contour | A PyPO field or current component to plot as contour. |
contour_comp | Component of contour to plot as contour. If None, assumes the contour is a scalarfield. |
vmin | Minimum amplitude value to display. Default is -30. |
vmax | Maximum amplitude value to display. Default is 0. |
levels | Levels for contourplot. |
show | Show plot. Default is True. |
amp_only | Only plot amplitude pattern. Default is False. |
save | Save plot to /images/ folder. |
interpolation | What interpolation to use for displaying amplitude pattern. Default is None. |
norm | Normalise field (only relevant when plotting linear scale). Default is True. |
aperDict | Plot an aperture defined in an aperDict object along with the field or current patterns. Default is None. |
mode | Plot amplitude in linear or decibel values. Instance of Modes enum object. |
project | Set abscissa and ordinate of plot. Should be given as an instance of the Projection enum. Default is Projection.xy. |
units | The units of the axes. Instance of Units enum object. |
name | Name of .png file where plot is saved. Only when save=True. Default is "". |
titleA | Title of the amplitude plot. Default is "Amp". |
titleP | Title of the phase plot. Default is "Phase". |
unwrap_phase | Unwrap the phase patter. Prevents annular structure in phase pattern. Default is False. |
ret | Return the Figure and Axis object. Only called by GUI. Default is False. |
PyPO.System.System.plotBeamCut | ( | self, | |
name_field, | |||
comp, | |||
comp_cross = FieldComponents.NONE, | |||
vmin = None, | |||
vmax = None, | |||
center = True, | |||
align = True, | |||
mode = Modes.dB, | |||
units = Units.DEG, | |||
name = "", | |||
show = True, | |||
save = False, | |||
ret = False ) |
Plot beam pattern cross sections.
Plot the beam cross sections for a PO field. In this case, calcBeamCuts() will try to translate and rotate the supplied beam pattern to lie along the x- and y-axes. Note that using the "center" and "align" arguments sgould not be done when plotting beam cuts of very non-Gaussian beams. For these patterns, it is advised to set the arguments to False and calculate the beam cuts as-is.
name_field | Name of field object. |
comp | Component of field object. Instance of FieldComponents enum object. |
comp_cross | Cross-polar component. If given, is plotted as well. Defaults to None. |
vmin | Minimum amplitude value to display. Default is -30. |
vmax | Maximum amplitude value to display. Default is 0. |
center | Whether to calculate beam center and center the beam cuts on this point. |
align | Whether to find position angle of beam cuts and align cut axes to this. |
mode | Plot in decibels or linear. |
units | The units of the axes. Instance of Units enum object. |
name | Name of .png file where plot is saved. Only when save=True. Default is "". |
show | Show plot. Default is True. |
save | Save plot to savePath. |
ret | Return the Figure and Axis object. Only called by GUI. Default is False. |
PyPO.System.System.plotGroup | ( | self, | |
name_group, | |||
show = True, | |||
ret = False ) |
Plot a group of reflectors.
Note that matplotlib offers custom control over figures in the matplotlib window. This means that most parameters described for this method can be adjusted in the matplotlib plotting window.
name_group | Name of group to be plotted. |
show | Show the plot. |
ret | Whether to return figure and axis. |
PyPO.System.System.plotRTframe | ( | self, | |
name_frame, | |||
project = Projections.xy, | |||
ret = False, | |||
aspect = 1, | |||
units = Units.MM ) |
Create a spot diagram of a ray-trace frame.
Note that matplotlib offers custom control over figures in the matplotlib window. This means that most parameters described for this method can be adjusted in the matplotlib plotting window.
name_frame | Name of frame to plot. |
project | Set abscissa and ordinate of plot. Should be given as an instance of the Projection enum. Default is Projection.xy. |
ret | Return Figure and Axis. Default is False. |
aspect | Aspect ratio of plot. Default is 1. |
units | Units of the axes for the plot. Instance of Units enum object. |
PyPO.System.System.plotSystem | ( | self, | |
cmap = cm.cool, | |||
norm = False, | |||
fine = 2, | |||
show = True, | |||
foc1 = False, | |||
foc2 = False, | |||
save = False, | |||
ret = False, | |||
select = None, | |||
RTframes = None, | |||
RTcolor = "black" ) |
Plot the current system.
Plots the reflectors and optionally ray-trace frames in a 3D plot.
The ray-trace frames to plot are supplied as a list to the "RTframes" parameter. Note that matplotlib offers custom control over figures in the matplotlib window. This means that most parameters described for this method can be adjusted in the matplotlib plotting window.
name_surface | Name of reflector to plot. |
cmap | Colormap of reflector. Default is cool. |
norm | Plot reflector normals. Default is False. |
fine | Spacing of normals for plotting. Default is 2. |
show | Show plot. Default is True. |
foc1 | Plot focus 1. Default is False. |
foc2 | Plot focus 2. Default is False. |
save | Save the plot. |
ret | Return Figure and Axis. Only used in GUI. |
select | A list of names of reflectors to plot. If not given, plot all reflectors. |
RTframes | A list of names of frame to plot. If not given, plot no ray-trace frames. |