The IRBEM library exposes a set of subroutines that can be called from Fortran, C, Python (viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/PRBEM/IRBEM/llms.txt
Use this file to discover all available pages before exploring further.
ctypes), MATLAB, and IDL. Each routine in this reference documents its calling sequence for all supported languages, along with its input and output parameters, valid ranges, and any relevant notes. This page provides a map of every routine grouped by purpose to help you quickly locate the functionality you need.
Multi-language calling sequences
Every IRBEM routine is documented with calling sequences for four language environments:| Language | Notes |
|---|---|
| FORTRAN | Routines are called with a trailing 1 appended to the name (e.g., MAKE_LSTAR1). |
| IDL | Uses call_external against the compiled shared library; the symbol name has a trailing underscore (e.g., make_lstar_). |
| MATLAB | Uses the onera_desp_lib_* wrapper functions included with IRBEM. |
| Python | Uses ctypes bindings; the Python wrapper converts the Fortran error sentinel (−1×10³¹) to −9999. |
Calling conventions
All IRBEM routines share a consistent set of low-level conventions that apply regardless of which language interface you use.- Integer width: all integer parameters are 32-bit (called
longintegers in IDL). - Float precision: all floating-point parameters are 64-bit double precision.
- Array ordering: all arrays use column-major (Fortran) ordering.
- Fortran name mangling: when calling Fortran routines directly (from C or via
ctypes), a trailing1is appended to the routine name. - Error sentinel: invalid or unavailable output values are set to −1×10³¹ in Fortran-level outputs. The Python wrapper converts this value to −9999 for ease of comparison.
Array size limits
Some routines accept or return arrays bounded by library-wide constants:| Constant | Value | Description |
|---|---|---|
NTIME_MAX | variable | Maximum number of time points; retrieve at runtime with GET_IRBEM_NTIME_MAX. |
NENE_MAX | 25 | Maximum number of energy bins. |
NALPHA_MAX | 25 | Maximum number of pitch angles. |
ntime as long as the array is sized accordingly. Routines that still require fixed-size arrays note this explicitly in their documentation.
Key input parameters
Several routines share common input parameters that control the magnetic field model and coordinate system used. Refer to the following concept pages for full details:- External field model (
kext) - Options array (
options) - Coordinate system selector (
sysaxes) - Geophysical driving inputs (
maginput)
Routine categories
Magnetic Coordinates
Compute L*, Lm, Φ, and related magnetic coordinates.
Key routines:
MAKE_LSTAR, MAKE_LSTAR_SHELL_SPLITTING, LANDI2LSTAR.Field Line Tracing
Trace field lines, locate mirror points, find magnetic equators, and retrieve field vectors.
Key routines:
FIND_MIRROR_POINT, FIND_FOOT_POINT, TRACE_FIELD_LINE, FIND_MAGEQUATOR, GET_FIELD_MULTI, GET_MLT.Drift Shells
Compute full drift shells and drift-bounce orbits.
Key routines:
DRIFT_SHELL, DRIFT_BOUNCE_ORBIT.Coordinate Transformations
Transform position vectors between all supported coordinate systems.
Key routines:
COORD_TRANS_VEC, GEO2GSM, GSM2GEO, GEO2GSE, GSE2GEO, GEO2GDZ, GDZ2GEO, and more.Radiation Belt Models
Sample empirical radiation belt and dose models along an orbit.
Key routines:
FLY_IN_NASA_AEAP, GET_AE8_AP8_FLUX, FLY_IN_AFRL_CRRES, FLY_IN_IGE.Atmospheric Models
Evaluate neutral atmosphere density models.
Key routines:
MSIS86, MSISE90, NRLMSISE00.Orbit Propagation
Propagate satellite orbits from two-line element sets.
Key routine:
SGP4_TLE.Date & Time
Convert between calendar dates, Julian days, day-of-year, and decimal year.
Key routines:
JULDAY, CALDAT, GET_DOY, DECY2DATE_AND_TIME, DATE_AND_TIME2DECY.Library Info
Query library metadata and array-size constants.
Key routines:
IRBEM_FORTRAN_VERSION, IRBEM_FORTRAN_RELEASE, GET_IGRF_VERSION, GET_IRBEM_NTIME_MAX.