These are a set of routines for 3D visualization using the plotly library.


Example code for using this module within a Jupyter notebook.

plot(results, **kwargs)[source]

Create a 3d plot using default options.

Any keywords provided will be passed to add_rays. For more control over plotting options it is recommended to perform the plotting steps manually as shown by the example in the xicsrt_3d module docstring.

figure(showbackground=False, visible=False)[source]
add_rays(results, **kwargs)[source]
add_optics(config, figure=None, **kwargs)[source]
add_sources(config, figure=None, **kwargs)[source]
add_fluxsurfaces(config, figure=None, **kwargs)[source]
add_object(config, name, section, figure=None, **kwargs)[source]

Private Members

_add_fluxsurf_single(config, name, section=None, figure=None, alpha=None, flatshading=None, **kwargs)[source]

Plot the 3D flux surfaces of a plasma source. This should work for any object that has a ‘car_from_flx’ method.

_add_trace_mesh(obj, figure=None, name=None)[source]

Add a meshgrid to the 3D plot.

_add_trace_volume(obj, figure, name=None, opacity=0.5)[source]
_gen_fluxsurface_mesh(obj, s, range_m=None, range_n=None)[source]

Generate points on a flux surface. The given input object must have a method ‘car_from_flx’.

_make_plotly_color(color, alpha=None)[source]
_plot_ray_history(history, lost=None, figure=None, color=None, lost_color=None, found_color=None)[source]
_thin_mask(mask, max_num)[source]

Reduce the number of True elements in a mask array.

Ray thinning is done randomly. Used to reduce the number of rays plotted.