Skip to main content

Run GMAT mission scripts from Python and get results as pandas DataFrames.

Project description

gmat-run

CI Docs PyPI Python versions License: MIT

Run GMAT mission scripts from Python and get results as pandas DataFrames.

What this is

A thin, Pythonic wrapper around NASA GMAT's own gmatpy runtime. You bring a working .script; gmat-run loads it, lets you override fields from Python, runs the mission headlessly, and returns ReportFile / ephemeris / ContactLocator output as pandas DataFrames.

What this is not

  • Not a way to build GMAT missions from scratch in Python — see gmatpyplus for that.
  • Not a .script text generator — see pygmat.
  • Not a parallel sweep runner — that's a future astro-tools project (gmat-sweep) built on top.

Requirements

  • Python 3.10, 3.11, or 3.12.
  • A local GMAT install. gmat-run does not ship GMAT binaries — install GMAT separately from gmat.gsfc.nasa.gov.

Supported GMAT versions

GMAT release Status CI
R2026a Primary development target Exercised on every PR (Ubuntu + Windows + macOS)
R2025a Expected to work Not exercised in CI
R2024a Expected to work Not exercised in CI
R2023a Expected to work Not exercised in CI
R2022a Expected to work Not exercised in CI

A wider CI matrix is planned for a follow-up release; report any version-specific breakage as an issue and we'll add a CI cell for it.

Installation

pip install gmat-run

For SPK ephemerides, install the spiceypy extra:

pip install gmat-run[spiceypy]

Quick start

Load a script, override a field, run the mission, and read each output GMAT wrote as a pandas DataFrame:

from gmat_run import Mission

mission = Mission.load("flyby.script")
mission["Sat.SMA"] = 7000
result = mission.run()

# ReportFile → DataFrame, with UTCGregorian / *ModJulian epoch columns
# promoted to datetime64[ns].
result.reports["ReportFile1"].plot(x="UTCGregorian", y="Sat.Earth.Altitude")

# EphemerisFile → DataFrame, dispatching on file format.
ephem = result.ephemerides["EphemerisFile1"]

# ContactLocator → DataFrame; df.attrs["report_format"] carries the variant.
contacts = result.contacts["ContactLocator1"]

Mission.load discovers a local GMAT install (honouring the GMAT_ROOT environment variable or a gmat_root= argument), bootstraps gmatpy, and parses the script into the live GMAT object graph. Subscript access reads and writes fields against that graph with type coercion. mission.run() executes the mission sequence headlessly, captures GMAT's log, and returns a Results exposing three lazy mappings — reports, ephemerides, and contacts — each keyed by the GMAT resource name and parsing to a DataFrame on first access. See Outputs below for the formats covered.

A gmat-run console script is also installed for shell-script and smoke-test use:

gmat-run run flyby.script --out results/

See the CLI reference for flags, exit codes, and sample output.

Outputs

Results exposes three mappings, each keyed by the GMAT resource name as declared in the .script:

  • ReportFile → DataFrame, with UTCGregorian and *ModJulian epoch columns promoted to datetime64[ns].
  • EphemerisFile → DataFrame, dispatching on file format: CCSDS-OEM and STK-TimePosVel are read out of the box; SPK (NASA SPICE binary) is read with the [spiceypy] extra installed. Code-500 (GSFC binary) is tracked for v0.3 (#50).
  • ContactLocator → DataFrame, supporting Legacy and the five tabular ReportFormat variants. df.attrs["report_format"] carries the variant name so downstream code can branch on it without inspecting the column set.

Documentation

Full docs at https://astro-tools.github.io/gmat-run/, including a getting-started guide, GMAT install instructions, the CLI reference, and the API reference.

Runnable example notebooks:

  • Load / run / plot — load a stock GMAT sample, run it, and plot altitude over time end-to-end.
  • Parameter sweep — vary Sat.SMA across a range, run the same script for each, and overlay the resulting orbits.
  • Ground track — read an EphemerisFile from Results.ephemerides and plot the spacecraft's ground track on a Cartopy world map.

Development

To work on gmat-run itself:

git clone https://github.com/astro-tools/gmat-run.git
cd gmat-run
uv sync --all-groups

See CONTRIBUTING.md for the full branch / PR / test workflow.

Licence

MIT. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gmat_run-0.2.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gmat_run-0.2.0-py3-none-any.whl (62.2 kB view details)

Uploaded Python 3

File details

Details for the file gmat_run-0.2.0.tar.gz.

File metadata

  • Download URL: gmat_run-0.2.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gmat_run-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4ad969ac7f5a9813351b0cea1154cc43fb3b02c187f83b3cbc119f95fa95359e
MD5 07743ee05109f767e6942caf0c9876da
BLAKE2b-256 8e5909a42bacec593000e0d3fd74aceb6e1ccf981330bb8974ba7720f05ab8c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_run-0.2.0.tar.gz:

Publisher: release.yml on astro-tools/gmat-run

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gmat_run-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: gmat_run-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 62.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for gmat_run-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 43f06512278a0356c55ca6aadd9b8238474ac9afa622523291ea794b84db9e77
MD5 840ddbfe3b59784f18b633180fc28bf0
BLAKE2b-256 94285773983bc9db640779e36a48a0000199aed9376e1eca9e3b6367eeddb50b

See more details on using hashes here.

Provenance

The following attestation bundles were made for gmat_run-0.2.0-py3-none-any.whl:

Publisher: release.yml on astro-tools/gmat-run

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page