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
| Name | Description |
|---|---|
scan | Solve 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.DatasetSolve model on a grid of conditions.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
model | Model | required | The model. |
conditions | Conditions | required | The conditions every point starts from. |
mode | str | 'quasi-static' | The steady-state mode. |
effective | bool | True | Add effective_rate (target driver, source driver) and, with
lines, pec (line, driver) for quasi-static solves. |
lines | bool | True | Add the line emissivities. |
**axes | Sequence[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).