API reference#

This page gives an overview of the routines within the pymsis package. To calculate atmospheric constituents at grid points, use the calculate() function. This is typically the only function you will need to use. You can access the output variables using the Variable enumeration for easier indexing into the output data array. For example, as output_array[..., Variable.MASS_DENSITY].

calculate

Call MSIS to calculate the atmosphere at the provided input points.

Variable

Enumeration of variable data indices for the output from calculate().

msis module#

For more control and help creating properly formatted inputs, one can use the pymsis.msis module. This module provides functions to create input data, create the options list, and run the model.

msis.create_input

Combine all input values into a single flattened array.

msis.create_options

Create the options list based on keyword argument choices.

msis.calculate

Call MSIS to calculate the atmosphere at the provided input points.

utils module#

The MSIS model requires solar forcing data (F10.7 and ap) to calculate the state of the atmosphere. When running over past time periods, this data is automatically downloaded and used if not specified by the user. For more control over the F10.7 and Ap values the model is using, one can input the desired values into the calculate() call calculate(..., f107s=..., f107as=..., aps=...). To get the values used automatically by the model, the pymsis.utils module has several helper routines to download new files (will retrieve a file with data up to the present) and get the proper F10.7 and ap values to use for a specific date and time.

utils.download_f107_ap

Download the latest ap and F10.7 values.

utils.get_f107_ap

Retrieve the F10.7 and ap data needed to run msis for the given times.