ocelot.gui.dfl_plot
¶
user interface for viewing radiation field
Module Contents¶
Functions¶
|
plots given RadiationField() object in 4 domain combinations |
|
Plots dfl radiation object in 3d using matplotlib. |
|
Plots wigner distribution (WD) with marginals |
|
|
|
plots TransferFunction() object, |
|
|
|
|
|
Plot 6 images with normalized Stokes parameters on them |
|
Plot normalized intensity and angle of the linear polarization of the light |
|
Plot normalized Stokes parameter S3 |
|
|
|
This function plotting the height map and PSD of HeightProfile object |
-
ocelot.gui.dfl_plot.
_logger
¶
-
ocelot.gui.dfl_plot.
plot_dfl_all
(dfl, **kwargs)¶ plots given RadiationField() object in 4 domain combinations
-
ocelot.gui.dfl_plot.
plot_dfl
(dfl, domains=None, z_lim=[], xy_lim=[], figsize=4, cmap=def_cmap, legend=True, phase=False, fig_name=None, auto_zoom=False, column_3d=True, savefig=False, showfig=True, return_proj=False, line_off_xy=True, slice_xy=False, log_scale=0, cmap_cutoff=0, vartype_dfl=None, **kwargs)¶ Plots dfl radiation object in 3d using matplotlib.
- Parameters
dfl – RadiationField() object
domains – longitudinal domain + transverse domain (‘t’ or ‘f’ + ‘s’ or ‘k’) (example: ‘tk’ - time/inversespace domain)
z_lim – sets the boundaries to CUT the dfl object in z to ranges of e.g. [2,5] um or nm depending on freq_domain=False of True
xy_lim – sets the boundaries to SCALE the dfl object in x and y to ranges of e.g. [2,5] um or urad depending on far_field=False of True
figsize – rescales the size of the figure
cmap – color map which will be used for plotting (http://matplotlib.org/users/colormaps.html)
legend – not used yet
phase – bool type variable, can replace Z projection or spectrum with phase front distribution z dimensions correspondingly
fig_name – the desired name of the output figure, would be used as suffix to the image filename if savefig==True
auto_zoom – bool type variable, automatically scales xyz the images to the (1%?) of the intensity limits
column_3d – bool type variable, plots top and side views of the radiation distribution
savefig – bool type variable, allow to save figure to image (savefig=’png’ (default) or savefig=’eps’, etc…)
showfig – bool type variable, allow to display figure (slower)
return_proj – bool type variable, returns [xy_proj,yz_proj,xz_proj,x,y,z] array.
line_off_xy – bool type variable, if True, the transverse size of radiation are calculated at x=0 and y=0 position, otherwise marginal distribution are used
slice_xy – bool type variable, if True, slices will be plotted; if False, projections will be plotted
log_scale – bool type variable, if True, log scale will be used for potting
cmap_cutoff – 0 <= cmap_cutoff <= 1; all pixels that have intensity lower than cmap_cutoff will be seted to white color
vartype_dfl – the data type to store dfl in memory [either complex128 (two 64-bit floats) or complex64 (two 32-bit floats)], may save memory
kwargs –
- Returns
-
ocelot.gui.dfl_plot.
plot_wigner
(wig_or_out, z=np.inf, x_units='um', y_units='ev', x_lim=None, None, y_lim=None, None, downsample=1, autoscale=None, figsize=3, cmap='seismic', fig_name=None, savefig=False, showfig=True, plot_proj=1, plot_text=1, plot_moments=0, plot_cbar=0, log_scale=0, **kwargs)¶ Plots wigner distribution (WD) with marginals
- Parameters
wig_or_out – may be WignerDistribution() or GenesisOutput() object
z – (if isinstance(wig_or_out, GenesisOutput)) location at which WD will be calculated
x_units – [m or fs] units to display power scale
y_units – [nm or eV] units to display spectrum scale
x_lim – scaling limits for x in given units, (min,max) or [min,max], e.g: (None,6)
x_lim – scaling limits for y in given units, (min,max) or [min,max], e.g: (None,6)
downsample – speeds up plotting by displaying only 1/downsample**2 points
autoscale – find x_lim and x_lim values automatically. Only (values > max_value * autoscale) will be displayed
figsize – rescales the size of the figure
cmap – colormar (http://matplotlib.org/users/colormaps.html)
fig_name – the desired name of the output figure, would be used as suffix to the image filename if savefig==True
savefig – bool type variable, allow to save figure to image (savefig=’png’ (default) or savefig=’eps’, etc…)
showfig – bool type variable, allow to display figure (slower)
plot_proj – plot marginal distributions
plot_text – show text
plot_moments – plot moments as lines on top of Wigner distribution
plot_cbar – plots colorbar
log_scale – plots wigner distribution in logarithmic scale
kwargs –
- Returns
None
-
ocelot.gui.dfl_plot.
plot_dfl_waistscan
(sc_res, fig_name=None, figsize=4, showfig=True, savefig=False)¶
-
ocelot.gui.dfl_plot.
plot_trf
(trf, mode='tr', autoscale=0, showfig=True, savefig=None, fig_name=None)¶ plots TransferFunction() object, mode:
‘tr’ - transmission ‘ref’ - reflection
autoscale = scale down to several FWHMma in frequency and several bumps in time showfig - display on screen or not savefig - path to save png (if any)
-
ocelot.gui.dfl_plot.
plot_stokes_values
(S, fig=None, d_pol=0, norm=0, showfig=True, gw=1, direction='z', plot_func='step', **kwargs)¶
-
ocelot.gui.dfl_plot.
plot_stokes_angles
(S, fig=None, showfig=True, direction='z', plot_func='scatter')¶
-
ocelot.gui.dfl_plot.
plot_stokes_3d
(stk_params, x_plane='max_slice', y_plane='max_slice', z_plane='max_slice', interpolation=None, cmap_lin='brightwheel', cmap_circ='bwr', figsize=4, fig_name='Visualization Stokes parameters', normalization='s0_max', cbars=True, savefig=False, showfig=True, text_present=True, **kwargs)¶ Plot 6 images with normalized Stokes parameters on them
- Parameters
stk_params – 3d ocelot.optics.wave.StokesParameters() type object
x_plane – this variable responds on which value on x-axis the 3d stk_params will intersect. It can take 3 different recognition: ‘max_slice’: the intersection of 3d stk_params will contain the max value s0 in stk_params ‘proj’: at the third subplot will be shown the projection of 3d stk_params in x direction <number> in [m]: the position of intersection on x-axis
y_plane – this variable responds on which value on y-axis the 3d stk_params will intersect. It can take 3 different recognition: ‘max_slice’: the intersection of 3d stk_params will contain the max value s0 in stk_params ‘proj’: at the third subplot will be shown the projection of 3d stk_params in y direction <number> in [m]: the position of intersection on y-axis
z_plane – this variable responds on which value on z-axis the 3d stk_params will intersect. It can take 3 different recognition: ‘max_slice’: the intersection of 3d stk_params will contain the max value s0 in stk_params ‘proj’: at the third subplot will be shown the projection of 3d stk_params in z direction <number> in [m]: the position of intersection on z-axis
interpolation – str type variable wich responds for interpolation before plotting linear polarized part
cmap_lin – numpy array with shape (nwidth, nheight, 4) that contains the 4 rgba values in hue (width) and lightness (height). Can be obtained by a call to get_cmap2d(name). or: name where name is one of the following strings: ‘brightwheel’, ‘darkwheel’, ‘hardwheel’, ‘newwheel’, ‘smoothwheel’, ‘wheel’
:param cmap_circ:——————– :param figsize: size of the figure :param fig_name: name of the figure :param cbars: bool type variable which responds for showing of colorbars :param savefig: bool type variable which responds for saving of the figure :param showfig: bool type variable which responds for showing of the figure :param text_present: bool type variable which responds for showing text on subplots :param kwargs:
-
ocelot.gui.dfl_plot.
plot_stokes_sbfg_lin
(ax, stk_params, slice, plane, cmap2d='brightwheel', plot_title=None, x_label='', y_label='', result=0, text_present=True, interpolation=None, normalization='s0_max', **kwargs)¶ Plot normalized intensity and angle of the linear polarization of the light
- Parameters
ax – matplotlib.pyplot.AxesSubplot on which the data will be plotted
stk_params – 3d ocelot.optics.wave.StokesParameters() type object
plane – the direction in which the projection/intersection of {stk_params} will be done
slice – this variable responds on which value on {plane} direction the 3d stk_params will intersect. It can take 3 different recognition: ‘max_slice’: the intersection of 3d stk_params will contain the max value s0 in stk_params ‘proj’: at the third subplot will be shown the projection of 3d stk_params in {plane} direction <number> in [m]: the position of intersection on {plane} direction
cmap2d – numpy array with shape (nwidth, nheight, 4) that contains the 4 rgba values in hue (width) and lightness (height). Can be obtained by a call to get_cmap2d(name). or: name where name is one of the following strings: ‘brightwheel’, ‘darkwheel’, ‘hardwheel’, ‘newwheel’, ‘smoothwheel’, ‘wheel’
plot_title – title of the plot
x_label – label of the x axis
y_label – label of the y axis
result – a bool type variable; if bool == True the function will return linear_plt of AxesImage type
text_present – bool type variable which responds for showing text on subplots
interpolation – str type variable wich responds for interpolation before plotting linear polarized part
kwargs –
- Returns
-
ocelot.gui.dfl_plot.
plot_stokes_sbfg_circ
(ax, stk_params, slice, plane, cmap='seismic', plot_title=None, x_label='', y_label='', result=0, text_present=True, interpolation=None, normalization='s0_max', **kwargs)¶ Plot normalized Stokes parameter S3
- Parameters
ax – matplotlib.pyplot.AxesSubplot on which the data will be plotted
stk_params – 3d ocelot.optics.wave.StokesParameters() type object
plane – the direction in which the projection/intersection of {stk_params} will be done
slice – this variable responds on which value on {plane} direction the 3d stk_params will intersect. It can take 3 different recognition: ‘max_slice’: the intersection of 3d stk_params will contain the max value s0 in stk_params ‘proj’: at the third subplot will be shown the projection of 3d stk_params in {plane} direction <number> in [m]: the position of intersection on {plane} direction
cmap – colormap which will be used for plotting data
plot_title – title of the plot
x_label – label of the x axis
y_label – label of the y axis
result – a bool type variable; if bool == True the function will return linear_plt of AxesImage type
text_present – bool type variable which responds for showing text on subplots
interpolation – str type variable wich responds for interpolation before plotting linear polarized part
kwargs –
- Returns
-
ocelot.gui.dfl_plot.
plot_hprofile
(*args, **kwargs)¶
-
ocelot.gui.dfl_plot.
plot_1d_hprofile
(height_profile, figsize=4, fig_name='Height profile', savefig=False, showfig=True, **kwargs)¶ This function plotting the height map and PSD of HeightProfile object
- Parameters
height_profile – HeightProfile object from ocelot
figsize – size of figure
fig_name – name of figure
savefig – bool type flag, responding for saving figure
showfig – bool type flag, responding for showing figure
kwargs –