IRBEM.jl

Julia wrapper for the IRBEM (International Radiation Belt Environment Modeling)

IRBEMModule

A wrapper for International Radiation Belt Environment Modeling (IRBEM) library

See the Documentation for more information.

Functions

Computing magnetic field coordinates

  • make_lstar: Compute magnetic coordinates at a spacecraft position
  • get_mlt: Get Magnetic Local Time from GEO position and date

Points of interest on the field line

Magnetic field computation

  • get_field_multi: Compute GEO vector of magnetic field at input location
  • get_bderivs: Compute the magnetic field and its 1st-order derivatives at each input location

Field tracing

  • trace_field_line: Trace a full field line crossing the input position
  • drift_shell: Trace a full drift shell for particles with mirror point at input location
  • drift_bounce_orbit: Trace a full bounce orbit for particles with mirror point at input location

Coordinates transformations

  • transform: Transform coordinates from one system to another

Library information

References

source

API Reference

Computing magnetic field coordinates

IRBEM.make_lstarFunction
make_lstar(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
make_lstar(model::MagneticField, X, maginput=Dict())

Compute magnetic coordinates at a spacecraft position.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

Returns

  • NamedTuple: Contains fields Lm, MLT, Blocal, Bmin, Lstar, and XJ

Examples

julia> make_lstar("2015-02-02T06:12:43", [600.0, 60.0, 50.0], "GDZ", Dict("Kp" => 40.0))
(Lm = 3.5597242229067536, Lstar = -1.0e31, Blocal = 42271.43059990003, Bmin = 626.2258295723121, XJ = 7.020585390925573, MLT = 10.170297893176182)
source
IRBEM.get_mltFunction
get_mlt(model::MagneticField, X::Dict)

Get Magnetic Local Time (MLT) from a Cartesian GEO position and date.

Arguments

  • model::MagneticField: The magnetic field model
  • X::Dict: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in GEO system
source

Points of interest on the field line

IRBEM.find_mirror_pointFunction
find_mirror_point(time, x, alpha, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
find_mirror_point(model::MagneticField, X, alpha, maginput=Dict())

Find the magnitude and location of the mirror point along a field line traced from any given location and local pitch-angle.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

  • alpha: Local pitch angle in degrees

Outputs

  • Blocal: magnitude of magnetic field at point (nT)
  • Bmirr: magnitude of the magnetic field at the mirror point (nT)
  • posit (array of 3 double): GEO coordinates of the mirror point (Re)

References: IRBEM API

source
IRBEM.find_magequatorFunction
find_magequator(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
find_magequator(model::MagneticField, X, maginput=Dict())

Find the coordinates of the magnetic equator from tracing the magnetic field line from the input location. Returns a named tuple with fields Bmin and XGEO (location of magnetic equator in GEO coordinates).

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)
source
IRBEM.find_foot_pointFunction
find_foot_point(time, x, stop_alt, hemi_flag, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
find_foot_point(model::MagneticField, X, stop_alt, hemi_flag, maginput=Dict())

Find the footprint of a field line that passes through location X in a given hemisphere.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

  • stop_alt: Altitude in km where to stop field line tracing

  • hemi_flag: Hemisphere flag (0: same as SM z, +1: northern, -1: southern)

Outputs

  • XFOOT: GDZ coordinates of the foot point (Re)
  • BFOOT: magnetic field vector (GEO) at the foot point (nT)
  • BFOOTMAG: magnitude of the magnetic field at the foot point (nT)

References: IRBEM API

source

Magnetic field computation

IRBEM.get_field_multiFunction
get_field_multi(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
get_field_multi(model::MagneticField, X, maginput=Dict())

Compute the GEO vector of the magnetic field at input location for a set of internal/external magnetic field.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

Returns

  • NamedTuple: Contains fields Bgeo (GEO components of B field) and Bmag (magnitude of B field)
source
IRBEM.get_bderivsFunction
get_bderivs(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
get_bderivs(model::MagneticField, X, maginput=Dict())

Compute the magnetic field and its 1st-order derivatives at each input location.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

Returns

  • NamedTuple: Contains fields Bgeo (GEO components of B field), Bmag (magnitude of B field), gradBmag (gradients of Bmag in GEO), and diffB (derivatives of the magnetic field vector).

Examples

julia> get_bderivs("2015-02-02T06:12:43", [600.0, 60.0, 50.0], 0.1, "GDZ", Dict("Kp" => 40.0)) |> pprint
(Bgeo = [-21079.764883133903, -21504.21460705096, -29666.24532305791],
 Bmag = 42271.43059990003,
 gradBmag = [-49644.37271032293, -46030.37495428827, -83024.03530787815],
 diffB =
     [-13530.079906431165 31460.805163291334 53890.73134176735; 30427.464243221693 -16715.08632269888 50326.93737340687; 62620.43884602288 59981.93936448166 44395.53254933224;;;])
source

Field tracing

IRBEM.trace_field_lineFunction
trace_field_line(model::MagneticField, X, maginput; R0=1.0)

Trace a full field line which crosses the input position.

Arguments

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes
  • maginput: Dictionary with magnetic field model inputs
  • R0=1.0: Radial distance in Re units where to stop field line tracing

Outputs

  • Lm: L McIlwain
  • Blocal (array of 3000 double): magnitude of magnetic field at point (nT)
  • Bmin: magnitude of magnetic field at equator (nT)
  • XJ: I, related to second adiabatic invariant (Re)
  • posit (array of (3, 3000) double): Cartesian coordinates in GEO along the field line
  • Nposit: number of points in posit
source
IRBEM.drift_shellFunction
drift_shell(model::MagneticField, X, maginput)

Trace a full drift shell for particles that have their mirror point at the input location.

Arguments

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes
  • maginput: Dictionary with magnetic field model inputs

Outputs

  • Lm: L McIlwain
  • Lstar: L Roederer or Φ=2π Bo/L* (nT Re2), depending on the options value
  • Blocal (array of (1000, 48)): magnitude of magnetic field at point (nT)
  • Bmin: magnitude of magnetic field at equator (nT)
  • XJ: I, related to second adiabatic invariant (Re)
  • posit (array of (3, 1000, 48)): Cartesian coordinates in GEO along the drift shell
  • Nposit (array of 48 integer): number of points in posit along each traced field line

Reference: IRBEM API

source
IRBEM.drift_bounce_orbitFunction
drift_bounce_orbit(model::MagneticField, X, maginput; alpha=90, R0=1)

Trace a full drift-bounce orbit for particles with a specified pitch angle at the input location. Returns only positions between mirror points, with 25 azimuths.

Arguments

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes
  • maginput: Dictionary with magnetic field model inputs
  • alpha: Local pitch angle in degrees (default 90)
  • R0: Minimum radial distance allowed along the drift path (default 1.0)

Outputs:

  • Lm: L McIlwain
  • Lstar: L Roederer or Φ=2π Bo/L* (nT Re2), depending on the options value
  • Blocal (array of (1000, 25) double): magnitude of magnetic field at point (nT)
  • Bmin: magnitude of magnetic field at equator (nT)
  • XJ: I, related to second adiabatic invariant (Re)
  • posit (array of (3, 1000, 25) double): Cartesian coordinates in GEO along the drift shell
  • Nposit (array of 25 integer): number of points in posit along each traced field line

Reference: IRBEM API

source

Coordinates transformations

IRBEM.transformFunction
transform(time, pos, in, out)

Transform coordinates from in coordinate system to out coordinate system.

Note: pos must be of shape (3,) for single point or (3, n) for multiple points

Example

using Dates
using IRBEM

time = DateTime(2020, 1, 1)
pos = [6.90274, -1.63624, 1.91669]

GSM(time, GEO(pos))
transform(time, pos, "GEO", "GSM")
transform(time, pos, "GEO" => "GSM")
transform(time, pos, "geo2gsm")
source

Library information

IRBEM.IRBEMModule

A wrapper for International Radiation Belt Environment Modeling (IRBEM) library

See the Documentation for more information.

Functions

Computing magnetic field coordinates

  • make_lstar: Compute magnetic coordinates at a spacecraft position
  • get_mlt: Get Magnetic Local Time from GEO position and date

Points of interest on the field line

Magnetic field computation

  • get_field_multi: Compute GEO vector of magnetic field at input location
  • get_bderivs: Compute the magnetic field and its 1st-order derivatives at each input location

Field tracing

  • trace_field_line: Trace a full field line crossing the input position
  • drift_shell: Trace a full drift shell for particles with mirror point at input location
  • drift_bounce_orbit: Trace a full bounce orbit for particles with mirror point at input location

Coordinates transformations

  • transform: Transform coordinates from one system to another

Library information

References

source
IRBEM.GSMType

Geocentric Solar Magnetospheric (GSM)

X points sunward from Earth's center. The X-Z plane is defined to contain Earth's dipole axis (positive North).

source
IRBEM.betaFunction
beta(Ek, Erest=511.0)

Calculate relativistic beta (v/c) for a particle with kinetic energy Ek. Ek and Erest must be in the same units (default is keV).

source
IRBEM.coord_sysMethod
coord_sys(axes)

Look up the IRBEM coordinate system integer given a string representation.

Coordinate systems:

  • 0: GDZ: (altitude, latitude, east longitude - km, deg, deg)
  • 1: GEO: Cartesian GEO - Re
  • 2: GSM: Cartesian GSM - Re
  • 3: GSE: Cartesian GSE - Re
  • 4: SM: Cartesian SM - Re
  • 5: GEI: Cartesian GEI - Re
  • 6: MAG: Cartesian MAG - Re
  • 7: SPH: Spherical GEO - (radial distance, latitude, east longitude - Re, deg, deg)
  • 8: RLL: Spherical GEO - (radial distance, latitude, east longitude - Re, deg, deg)

Returns the corresponding integer code.

source
IRBEM.drift_bounce_orbitMethod
drift_bounce_orbit(model::MagneticField, X, maginput; alpha=90, R0=1)

Trace a full drift-bounce orbit for particles with a specified pitch angle at the input location. Returns only positions between mirror points, with 25 azimuths.

Arguments

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes
  • maginput: Dictionary with magnetic field model inputs
  • alpha: Local pitch angle in degrees (default 90)
  • R0: Minimum radial distance allowed along the drift path (default 1.0)

Outputs:

  • Lm: L McIlwain
  • Lstar: L Roederer or Φ=2π Bo/L* (nT Re2), depending on the options value
  • Blocal (array of (1000, 25) double): magnitude of magnetic field at point (nT)
  • Bmin: magnitude of magnetic field at equator (nT)
  • XJ: I, related to second adiabatic invariant (Re)
  • posit (array of (3, 1000, 25) double): Cartesian coordinates in GEO along the drift shell
  • Nposit (array of 25 integer): number of points in posit along each traced field line

Reference: IRBEM API

source
IRBEM.drift_shellMethod
drift_shell(model::MagneticField, X, maginput)

Trace a full drift shell for particles that have their mirror point at the input location.

Arguments

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes
  • maginput: Dictionary with magnetic field model inputs

Outputs

  • Lm: L McIlwain
  • Lstar: L Roederer or Φ=2π Bo/L* (nT Re2), depending on the options value
  • Blocal (array of (1000, 48)): magnitude of magnetic field at point (nT)
  • Bmin: magnitude of magnetic field at equator (nT)
  • XJ: I, related to second adiabatic invariant (Re)
  • posit (array of (3, 1000, 48)): Cartesian coordinates in GEO along the drift shell
  • Nposit (array of 48 integer): number of points in posit along each traced field line

Reference: IRBEM API

source
IRBEM.find_foot_pointMethod
find_foot_point(time, x, stop_alt, hemi_flag, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
find_foot_point(model::MagneticField, X, stop_alt, hemi_flag, maginput=Dict())

Find the footprint of a field line that passes through location X in a given hemisphere.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

  • stop_alt: Altitude in km where to stop field line tracing

  • hemi_flag: Hemisphere flag (0: same as SM z, +1: northern, -1: southern)

Outputs

  • XFOOT: GDZ coordinates of the foot point (Re)
  • BFOOT: magnetic field vector (GEO) at the foot point (nT)
  • BFOOTMAG: magnitude of the magnetic field at the foot point (nT)

References: IRBEM API

source
IRBEM.find_magequatorMethod
find_magequator(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
find_magequator(model::MagneticField, X, maginput=Dict())

Find the coordinates of the magnetic equator from tracing the magnetic field line from the input location. Returns a named tuple with fields Bmin and XGEO (location of magnetic equator in GEO coordinates).

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)
source
IRBEM.find_mirror_pointMethod
find_mirror_point(time, x, alpha, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
find_mirror_point(model::MagneticField, X, alpha, maginput=Dict())

Find the magnitude and location of the mirror point along a field line traced from any given location and local pitch-angle.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

  • alpha: Local pitch angle in degrees

Outputs

  • Blocal: magnitude of magnetic field at point (nT)
  • Bmirr: magnitude of the magnetic field at the mirror point (nT)
  • posit (array of 3 double): GEO coordinates of the mirror point (Re)

References: IRBEM API

source
IRBEM.gammaFunction
gamma(Ek, Erest=511.0)

Calculate relativistic gamma factor for a particle with kinetic energy Ek. Ek and Erest must be in the same units (default is keV).

source
IRBEM.get_bderivsMethod
get_bderivs(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
get_bderivs(model::MagneticField, X, maginput=Dict())

Compute the magnetic field and its 1st-order derivatives at each input location.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

Returns

  • NamedTuple: Contains fields Bgeo (GEO components of B field), Bmag (magnitude of B field), gradBmag (gradients of Bmag in GEO), and diffB (derivatives of the magnetic field vector).

Examples

julia> get_bderivs("2015-02-02T06:12:43", [600.0, 60.0, 50.0], 0.1, "GDZ", Dict("Kp" => 40.0)) |> pprint
(Bgeo = [-21079.764883133903, -21504.21460705096, -29666.24532305791],
 Bmag = 42271.43059990003,
 gradBmag = [-49644.37271032293, -46030.37495428827, -83024.03530787815],
 diffB =
     [-13530.079906431165 31460.805163291334 53890.73134176735; 30427.464243221693 -16715.08632269888 50326.93737340687; 62620.43884602288 59981.93936448166 44395.53254933224;;;])
source
IRBEM.get_datetimeMethod
get_datetime(X::Dict)

Extract datetime from input dictionary X. Supports 'dateTime' or 'Time' keys with DateTime or String values.

source
IRBEM.get_field_multiMethod
get_field_multi(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
get_field_multi(model::MagneticField, X, maginput=Dict())

Compute the GEO vector of the magnetic field at input location for a set of internal/external magnetic field.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

Returns

  • NamedTuple: Contains fields Bgeo (GEO components of B field) and Bmag (magnitude of B field)
source
IRBEM.get_mltMethod
get_mlt(model::MagneticField, X::Dict)

Get Magnetic Local Time (MLT) from a Cartesian GEO position and date.

Arguments

  • model::MagneticField: The magnetic field model
  • X::Dict: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in GEO system
source
IRBEM.make_lstarMethod
make_lstar(time, x, coord="GDZ", maginput=Dict(); kext=KEXT[], options=OPTIONS[])
make_lstar(model::MagneticField, X, maginput=Dict())

Compute magnetic coordinates at a spacecraft position.

Arguments

Signature 1:

  • time: Date and time (DateTime, Vector{DateTime}, or String)
  • x: Position coordinates as a 3×n array or a tuple/vector of vectors
  • coord: String specifying the coordinate system (default: "GDZ")
  • kext: External field model selection (optional)
  • options: Model options (optional)

Signature 2:

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes

Common arguments:

  • maginput: Dictionary with magnetic field model inputs (optional)

Returns

  • NamedTuple: Contains fields Lm, MLT, Blocal, Bmin, Lstar, and XJ

Examples

julia> make_lstar("2015-02-02T06:12:43", [600.0, 60.0, 50.0], "GDZ", Dict("Kp" => 40.0))
(Lm = 3.5597242229067536, Lstar = -1.0e31, Blocal = 42271.43059990003, Bmin = 626.2258295723121, XJ = 7.020585390925573, MLT = 10.170297893176182)
source
IRBEM.prepare_maginputFunction
prepare_maginput(maginput::Dict, ntime::Int)

Process magnetic field model inputs from input dictionary. Returns a properly formatted array for IRBEM functions.

source
IRBEM.process_coords_timeMethod
process_coords_time(X::Dict)

Process coordinates and time from input dictionary X. Returns ntime, iyear, idoy, ut, x1, x2, x3 arrays for IRBEM functions.

source
IRBEM.trace_field_lineMethod
trace_field_line(model::MagneticField, X, maginput; R0=1.0)

Trace a full field line which crosses the input position.

Arguments

  • model::MagneticField: The magnetic field model
  • X: Dictionary with keys:
    • dateTime or Time: Date and time (DateTime or String)
    • x1, x2, x3: Position coordinates in the system specified by sysaxes
  • maginput: Dictionary with magnetic field model inputs
  • R0=1.0: Radial distance in Re units where to stop field line tracing

Outputs

  • Lm: L McIlwain
  • Blocal (array of 3000 double): magnitude of magnetic field at point (nT)
  • Bmin: magnitude of magnetic field at equator (nT)
  • XJ: I, related to second adiabatic invariant (Re)
  • posit (array of (3, 3000) double): Cartesian coordinates in GEO along the field line
  • Nposit: number of points in posit
source
IRBEM.transformMethod
transform(time, pos, in, out)

Transform coordinates from in coordinate system to out coordinate system.

Note: pos must be of shape (3,) for single point or (3, n) for multiple points

Example

using Dates
using IRBEM

time = DateTime(2020, 1, 1)
pos = [6.90274, -1.63624, 1.91669]

GSM(time, GEO(pos))
transform(time, pos, "GEO", "GSM")
transform(time, pos, "GEO" => "GSM")
transform(time, pos, "geo2gsm")
source
IRBEM.vparallelFunction
vparallel(Ek, Bm, B, Erest=511.0)

Calculate parallel velocity for a particle with kinetic energy Ek, at a location with magnetic field B, with mirror point field Bm. Ek and Erest must be in the same units (default is keV). Returns velocity in m/s.

source
IRBEM.with_case_variantsMethod
with_case_variants(dict::Dict{S, V}) where {S <: AbstractString, V}

Creates a new dictionary with both uppercase and lowercase variants of each key. The original keys and values are preserved, and lowercase/uppercase variants are added.

Example:

original = Dict("ABC" => 1, "DEF" => 2)
result = with_case_variants(original)
# result has keys: "ABC", "abc", "DEF", "def"
source
IRBEM.@init_refsMacro
@init_refs(Type, var1, var2, ...)

Creates variables var1, var2, ... each initialized as Ref{Type}(). Example: @init_refs(Float64, 0.0, Lm, Lstar) expands to: Lm = Ref{Float64}(0.0) Lstar = Ref{Float64}(0.0)

source