This section contains a list of public PyPO methods which are used for visualising systems, elements, frames and PO fields/currents.
More...
Functions | |
| tuple[pt.Figure, pt.Axes] | PyPO.System.System.plotBeamCut (self, str name_field, FieldComponents comp, float vmin=None, float vmax=None, bool center=True, bool align=True, Scales scale=Scales.dB, Units units=Units.DEG, str name="", bool show=True, bool save=False, bool ret=False) |
| Plot beam pattern cross sections. More... | |
| tuple[pt.Figure, pt.Axes] | PyPO.System.System.plotBeam2D (self, str name_obj, FieldComponents comp=FieldComponents.NONE, str contour=None, fieldOrCurrentComponents contour_comp=FieldComponents.NONE, float vmin=None, float vmax=None, contourLevels levels=None, bool show=True, bool amp_only=False, bool save=False, bool norm=True, dict aperDict=None, Scales scale=Scales.dB, Projections project=Projections.xy, Units units=Units.MM, str name="", str titleA="Power", str titleP="Phase", bool unwrap_phase=False, bool ret=False) |
| Generate a 2D plot of a PO (scalar)field or current. More... | |
| tuple[pt.Figure, pt.Axes] | PyPO.System.System.plot3D (self, str name_surface, cm cmap=cm.cool, bool norm=False, int fine=2, bool show=True, bool foc1=False, bool foc2=False, bool save=False, bool ret=False) |
| Plot a 3D reflector. More... | |
| tuple[pt.Figure, pt.Axes] | PyPO.System.System.plotSystem (self, cm cmap=cm.cool, bool norm=False, int fine=2, bool show=True, bool foc1=False, bool foc2=False, bool save=False, bool ret=False, list[str] select=None, list[str] RTframes=None, str RTcolor="black") |
| Plot the current system. More... | |
| tuple[pt.Figure, pt.Axes] | PyPO.System.System.plotGroup (self, str name_group, bool show=True, bool ret=False) |
| Plot a group of reflectors. More... | |
| def | PyPO.System.System.plotRTframe (self, str name_frame, Projections project=Projections.xy, bool ret=False, float aspect=1, Units units=Units.MM) |
| Create a spot diagram of a ray-trace frame. More... | |
This section contains a list of public PyPO methods which are used for visualising systems, elements, frames and PO fields/currents.
| tuple[pt.Figure, pt.Axes] PyPO.System.System.plot3D | ( | self, | |
| str | name_surface, | ||
| cm | cmap = cm.cool, |
||
| bool | norm = False, |
||
| int | fine = 2, |
||
| bool | show = True, |
||
| bool | foc1 = False, |
||
| bool | foc2 = False, |
||
| bool | save = False, |
||
| bool | 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. |
| tuple[pt.Figure, pt.Axes] PyPO.System.System.plotBeam2D | ( | self, | |
| str | name_obj, | ||
| FieldComponents | comp = FieldComponents.NONE, |
||
| str | contour = None, |
||
| fieldOrCurrentComponents | contour_comp = FieldComponents.NONE, |
||
| float | vmin = None, |
||
| float | vmax = None, |
||
| contourLevels | levels = None, |
||
| bool | show = True, |
||
| bool | amp_only = False, |
||
| bool | save = False, |
||
| bool | norm = True, |
||
| dict | aperDict = None, |
||
| Scales | scale = Scales.dB, |
||
| Projections | project = Projections.xy, |
||
| Units | units = Units.MM, |
||
| str | name = "", |
||
| str | titleA = "Power", |
||
| str | titleP = "Phase", |
||
| bool | unwrap_phase = False, |
||
| bool | 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. |
| 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. |
| scale | Plot amplitude in linear or decibel values. Instance of Scales 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. Default is False. |
| tuple[pt.Figure, pt.Axes] PyPO.System.System.plotBeamCut | ( | self, | |
| str | name_field, | ||
| FieldComponents | comp, | ||
| float | vmin = None, |
||
| float | vmax = None, |
||
| bool | center = True, |
||
| bool | align = True, |
||
| Scales | scale = Scales.dB, |
||
| Units | units = Units.DEG, |
||
| str | name = "", |
||
| bool | show = True, |
||
| bool | save = False, |
||
| bool | 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 should 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. |
| scale | 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. Default is False. |
| tuple[pt.Figure, pt.Axes] PyPO.System.System.plotGroup | ( | self, | |
| str | name_group, | ||
| bool | show = True, |
||
| bool | 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. |
| def PyPO.System.System.plotRTframe | ( | self, | |
| str | name_frame, | ||
| Projections | project = Projections.xy, |
||
| bool | ret = False, |
||
| float | aspect = 1, |
||
| Units | 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. |
| tuple[pt.Figure, pt.Axes] PyPO.System.System.plotSystem | ( | self, | |
| cm | cmap = cm.cool, |
||
| bool | norm = False, |
||
| int | fine = 2, |
||
| bool | show = True, |
||
| bool | foc1 = False, |
||
| bool | foc2 = False, |
||
| bool | save = False, |
||
| bool | ret = False, |
||
| list[str] | select = None, |
||
| list[str] | RTframes = None, |
||
| str | 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. |