sda.analysis.viz#
Shared Plotly building-blocks for SDA analysis dashboards.
Provides two reusable figure components:
iso_power_traces()— iso-power hyperbola lines for an Energy × Frequency scatter plot.background_heatmap_trace()— griddata-interpolated background heatmap.
Functions#
|
Return |
|
Return a griddata-interpolated |
Module Contents#
- sda.analysis.viz.iso_power_traces(x_min, x_max, y_min, y_max, power_candidates=None)#
Return
(traces, annotations)for iso-power hyperbolas.Each power level P (watts, since kHz·mJ = W) is drawn as a faint dotted line with a semi-transparent annotation label. A wide transparent overlay trace carries a detailed hover tooltip without affecting visuals.
- Parameters:
x_min (
Data range for the x-axis (Energy per pulse,mJ).)x_max (
Data range for the x-axis (Energy per pulse,mJ).)y_min (
Data range for the y-axis (Frequency,kHz).)y_max (
Data range for the y-axis (Frequency,kHz).)power_candidates (
Power levels in Wtoconsider. Levels outside the data) – range are skipped automatically.
- Returns:
traces (
Listofgo.Scattertraces toextend into the figure.)annotations (
Listofannotation dictstopasstofig.update_layout.)
- sda.analysis.viz.background_heatmap_trace(x_pts, y_pts, z_pts, x_range, y_range, colorscale='RdYlGn', zmin=None, zmax=None, grid_size=80, opacity=0.4)#
Return a griddata-interpolated
go.Heatmaptrace, orNone.Requires at least 3 data points to interpolate; returns
Nonewhen that threshold is not met.- Parameters:
x_pts (
Scatter coordinatesandvalues.)y_pts (
Scatter coordinatesandvalues.)z_pts (
Scatter coordinatesandvalues.)x_range (:py:class:
`(min`, :py:class:`max)tuples that define the grid extent.`)y_range (:py:class:
`(min`, :py:class:`max)tuples that define the grid extent.`)colorscale (
Plotly colorscale name (default ````”RdYlGn”:py:class:`).`)zmin (
Color axis limits. Inferred from *z_pts* when ``None`.`)zmax (
Color axis limits. Inferred from *z_pts* when ``None`.`)grid_size (
Numberofgrid points per axis (default 80).)opacity (
Heatmap opacity (default 0.40).)
- Return type:
go.HeatmaporNone.