FDTD_Solver.plot_monitor
rfnetwork.solver.FDTD_Solver.plot_monitor
- FDTD_Solver.plot_monitor(monitor, linear=False, cmap='jet', style='surface', opacity='linear', init_time=None, max_vector_len=0.01, scale_vectors=True, camera_position='xy', vmin=None, vmax=None, zoom=1.0, show_rulers=True, show_mesh=True, colorbar_title=None, plotter=None, frequency=None, gif_setup=None, axes=None)
Show a field monitor overlayed on the model geometry. Time step of the fields is controlled with an interactive slider bar.
- Return type:
Plotter
Parameters
- monitorstr | list
monitor name(s) assigned with add_field_monitor.
- linearbool, default: False
if True, linear field magnitudes are plotted on the overlay. If False, values are converted to db20 before plotting.
- cmapstr, default: “jet”
matplotlib colormap name
- style{“surface”, “points”, “vectors”}, default: “surface”
Visualization style of the overlay. If “vectors”, monitor must be a total field monitor with three component vectors. Can be a list if multiple monitors are given. Values are interpolated for the “surface” style and shows a continuous overlay. Values are shown as non-interpolated, discrete points on the Yee grid if “points” is chosen.
- opacitystr | list, default: “linear”
Opacity of the field overlay. A float value from 0-1 can be provided, or a string can be specified to map the scalars range to a predefined opacity transfer function (options include: ‘linear’, ‘linear_r’, ‘geom’, ‘geom_r’). If multiple monitors are given, this can be a list to specify different opacities to each overlay.
- init_time_psfloat, optional
initial time in picosecond to use for the field overlays. Default is half of the simulation interval.
- max_vector_lenfloat, default: 0.01
maximum length of vectors in inches, should be chosen so the vectors are smaller than the average grid cell in the overlay to avoid overlapping. Ignored if style is not “surface”.
- scale_vectorsbool, default: True
scale the length of the vectors by the field magnitude. Ignored if style is not “surface”.
- camera_positionstr | pv.CameraPosition, default: “xy”
camera position, passed to pv.Plotter.camera_position
- vminfloat, optional
minimum field value shown on the colormap, must be in dB if linear is false.
- vmaxfloat, optional
maximum field value shown on the colormap, must be in dB if linear is false.
- zoomfloat, default: 1
camera zoom
- show_rulersbool, default: True
show the model bounding box with rulers
- show_meshbool, default: True
show the grid mesh
- colorbar_titlestr, optional
title above the colorbar
- plotterpv.Plotter, optional
pyvista Plotter object. If provided the model geometry is not drawn on the plot and needs to be drawn manually with render().
- frequencyfloat, optional
If monitors are phasors, specify the frequency to plot. Only required if monitor contains more than 1 frequency.
- gif_setupdict, optional
Configuration settings for .gif generation. The required key/value pair is “file”, the others are optional. - file : file path for .gif file (must end in .gif) - fps : frame per second, default: 15 - loop : number of times to loop, default: 0 (infinite loop) - start_ps : starting time of gif, in picoseconds. Default: 0 - end_ps : ending time of gif, in picoseconds. Default: end of simulation - step_ps : number of time steps to skip between in each frame, in picoseconds. Default: 1
- axesmatplotlib.axes.Axes
matplotlib axes object. If provided, a screenshot is taken of the rendered image at init_time_ps and drawn in the the axes.
Returns
- pv.Plotter
pyvista Plotter object. Plotter is closed and cannot be reopened if gif_setup is provided.