aboutsummaryrefslogtreecommitdiff
path: root/run.py
blob: 9ba702451cc1924197487538740dd7065eb565e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env python3

import sys
import yaml
import matplotlib.pyplot as plt

from metpy.units import units

# Define custom gpm and gpdm units. The default gpm in metpy is aliased to meter.
# We need the correct definition
units.define('_gpm = 9.80665 * J/kg')
units.define('_gpdm = 10 * _gpm')

FILE = 'config.yaml'
if len(sys.argv) > 1:
    FILE = sys.argv[1]

conf = None
with open(FILE, 'r') as f:
    conf = yaml.safe_load(f)

for plotter in conf['plotter']:
    modname = plotter['module']
    del plotter['module']

    mod = __import__(modname)
    mod.run(**plotter)

    plt.close('all')