plot_rays¶
- marxs.visualization.threejs.plot_rays(data, outfile, scalar=None, cmap=None, prop={})[source] [edit on github]¶
Plot lines for simulated rays.
- Parameters:
- datanp.array of shape(n, N, 3)
where n is the number of rays, N the number of positions per ray and the last dimension is the (x,y,z) of an Eukledian position vector.
- scalarNone or nd.array of shape (n,) or (n, N)
This quantity is used to color the rays. If
None
all rays will have the same color. If it has n elements, each ray will have exactly one color (e.g. color according to the energy of the ray), if it has n*N elements, rays will be multicolored.- outfilefile object
Output javascript code is written to this file.
- propdict
keyword arguments for line material.
- cmap
matplotlib.colors.Colormap
instance or string or None matplotlib
color maps are used to convertscalar
values to rgb colors. IfNone
the default matplotlib colormap will be used, otherwise the colormap can be specified in this keyword.