A Julia wrapper for the IRBEM (International Radiation Belt Environment Modeling) Fortran library.
The IRBEM library is a set of source codes dedicated to radiation belt modeling. It facilitates the calculation of magnetic coordinates and drift shells using various external magnetic field models. This Julia package provides a wrapper around the IRBEM library, allowing Julia users to access its functionality.
using Pkg
Pkg.add("IRBEM")
- Computing magnetic field coordinates
- Find points of interest on the field line
- Compute magnetic field, derivatives and gradients
- Field tracing
- Coordinates transformations
- Flexible interface (Multiple dispatch with Fortran-style, Python-style, and Julia-style)
using IRBEM
using Dates
# Initialize the magnetic field model
model = MagneticField(kext="T89")
# Define position and time
X = Dict(
"dateTime" => DateTime("2015-02-02T06:12:43"),
"x1" => 600.0, # km
"x2" => 60.0, # lat
"x3" => 50.0 # lon
)
# Define magnetic field model inputs
maginput = Dict("Kp" => 40.0)
# Compute L* and related parameters
make_lstar(model, X, maginput)
# Trace a field line
trace_field_line(model, X, maginput)
# Find the magnetic equator
find_magequator(model, X, maginput)
# Calculate MLT
get_mlt(X)
The following coordinate systems are supported:
GDZ
: Geodetic (altitude, latitude, east longitude - km, deg, deg)GEO
: Cartesian GEO (Earth radii)GSM
: Cartesian GSM (Earth radii)GSE
: Cartesian GSE (Earth radii)SM
: Cartesian SM (Earth radii)GEI
: Cartesian GEI (Earth radii)MAG
: Cartesian MAG (Earth radii)SPH
: Spherical GEO (radial distance, latitude, east longitude - Earth radii, deg, deg)RLL
: Spherical GEO (radial distance, latitude, east longitude - Earth radii, deg, deg)
The following external magnetic field models are supported:
None
: No external fieldMF75
: Mead & Fairfield 1975TS87
: Tsyganenko 1987 shortTL87
: Tsyganenko 1987 longT89
: Tsyganenko 1989OPQ77
: Olson & Pfitzer quiet 1977OPD88
: Olson & Pfitzer dynamic 1988T96
: Tsyganenko 1996OM97
: Ostapenko & Maltsev 1997T01
: Tsyganenko 2001T01S
: Tsyganenko 2001 stormT04
: Tsyganenko 2004A00
: Alexeev 2000T07
: Tsyganenko 2007MT
: Mead & Tsyganenko
- The IRBEM library is developed and maintained by the IRBEM-LIB development team.
- This Julia wrapper is inspired by the existing Python and MATLAB wrappers for IRBEM.