_units#

Physical constants and normalization factors for PSI MAS model output.

The MAS (Magnetohydrodynamic Algorithm outside a Sphere) code solves the resistive MHD equations in dimensionless form. Every quantity stored in an HDF output file is a dimensionless ratio

\[q_\text{code} = \frac{q_\text{phys}}{q_0}\]

where \(q_0\) is the characteristic scale for that quantity. This module collects all reference scales so that code-unit values can be converted to physical (CGS or SI) units via astropy.units.

Normalization Scheme#

MAS adopts a normalization anchored to two observable solar parameters and one reference number density:

Symbol

Quantity

Value

FNORML = RSUN

Characteristic length

\(6.96 \times 10^{10}\) cm

G0PHYS

Solar surface gravity

\(2.74 \times 10^4\) cm s⁻²

FN0PHYS

Reference number density

\(10^8\) cm⁻³

From these three anchors, the characteristic time is fixed by requiring the dimensionless surface gravity \(G_0^\text{norm} = 0.823\):

\[T_0 = \sqrt{\frac{G_0^\text{norm}\, R_\odot}{g_0}} \approx 1446 \;\text{s}\]

All other normalization factors follow from dimensional analysis:

Symbol

Quantity

Formula

FN_V

Velocity

\(V_0 = L_0 / T_0 \approx 481\) km s⁻¹

FN_RHO

Mass density

\(\rho_0 = m_p n_0\)

FN_T

Temperature

\(T_0^\text{temp} = m_p V_0^2 / k_B \approx 28\) MK

FN_P

Pressure

\(P_0 = \rho_0 V_0^2\)

FN_B

Magnetic field

\(B_0 = V_0 \sqrt{\mu_0 \rho_0} \approx 2.2\) G

FN_J

Current density (SI)

\(J_0 = B_0 / (\mu_0 L_0)\) A m⁻²

FN_HEAT

Volumetric heating rate

\(Q_0 = P_0 / T_0\) erg cm⁻³ s⁻¹

Electromagnetic Units#

MAS is formulated in Gaussian CGS, where Ampère’s law reads \(\mathbf{J} = (c/4\pi)\,\nabla \times \mathbf{B}\). Because current density in Gaussian CGS (statampere cm⁻²) is unfamiliar to most users, this module provides both SI (FN_J, FN_E) and Gaussian CGS (FN_J_CGS, FN_E_CGS) normalizations for these quantities.

Magnetic field is expressed in Gauss throughout, since that system is unambiguous and Gauss is the conventional unit for coronal magnetic field strengths.

Custom Astropy Units#

Each PSI quantity has a dedicated UnitBase registered at module import time. These units carry the conversion factor from code units to physical units so that astropy can chain conversions automatically — for example, a quantity returned by psi_io.mhd_io in MAS_b units can be converted with a single .to(u.Gauss) call.

Units are registered both under a family name (e.g. MAS_b) and under every individual quantity name in that family (e.g. MAS_br, MAS_bt, MAS_bp), so that the unit embedded in an Quantity always reflects the specific field component.

Registered PSI Custom Units#

Unit object

Physical equivalent

Module constant

Registered string names

MAS_b

\(\approx 2.2\) G

FN_B

MAS_b, MAS_br, MAS_bt, MAS_bp

MAS_v

\(\approx 481\) km s⁻¹

FN_V

MAS_v, MAS_vr, MAS_vt, MAS_vp, MAS_zp, MAS_zm

MAS_j

\(J_0\) A m⁻²

FN_J

MAS_j, MAS_jr, MAS_jt, MAS_jp

MAS_t

\(\approx 28\) MK

FN_T

MAS_t, MAS_te, MAS_tp

MAS_n

\(10^8\) cm⁻³

FN_N

MAS_n, MAS_rho

MAS_p

\(P_0\) erg cm⁻³

FN_P

MAS_p, MAS_ep, MAS_em

MAS_heat

\(Q_0\) erg cm⁻³ s⁻¹

FN_HEAT

MAS_heat

POT3D_b

1 (dimensionless)

POT3D_b, POT3D_br, POT3D_bt, POT3D_bp

PSI_rsun

