Overview
Themacros module provides lightweight helpers for the time conversions Basilisk relies on internally (all simulation times are integers in nanoseconds) and a set of common unit-conversion constants.
Time conversion functions
All conversion functions return anint (nanoseconds), suitable for direct use as task rates, stop times, and event rates.
Converts seconds to integer nanoseconds.Returns
int.Converts minutes to integer nanoseconds.
Converts hours to integer nanoseconds.
Converts days to integer nanoseconds.
Time-unit constants
Use these to convert logged nanosecond timestamps back to human-readable units.| Constant | Value | Description |
|---|---|---|
NANO2SEC | 1e-9 | Nanoseconds → seconds |
NANO2MIN | 1/60 × 1e-9 | Nanoseconds → minutes |
NANO2HOUR | 1/3600 × 1e-9 | Nanoseconds → hours |
Angular unit constants
| Constant | Value | Description |
|---|---|---|
D2R | π / 180 | Degrees → radians |
R2D | 180 / π | Radians → degrees |
RPM | 2π / 60 | RPM → rad/s |
rpm2radsec | 2π / 60 | RPM → rad/s (alias) |