Reference
Install, build, test
The plant is a pybind11 extension built with CMake. Everything else is Python 3.12.
Environment
The intended environment is the arlamx mamba env from environment.yml. It pins conda-forge CPU PyTorch and Stable-Baselines3, so pip cannot overlay a CUDA wheel. pymsis is the only pip package. Do not pip install -r requirements.txt into the conda env; that file is only a pip-side hint.
mamba env create -f environment.yml # first time
mamba activate arlamx
mamba env update -n arlamx -f environment.yml
On this machine the arlamx env is not present. ~/miniforge3/envs/ThesisMS works with the already-built library, and it is the interpreter that ran the tests below.
| Dependency | Used for |
|---|---|
| numpy, scipy | everything numeric, verify scripts |
| gymnasium, stable-baselines3, torch | env API, PPO/SAC/TD3, INT8 quantization |
| pymsis | NRLMSIS 2.1 / NRLMSISE-00 atmosphere |
| trimesh (+ cascadio for STEP) | geometry import and plate simplification |
| pyyaml | all configuration |
| pybind11, cmake, a C++17 compiler | building arlamx_cpp |
| CSPICE (optional) | JPL ephemerides for the Sun and Moon (see below) |
| Basilisk (optional) | referee tests in tests/basilisk_ref/ |
Build the C++ plant
./build.sh # uses $ARLAMX_PYTHON or the arlamx env interpreter
ARLAMX_PYTHON=~/miniforge3/envs/ThesisMS/bin/python ./build.sh
build.shrefuses any interpreter that is not Python 3.12. It prefers that env'scmake/c++, and it drops a stale CMake cache that belongs to another source directory.- Flags:
-O3 -Wall -Wextra, C++17, Release. The output goes straight topython/arlamx_v2/arlamx_cpp.cpython-312-x86_64-linux-gnu.so. - Sources:
aero/sentman.cpp, aero/cll.cpp, srp/panel_srp.cpp, orbit/{frames,gravity,third_body}.cpp, attitude/{mrp,integrate}.cpp, control/{mrp_feedback,quat_feedback,bdot,magnetorquer}.cpp, mag/field.cpp, onboard/propagator_f32.cpp, api.cpp, bindings.cpp.
Building with CSPICE (needed for an ephemeris-file Moon)
cpp/CMakeLists.txt enables ARLAMX_HAVE_CSPICE only when both CSPICE_INCLUDE/SpiceUsr.h and CSPICE_LIB exist. The default falls back to one hard-coded Conan path under /home/nekolny/.conan2/…. In the current build/CMakeCache.txt both variables are empty, so the shipped .so has no SPICE and uses the analytic Sun and Moon.
# get the NAIF toolkit (cspice.a + include/) from naif.jpl.nasa.gov, then:
cmake -S cpp -B build -DCSPICE_INCLUDE=/opt/cspice/include -DCSPICE_LIB=/opt/cspice/lib/cspice.a
cmake --build build -j
# look for: "ARLAMX: CSPICE enabled (...)" in the configure output
Kernels are data, not source. For LEO work you want an SPK such as de440s.bsp (or de430.bsp). An LSK (naif0012.tls) is only needed if you convert UTC strings. See Moon from an ephemeris file for how to load them.
Data files
python/arlamx_v2/paths.py resolves each file in this order: environment variable, then repo-local data/, then historical Basilisk / V1.7 paths.
| File | Env var | Content |
|---|---|---|
data/GGM03S.txt | ARLAMX_GGM | GRACE GGM03S Stokes coefficients (header Re, μ, ω, nmax, mmax) |
data/WMM.COF | ARLAMX_WMM | WMM-2020 (epoch 2020.0). This is the default. |
data/WMM2025.COF | (set ARLAMX_WMM to it) | WMM-2025, the valid model for the 2026 epoch. It is not the default; see known limits. |
data/earthcup_hex_v3.geom | ARLAMX_HEX_GEOM | hex sail plate model (the default env geometry) |
data/SolarCat_v3_1pct_plates.geom | — | 176-plate SolarCat_v3 model (SC_v1–v3_6mq) |
data/SolarCat_*.stl | ARLAMX_SOLARCAT_STL | CAD meshes |
data/{julian_date,position,velocity}.csv | — | reference trajectory samples |
Tests
python main.py test # pytest tests -q
python main.py verify # tests/validation/verify_physics.py: scipy / finite-difference / textbook cross-checks
268 passed in 7.86 s with ~/miniforge3/envs/ThesisMS/bin/python, including the Basilisk referee tests (Basilisk is installed here). The README says 259; the count has grown since then.Test layout: one folder per module (aero, srp, orbit, attitude, control, mag, geometry, estimators, sensors, power, propagator, reward, duo), plus basilisk_ref, integration, physics (wiring + disturbances) and validation (hostile inputs + independent verify).