analysis

Analysis functions for common FLASH problems.

flash.analysis.fit_power_law(t, r, **kwargs)[source]

Given a shock with radius r over time t, returns the parameters of best fit to the following power-law:

R = R_0 t^\alpha

Parameters :

t : iterable

Time values.

r : iterable

Corresponding radius values.

kwargs : optional

Other parameters to pass down to scipy.optimize.curve_fit()

Returns :

r_o : float

Radius scaling factor.

alpha : float

The power-law index.

flash.analysis.shock_detect(r, v, threshold=1e-06, min_threshold=1e-36)[source]

Given radius (r) and data (v) arrays, finds the outer most shock. Currently this assumes that the radius is montonically increasing.

Parameters :

r : ndarray

Positional data for values.

v : ndarray

Data values which determine the presnece of a shock. This is typically done with density or pressure fields.

threshold : float, optional

The value above which gradients must exceed to be considered a shock. Required for ignoring low-level noise.

min_threshold : float, optional

If a shock is not found at a given threshold level, the threshold value is reduced by an order of magnitude until a shock is found. This continues until a minimum threshold is reached.

Returns :

shock_r : r.dtype

Shock position.

shock_v : v.dtype

Shock peak value.

shock_i : int

Shock index in r and v arrays

Previous topic

Python API

Next topic

output

This Page