Skip to main content

An extra wrapper for the GMAT Python API to simplify setting up mission simulations.

Project description

gmatpyplus

An extra wrapper library for the GMAT Python API to simplify setting up mission simulations. The wrapper aims to align Python commands with GMAT script ones, greatly reducing the number of lines required to model a mission. To do this, it automatically creates relevant subclasses and sets default values, while still allowing the user full control over parameters if they need something specific. The aim is to reduce the time that the user needs to spend thinking about how the API works, so they can instead focus on the orbital mechanics and broader design of their particular mission.

Due to the library's extensive use of classes and methods rather than strings, it also supports full code completion. It has been designed to be as intuitive as possible for the user, while still closely matching GMAT's design philosophy.

Compatibility

The library itself should be compatible with Python 3.9 to 3.14. If you find any incompatibilities, please raise an issue. However, out of the box, GMAT R2025a supports only Python 3.9 to 3.12. This means that without adding extra plugins to your GMAT install, this library can only be used with Python 3.9 to 3.12. You can find the required plugins and instructions on how to install them in the plugins directory. Only plugins for Windows are currently provided, so for use on Linux/Mac with non-default Python versions, you will have to compile the plugins yourself. Plugins for Linux/Mac will be added in a future release.

Getting Started

You can install this library with pip install gmatpyplus.

Then in your Python scripts, import the library:

import gmatpyplus as gp

gp is the recommended abbreviation as is used throughout this documentation.

Specifying GMAT path

For this library to be able to communicate with GMAT, you will also need to specify the path that GMAT is installed in. You can do this either using an environment variable or in a configuration file. As an example, we'll assume that your path to GMAT is C:\Users\joebloggs\Desktop\GMAT\gmat-win-R2025a on Windows, or /home/joebloggs/Desktop/GMAT/gmat-win-R2025a on Linux or macOS.

Environment variable

Create an environment variable called "GMAT" with its value set to the path to the GMAT folder.

Windows You can set the environment variable as either a user variable or system variable - we recommend a user variable.

To set it, open the Start menu, start typing "environment" and click the option for Edit the system environment variables (shown below).

Edit the system environment variables option in Start menu

A window will appear: click the Environment Variables... button at the bottom. Then, either under the user variables section at the top, or system variables section at the bottom, click New... to specify a new variable. Then enter "GMAT" as the name and your path to GMAT's root folder as the value.

"Edit User Variable" window

Linux On Linux, to set the environment variable for just your current session, run the following in the command line:
export GMAT="/path/to/GMAT"

For our example path, this would be:

export GMAT="/home/joebloggs/Desktop/GMAT/gmat-win-R2025a"

To set the variable permanently, add the line above to your ~/.bash_profile or ~/.bashrc file.

Examples

The examples directory gives several example scripts that demonstrate the power of this library (and GMAT generally). GMAT has several tutorials built-in, supplied in its [GMAT root]/samples folder. The scripts in examples/tutorials have exactly the same functionality as these, but have been written using this library rather than GMAT's standard Python API or its scripting language. Tutorials 1 to 4 are currently implemented, with the rest planned to be added in future once the library has the required features.

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

gmatpyplus-0.11.0.tar.gz (131.5 kB view details)

Uploaded Source

Built Distribution

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

gmatpyplus-0.11.0-py3-none-any.whl (83.0 kB view details)

Uploaded Python 3

File details

Details for the file gmatpyplus-0.11.0.tar.gz.

File metadata

  • Download URL: gmatpyplus-0.11.0.tar.gz
  • Upload date:
  • Size: 131.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for gmatpyplus-0.11.0.tar.gz
Algorithm Hash digest
SHA256 2cde0a2be755f3d789430eeeb558e5e996fab85c2b4ac4aac8e79fa44d602c22
MD5 694451ffd880ab6ed52686ad7d6dd4fc
BLAKE2b-256 56d9ff7763fbe1c206266e50476a93b931b630dad5548ac27e27946438fefcf6

See more details on using hashes here.

File details

Details for the file gmatpyplus-0.11.0-py3-none-any.whl.

File metadata

  • Download URL: gmatpyplus-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 83.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for gmatpyplus-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6d64a80e120ac29787a44134a74b3d09d614f4bfc9e8fbec31a8136b86a6e9bb
MD5 51e3d0e36d81fe5110928b36f67d7fd2
BLAKE2b-256 925d9a334a8dc30529a64f158983e55d3cb29ec89fc06ec243397f3d029b2a3b

See more details on using hashes here.

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