-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpostProc.py
40 lines (31 loc) · 923 Bytes
/
postProc.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
34
35
36
37
38
39
40
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jan 7 17:47:23 2019
@author: levi
A module for post processing.
"""
import interf
import probRock as prob
import matplotlib.pyplot as plt
def loadSol(fileName):
""" Load and return a solution for inspection."""
ITman = interf.ITman(probName=prob.prob.probName,isInteractive=True)
sol = ITman.loadSol(path=fileName)
return sol
def IvsQ(fileList):
"""Plot a graph for I history vs. Q history."""
# Produce a list if it is not the case
if not isinstance(fileList,list):
fileList = [fileList]
for file in fileList:
sol = loadSol(file)
histI = sol.histI[0:(sol.NIterGrad + 1)]
histQ = sol.histQ[0:(sol.NIterGrad + 1)]
plt.semilogx(histQ,histI,label=file)
plt.grid(True)
plt.legend()
plt.xlabel('Hist Q')
plt.ylabel('Hist I')
plt.title('I vs. Q')
plt.show()