Formula reference: magnetics
This page is generated from the docstrings of
vaft/formula/magnetics.py:
2 public functions. The category overview and notation come from the module
docstring; every entry below is what vaft.formula.describe("magnetics.<name>") prints.
Back to the formula reference index.
Overview
One home for the rule that turns a stored IMAS poloidal_angle into a
sensitive axis, so the angle written into the IDS and the projection a
consumer applies cannot move apart (issue #288). The Data Dictionary
defines poloidal_angle as a clockwise angle from the horizontal
plane, zero when the sensor normal points toward increasing major radius.
Clockwise from +R turns toward -Z, so the axis is
(cos(angle), -sin(angle)) in (R, Z) and a probe measuring +Bz
is stored as 3*pi/2. Projecting with (cos, +sin) – the
counter-clockwise reading – inverts every probe while leaving flux loops
untouched, which is exactly how the mistake hides: VAFT carried it until
#288, and a downstream solver carried it after #293 moved the angle.
Functions
probe_axis— Direction cosines(c_R, c_Z)of a poloidal-field probe’s sensitive axis.project_poloidal_field— The component of(B_R, B_Z)a probe oriented atpoloidal_anglereads.
probe_axis
probe_axis(poloidal_angle)
Direction cosines (c_R, c_Z) of a poloidal-field probe’s sensitive axis.
probe_axis(3*pi/2) == (0, +1): VEST’s +Bz probes.
| Parameter | Type | Unit | Description |
|---|---|---|---|
poloidal_angle | float or ndarray | rad | Probe orientation angle in the DD convention; scalar or array. |
| Returns | Type | Unit | Description |
|---|---|---|---|
| tuple of ndarray | - |
|
References.
- IMAS Data Dictionary,
magnetics.b_field_pol_probe[:].poloidal_angle.
project_poloidal_field
project_poloidal_field(b_r, b_z, poloidal_angle)
The component of (B_R, B_Z) a probe oriented at poloidal_angle reads.
b_r and b_z may carry any trailing shape (a time series, a response
row); poloidal_angle must broadcast against them – pass a scalar per
probe, or angles[:, None] for a stack of rows.
| Parameter | Type | Unit | Description |
|---|---|---|---|
b_r | float or ndarray | T | Radial field component. |
b_z | float or ndarray | T | Vertical field component. |
poloidal_angle | float or ndarray | rad | Probe orientation angle in the DD convention. |
| Returns | Type | Unit | Description |
|---|---|---|---|
| ndarray | T | Projected field along the probe axis. |
References.
- IMAS Data Dictionary,
magnetics.b_field_pol_probe[:].poloidal_angle.
Refreshing this snapshot
From a checkout of the develop branch, run:
python -m vaft.formula.catalog --output /path/to/vaft-gh/_data/formula_catalog.yml
The snapshot records the SHA-256 of every vaft/formula/*.py source file; documentation
validation compares them when VAFT_REGISTRY_SOURCE points to the corresponding source checkout.
The same text is available offline as vaft.formula.describe("<name>"),
vaft.formula.search("<text>") and vaft.formula.list_formulas(category="<category>").