aboutsummaryrefslogtreecommitdiffstats
path: root/mkfig_MdotR.py
blob: 93da82b647433b30eaac09db64c23a8002af54b4 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"""
Plot Mass Flow Profile -- Mdot(R).
"""

import matplotlib as mpl
mpl.use('agg')

import sys
from plots import plot_MdotR
from helpers import outputs
import numpy as np


# Parse Arguments
iout = 1
if len(sys.argv) == 2:
    iout = sys.argv[1]

# Compute Requested Outputs
iouts = outputs(iout)

# Loop over Requested Outputs, Determine MinMax
print "Determining MinMax."
first = True
for iiout in iouts[1:]:

    npz = np.load('MdotR_%05d.npz' % iiout)

    if first:
        vmin = npz["MdotR"].min()
        vmax = npz["MdotR"].max()
        first = False

    else:
        if npz["MdotR"].min() < vmin:
            vmin = npz["MdotR"].min()
        if npz["MdotR"].max() > vmax:
            vmax = npz["MdotR"].max()

    npz.close()

# Loop over Requested Outputs, Make Plots
for iiout in iouts[1:]:

    print "Saving Mass Flow Profile for Output %i." % iiout
    plot_MdotR(iout=iiout, \
               show=False, save=True, ftype='png',\
               vmin=vmin, vmax=vmax)