示例#1
0
def mas_directory(request):
    if request.param == 'mas_helio':
        # Check for and download data if not present
        directory = sample_data.mas_helio()
    else:
        # Directories with MAS outputs
        directory = test_data_dir / request.param
    if not directory.exists():
        pytest.xfail(f'Could not find MAS data directory at {directory}')

    return directory
示例#2
0
======================

This example shows how to plot slices of constant radial distance from a MAS model
output.
"""
###############################################################################
# First, load the required modules.
from psipy.model import MASOutput
from psipy.data import sample_data

import matplotlib.pyplot as plt

###############################################################################
# Next, load a set of MAS output files. You will need to change this line to
# point to a folder with MAS files in them.
mas_path = sample_data.mas_helio()
model = MASOutput(mas_path)

###############################################################################
# Each MAS model contains a number of variables. The variable names can be
# accessed using the ``.variables`` attribute.
print(model.variables)

###############################################################################
# Set parameters for plotting. The first line will give us a horizontal
# errorbar underneath the plots. The second line is the index to select for the
# radial slice.
cbar_kwargs = {'orientation': 'horizontal'}
r_idx = 139

###############################################################################