-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPost.py
More file actions
110 lines (93 loc) · 3.67 KB
/
Post.py
File metadata and controls
110 lines (93 loc) · 3.67 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 28 12:11:44 2022
@author: Vollhüter
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
class Post():
"""Post processing."""
def tracer(result, rain, sample):
"""Visualize the result of the tracer calculations."""
sample_vis = sample.drop(sample[sample[3] == 0].index)
fig = plt.figure(figsize=(8, 5), constrained_layout=True)
ax1 = fig.add_subplot(2, 1, 1)
ax2 = fig.add_subplot(2, 1, 2)
ax1.plot(rain['Date'], rain[3], color='green')
ax1.plot(sample_vis['Date'], sample_vis[1], visible=False)
ax2.plot(rain['Date'], result, color='red')
ax2.plot(sample_vis['Date'], sample_vis[1], 'x')
ax1.set(title='Tracer Source',
ylabel='$c$ [TU]',
xlabel='t',
ylim=0)
ax2.set(title='Tracer Sink',
ylabel='$c$ [TU]',
xlabel='t',
ylim=0)
ax1.grid()
ax2.grid()
def tracerTracer(result_tt, rain, rain_2, date, show_gw_age, TTs):
"""Visualize the result of the tracer tracer calculations."""
result_tt = np.transpose(result_tt, axes=[2, 1, 0])
fig = plt.figure(figsize=(10, 20), constrained_layout=True)
ax1 = fig.add_subplot(3, 1, 1)
ax2 = fig.add_subplot(3, 1, 2)
ax1.plot(rain['Date'], rain[3], label='Input Tracer 1')
ax1.plot(rain_2['Date'], rain_2[3], label='Input Tracer 2')
ax2.plot(result_tt[date, :, 0], result_tt[date, :, 1])
ax2.scatter(result_tt[date, :, 0], result_tt[date, :, 1])
ax1.set(title='Tracer input',
ylabel='$c_{Tracers}$ [TU]',
xlabel='t',
ylim=0)
ax2.set(title='Tracer output',
xlabel='$c_{Tracer\ 1}$ [TU]',
ylabel='$c_{Tracer\ 2}$ [TU]',
xlim=0,
ylim=0)
k = 0
j = 0
tau = np.zeros(2, 4, len(show_gw_age))
for i in TTs:
if i in show_gw_age:
plt.text(result_tt[date, k, 0]*1.02,
result_tt[date, k, 1],
str(i), backgroundcolor='black',
color='white')
ax2.plot([0, result_tt[date, k, 0]],
[0, result_tt[date, k, 1]],
color='black')
for n in range(1, 5):
tau[:, n-1, j] = (n*0.25*result_tt[date, k, 0],
n*0.25*result_tt[date, k, 1])
j += 1
k += 1
for n in range(tau.shape[1]-1):
ax2.plot(tau[0, n, :], tau[1, n, :], label=str(75 - n * 25))
ax1.grid()
ax2.grid()
ax1.legend()
ax2.legend(title='Tritium free water [%]:')
def triHe1(result_tt, rain, date, show_gw_age, TTs):
"""Visualize the result of the tritium helium calculations."""
fig = plt.figure(figsize=(10, 20), constrained_layout=True)
ax1 = fig.add_subplot(3, 1, 1)
ax2 = fig.add_subplot(3, 1, 2)
ax1.plot(rain['Date'], rain[3])
ax2.plot(TTs,
result_tt[0, :, date] / result_tt[1, :, date])
ax2.scatter(TTs,
result_tt[0, :, date] / result_tt[1, :, date])
ax1.set(title='Input concentration',
ylabel='$c_{Trithium}$ [TU]',
xlabel='t',
ylim=0)
ax2.set(title='Output concentration on ' + str(rain['Date'][date]),
xlabel='$T$ [a]',
ylabel='$c_{3H/(3H+4He)}$',
xlim=0,
ylim=0)
ax1.grid()
ax2.grid()