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.10.3.tar.gz (75.9 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.10.3-py3-none-any.whl (60.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for gmatpyplus-0.10.3.tar.gz
Algorithm Hash digest
SHA256 ace25efb3b40768769b3f9db5dcedca2cd1e32143e7cf71d3407163209586793
MD5 b6789145b22fb60af253af1583125cfe
BLAKE2b-256 54227911440e8be53f84999fcf513a616bbf1865f945527d807fd73da2d0f4b0

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for gmatpyplus-0.10.3-py3-none-any.whl
Algorithm Hash digest
SHA256 604d696260c3843eb255f12b02c89a965d705be74948eedcb351d7d808e6db32
MD5 e4301665f0e727863b0e9250e2c93fe6
BLAKE2b-256 ea4819a470fd5008fe6e24913078c57015ed791646ce01737615a24d625f9ea2

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