Skip to content
Projects

opencr.analysis.scan

Parameter scans over the conditions.

scan solves a model on the outer product of values of condition fields (electron_temperature, electron_density, a driver density as density:<state> or a total as total:<element>) and returns an xarray dataset with the populations and, for quasi-static solves, the effective rate coefficients between the drivers and the photon emissivity coefficients. Each point is an independent reference solve; the batched backends (opencr.backends) do the same for Maxwellian scans in one pass.

The values of an axis take astropy quantities or strings ("1e12 cm-3", "300 K") as well as numbers in the unit of the field (eV, m^-3).

Functions

NameDescription
scanSolve model on a grid of conditions.

scanfunction#

def scan(model: Model, conditions: Conditions, mode: str = 'quasi-static', effective: bool = True, lines: bool = True, **axes: Sequence[float]) -> xr.Dataset

Solve model on a grid of conditions.

Parameters

NameTypeDefaultDescription
modelModelrequiredThe model.
conditionsConditionsrequiredThe conditions every point starts from.
modestr'quasi-static'The steady-state mode.
effectiveboolTrueAdd effective_rate (target driver, source driver) and, with lines, pec (line, driver) for quasi-static solves.
linesboolTrueAdd the line emissivities.
**axesSequence[float]{}The condition fields to scan and their values, e.g. electron_temperature=np.geomspace(0.5, 50, 20). Use {"density:H(n=1)": [...]} or {"total:H": [...]} unpacked with **. The values are in eV or m^-3, or quantities.

Returns

xr.Dataset
A dataset over the axes (and state, line, driver).