pylbo.ivp_solution
Classes
Container for IVP snapshot data returned by Legolas. |
Functions
|
Module Contents
- pylbo.ivp_solution._fmt(x, pos)
- class pylbo.ivp_solution.IVPSolution(times, data, component_names=None, x_domain=None, units=None)
Container for IVP snapshot data returned by Legolas.
- Parameters:
times (np.ndarray) – Physical times at each snapshot, shape
(n_snap,).data (np.ndarray) – Snapshot data, shape
(n_snap, n_comp, n_points).component_names (dict, optional) – Map from integer index to component name, e.g.
{0: "rho", 1: "v1"}.x_domain (np.ndarray, optional) – Spatial coordinates, shape
(n_points,).units (dict, optional) – Unit normalisations from the Legolas datfile header.
- times
- data
- component_names
- x_domain = None
- units = None
- _scale_component_array(component, comp_array)
Returns
comp_arrayscaled to physical (cgs) units.
- _scale_time_array(times)
- _scale_x_domain(x_vals)
- _get_component_index(component)
- get_component(component)
Returns the
(n_snap, n_points)array for the requested component.
- plot_space_time_heatmap(component, ax=None, cmap='plasma', time_range=None, **imshow_kwargs)
Plot a space-time heatmap for the given component.
- plot_spatial_slices(component, snap_indices, ax=None, **plot_kwargs)
Plot the spatial profile of a component at selected snapshot indices.
- plot_growth_vs_time(component, mode='centre', centre_idx=None, region=None, logy=True, tau=None, ax=None, data_kw=None, fit_kw=None)
Plot perturbation amplitude vs. time, with an optional analytic exp(t/tau) overlay for comparison against eigenvalue growth rates.
- Parameters:
mode ({"centre", "max", "integral"}) – How to reduce the spatial data to a scalar amplitude.
centre_idx (int, optional) – Spatial index for
mode="centre"; defaults to the midpoint.region (tuple (i_min, i_max), optional) – Spatial slice for
mode="max"or"integral".logy (bool) – Use a semilog-y axis.
tau (float, optional) – Analytic e-folding time [s]. Positive => growth, negative => decay.
ax (Axes, optional) – Axes to plot on; created if not provided.
data_kw (dict, optional) – Extra kwargs forwarded to the data and fit
plotcalls.fit_kw (dict, optional) – Extra kwargs forwarded to the data and fit
plotcalls.