\(6.96 \times 10^{10}\) cm

RSUN

PSI_rsun, PSI_radius, PSI_r

PSI_angle

1 rad

PSI_angle, PSI_t, PSI_p, PSI_theta, PSI_phi

See Also#

astropy.units :

The underlying unit system used for normalization and conversion.

psi_io._models :

Maps each MAS quantity name to its FN_* normalization.

psi_io.mhd_io :

Lazy readers that apply these normalizations on property access.

Functions

compose_mas_units(quantity)

Express a quantity in the preferred MAS CGS units basis.

decompose_mas_units(quantity)

Decompose a quantity into the preferred MAS CGS base unit.

get_helium_fractions(he_frac)

Compute fractional abundance multipliers for a hydrogen–helium plasma.

Attributes

BOLTZ

Boltzmann constant in CGS.

C_CGS

Speed of light in CGS: \(c = 2.998 \times 10^{10}\) cm s⁻¹.

FAVORED_UNITS

Tuple of CGS units preferred when composing or decomposing MAS quantities.

FKSPITZ

Spitzer parallel thermal conductivity prefactor in CGS.

FLUX_UNIT

Astropy unit for surface energy flux: erg cm⁻² s⁻¹.

FMP

Proton mass in CGS.

FN0PHYS

Reference number density of the coronal base in CGS.

FN_B

Magnetic field normalization for MAS, in Gauss.

FN_E

Electric field normalization for MAS, in SI (V m⁻¹).

FN_E_CGS

Electric field normalization for MAS, in Gaussian CGS (statV cm⁻¹).

FN_FLUX

Surface energy flux normalization for MAS.

FN_HEAT

Volumetric heating rate normalization for MAS.

FN_J

Current density normalization for MAS, in SI (A m⁻²).

FN_J_CGS

Current density normalization for MAS, in Gaussian CGS (statA cm⁻²).

FN_JB

Lorentz force density (and pressure gradient) normalization for MAS.

FN_KAPPA

Thermal conductivity normalization for MAS.

FN_LENGTH

Alias for FNORML: the characteristic length scale \(L_0 = R_\odot\).

FN_N

Number density normalization: \(n_0 = 10^8\) cm⁻³.

FN_P

Pressure normalization for MAS.

FN_QRAD

Radiative loss function normalization for MAS.

FN_RHO

Mass density normalization for MAS.

FN_T

Temperature normalization for MAS.

FN_TIME

Alias for FNORMT: the characteristic time scale \(T_0 \approx 1446\) s.

FN_V

Velocity normalization for MAS.

FNORML

Characteristic length scale for MAS: the solar radius.

FNORMM

Characteristic mass scale for MAS.

FNORMT

Characteristic time scale for MAS.

G0NORM

Dimensionless surface gravity in MAS code unit.

G0PHYS

Solar surface gravitational acceleration in CGS.

K

Kinetic energy normalization for MAS.

MAS_b

Custom astropy unit for MAS magnetic field quantities.

MAS_heat

Custom astropy unit for MAS volumetric heating rate.

MAS_j

Custom astropy unit for MAS current density quantities.

MAS_n

Custom astropy unit for MAS number density and mass density.

MAS_p

Custom astropy unit for MAS pressure and wave-energy quantities.

MAS_t

Custom astropy unit for MAS temperature quantities.

MAS_v

Custom astropy unit for MAS velocity quantities.

MU0

Permeability of free space (SI).

OMEGA_COROTATE

Default angular velocity of the MAS corotating frame, in physical unit.

PI

High-precision value of π.

POT3D_b

Custom astropy unit for POT3D magnetic field quantities.

PSI_angle

Custom astropy unit for PSI angular coordinate grids.

PSI_rsun

Custom astropy unit for PSI radial coordinate grids.

RSUN

Solar radius in centimeters.

STATAMP_TO_AMPERE

Conversion factor from statampere to ampere.

STATVOLT_TO_VOLT

Conversion factor from statvolt to volt.

VOLUMETRIC_RATE_UNIT

Astropy unit for volumetric energy deposition rate: erg cm⁻³ s⁻¹.

W

Total (integrated) energy normalization for MAS.