forked from petebachant/UNH-RVAT-2D-OpenFOAM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot.py
executable file
·33 lines (27 loc) · 1.1 KB
/
plot.py
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
#!/usr/bin/env python
"""Create plots from the UNH-RVAT 2-D OpenFOAM case."""
from pyurof2dsst import processing, plotting
import matplotlib.pyplot as plt
from pxl.styleplot import set_sns
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Plotting results")
parser.add_argument("plots", nargs="*", default="perf",
help="What to plot")
parser.add_argument("--style", "-S", help="Matplotlib style sheet")
parser.add_argument("--save", "-s", action="store_true", help="Save plots")
parser.add_argument("--noshow", action="store_true", default=False,
help="Do not show")
args = parser.parse_args()
if args.style is not None:
plotting.plt.style.use(args.style)
else:
set_sns()
plotting.plt.rcParams["axes.grid"] = True
if "perf" in args.plots:
processing.calc_perf(plot=not args.noshow, inertial=False)
if "wake" in args.plots:
plotting.plot_u(save=args.save)
plotting.plot_k(amount="resolved", save=args.save)
if not args.noshow:
plt.show()