gtsimulation.magnetic_field.heliosphere#
- class gtsimulation.magnetic_field.heliosphere.Parker(date: date | int = 0, magnitude=2.09, polarity=-1, tilt_angle=None, use_reg=True, use_hcs=True, use_cir=False, use_noise=False, use_slab=True, use_2d=True, noise_num=256, log_kmin=1, log_kmax=6, coeff_noise=0.47, coeff_2d=2.9)[source]#
Parker spiral model of the interplanetary magnetic field with optional heliospheric current sheet (HCS), corotating interaction regions (CIR), and turbulent fluctuations (slab + 2D components).
The regular part is the classical Parker field with a possible HCS whose tilt angle varies with the solar cycle. Turbulence is simulated as a superposition of slab and 2D modes following the approach described in [1].
- Parameters:
- datedatetime.date or int, optional
Initial epoch. If int, interpreted as seconds from an arbitrary reference; if datetime.date, converted to Unix time (seconds since 1970-01-01). Default 0.
- magnitudefloat, default=2.09
Magnetic field magnitude at 1 AU (nT).
- polarityint, default=-1
Polarity sign of the field (+1 or -1).
- tilt_anglefloat or None, optional
Constant tilt angle of the heliospheric current sheet (radians). If None (default), the tilt angle varies with the 11‑year solar cycle according to an empirical fit.
- use_regbool, default=True
Whether to include the regular Parker field (including HCS if enabled).
- use_hcsbool, default=True
Whether to include the heliospheric current sheet modulation.
- use_cirbool, default=False
Whether to include CIR effects (not implemented yet).
- use_noisebool, default=False
Whether to add turbulent fluctuations.
- use_slabbool, default=True
Whether to include the slab component of turbulence.
- use_2dbool, default=True
Whether to include the 2D component of turbulence.
- noise_numint, default=256
Number of modes used in the turbulence spectrum.
- log_kminfloat, default=1
Decimal logarithm of the minimum wave number (AU⁻¹).
- log_kmaxfloat, default=6
Decimal logarithm of the maximum wave number (AU⁻¹).
- coeff_noisefloat, default=0.47
Scaling factor for the turbulent component.
- coeff_2dfloat, default=2.9
Scaling factor for the 2D component of turbulence.
Notes
The regular Parker field is given by:
B_r = A0 / r² * HCS B_φ = -A0 / r² * ((r - rs) ω / v_sw) sinθ * HCS
where HCS is the current sheet modulation (tanh profile).
Turbulence is simulated as a sum of slab and 2D modes following the synthetic turbulence model described in [1]. The implementation closely follows the formulas provided there.
References
Examples
>>> from gtsimulation.magnetic_field.heliosphere import Parker
Create a model with default parameters (regular field only, no noise). Compute the field at Earth’s orbit (1 AU along the X-axis).
>>> model = Parker() >>> x, y, z = 1.0, 0.0, 0.0 # coordinates in AU >>> Bx, By, Bz = model.calc_field(x, y, z) >>> print(f"B = ({Bx:.2f}, {By:.2f}, {Bz:.2f}) nT")
Override the HCS tilt angle with a constant value (e.g., 0.5 rad).
>>> model_tilt = Parker(tilt_angle=0.5) >>> Bx_t, By_t, Bz_t = model_tilt.calc_field(-x, y, z) >>> print(f"B = ({Bx:.2f}, {By:.2f}, {Bz:.2f}) nT")
- calc_field(x, y, z, t=None)[source]#
Calculate the magnetic field in the native units of the model.
- Parameters:
- x, y, zfloat
Coordinates in the native units of the model.
- Returns:
- Bx, By, Bzfloat
Magnetic field components in nT.
- km2AU = 6.6845871222684464e-09#
- omega = 2.9088820866572157e-06#
- rs = 0.0232523#
- to_meters = 149597870700.0#
- update_state(new_date)[source]#
Update the model for a new date.
Models that do not depend on the date implement this method as a no-op.
- Parameters:
- new_datedatetime.datetime
New date.
- years11 = 347133600#
- class gtsimulation.magnetic_field.heliosphere.ParkerUniform(x, y, z, t=None, coeff_noise=2, coeff_2d=2.1, *args, **kwargs)[source]#
- class gtsimulation.magnetic_field.heliosphere.UniformHelio(use_noise=True, use_reg=True, use_slab=True, use_2d=True, coeff_slab=0.4, coeff_2d=39000, q=1, nu=1.6666666666666667, p=2.61)[source]#
- calc_field(x, y, z)[source]#
Calculate the magnetic field in the native units of the model.
- Parameters:
- x, y, zfloat
Coordinates in the native units of the model.
- Returns:
- Bx, By, Bzfloat
Magnetic field components in nT.
- to_meters = 149597870700.0#