space::irbem::purr
cheatah-space v0.1.0-alpha — Biome Standard 0.6.5-alpha
Classes
Epoch— An epoch: the internal field model and the frame rotations for one instant.
Functions
The epoch for a date and time.
year | the calendar year. |
doy | the day of year, 1-366. |
ut_seconds | seconds since midnight UT. |
the epoch; Epoch::ok is false when the date lies outside IGRF's published range, in which case every routine taking it returns Status::OutOfValidityRange rather than a plausible wrong number.
O(NMAX²) once, then reused by every call that takes it.
none.
IrbemPurr.EpochMatchesTheTypedCoresystests/test_irbem.purrimport fixarray
import space.irbem.purr as irbem
let e = irbem.epoch_at(2015, 182, 43200.0)Whether e names an instant this model can evaluate.
e | the epoch. |
O(1).
none.
IrbemPurr.EpochMatchesTheTypedCoresystests/test_irbem.purrimport fixarray
import space.irbem.purr as irbem
let e = irbem.epoch_at(1750, 1, 0.0)
let usable = irbem.epoch_ok(e) # false — before IGRF beginsThe name of a Status code, for a program that wants to report why a call declined.
code | the status, as returned in a result array's status slot. |
a short name such as "Ok" or "OutOfValidityRange"; "Unknown" for an unrecognised code, so this never throws on a value from an older build.
O(1).
the returned string.
IrbemPurr.StatusNamesEveryCodesystests/test_irbem.purrimport io
import fixarray
import space.irbem.purr as irbem
io.print(irbem.status_name(0)) # -> Ok::cheatah::ndarray::NDArray make_lstar(const Epoch &e, double x1, double x2, double x3, int sysaxes, double pitch_angle_deg)
#
The magnetic coordinates of one point — IRBEM's MAKE_LSTAR.
e | the epoch, from epoch_at. |
x1 | first position component. |
x2 | second. |
x3 | third — read per |
sysaxes | IRBEM's frame code: 0 GDZ, 1 GEO, 2 GSM, 3 GSE, 4 SM, 5 GEI, 6 MAG, 7 SPH, 8 RLL. |
pitch_angle_deg | the local pitch angle; 90 is IRBEM's |
an ndarray of lstar_slots values: Lm, L*, Blocal, Bmin, I, MLT, and the Status code as the last slot. A declined call fills the physical slots with IRBEM's baddata and names the reason in the status slot rather than returning nothing.
~10⁵ field evaluations — the drift-shell integral.
one array of lstar_slots doubles.
IrbemPurr.MakeLstarMatchesTheTypedCoresystests/test_irbem.purrimport io
import fixarray
import space.irbem.purr as irbem
let e = irbem.epoch_at(2015, 182, 43200.0)
let c = irbem.make_lstar(e, 6.6, 0.0, 0.0, 1, 90.0)
io.print("L* =", c[1])Magnetic local time at a geographic point — IRBEM's GET_MLT.
e | the epoch, from epoch_at. |
x1 | first position component. |
x2 | second position component. |
x3 | third position component — read per |
sysaxes | the frame code the components are in. |
MLT in hours, folded into [0, 24); a negative value signals a declined call, which cannot collide with a real MLT.
O(1) beyond the frame transform.
none.
IrbemPurr.MltMatchesTheTypedCoresystests/test_irbem.purrimport io
import fixarray
import space.irbem.purr as irbem
let e = irbem.epoch_at(2015, 182, 43200.0)
io.print("MLT =", irbem.get_mlt(e, 6.6, 0.0, 0.0, 1))::cheatah::ndarray::NDArray coord_trans(const Epoch &e, double x1, double x2, double x3, int sysaxes_in, int sysaxes_out)
#
Convert a position between any two of IRBEM's frames — its COORD_TRANS.
e | the epoch, whose rotations the transform needs. |
x1 | first input component. |
x2 | second input component. |
x3 | third input component — read per |
sysaxes_in | the frame the input is in. |
sysaxes_out | the frame to convert to. |
an ndarray of four values: the three output components, then the Status code.
O(1) — at most two 3×3 products.
one array of four doubles.
IrbemPurr.CoordTransRoundTripssystests/test_irbem.purrimport fixarray
import space.irbem.purr as irbem
let e = irbem.epoch_at(2015, 182, 43200.0)
let gsm = irbem.coord_trans(e, 6.6, 0.0, 0.0, 1, 2) # GEO -> GSMConstants & variables
How many values make_lstar returns, and the slot each occupies.
Types
The internal-field truncation the facade pins.
Degree 13 is IGRF-14 as IAGA publishes it, and fixing it here is what removes Igrf's non-type template parameter from the surface.
