Skip to content

Commit 8ee0738

Browse files
committed
Python: add revision_string to LNG profiles
1 parent 89a7e60 commit 8ee0738

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Utilities/Python/scripts/LNG_wind_profiles.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import pandas as pd
1111
import numpy as np
12-
from fdsplotlib import plot_to_fig
12+
from fdsplotlib import plot_to_fig, get_version_string
1313
from matplotlib import pyplot as plt
1414
import os
1515

@@ -47,6 +47,7 @@
4747
# Read CSVs and force numeric conversion
4848
M_path = f"{expdir}{test[i]}_profile.csv"
4949
S_path = f"{outdir}{test[i]}_line.csv"
50+
version_string = get_version_string(f"{outdir}{test[i]}_git.txt")
5051

5152
M = pd.read_csv(M_path, skiprows=2)
5253
S = pd.read_csv(S_path, skiprows=2)
@@ -74,7 +75,8 @@
7475
# Plot velocity
7576
fig_u = plot_to_fig(x_data=M.iloc[:,1].values, y_data=M.iloc[:,0].values, figure_handle=None, marker_style='ko',
7677
x_label='Velocity (m/s)', y_label='Height (m)', plot_title=f'{test[i]} Velocity',
77-
x_min=0,x_max=15,y_min=0,y_max=30, data_label='Measured', legend_location='lower right')
78+
x_min=0,x_max=15,y_min=0,y_max=30, data_label='Measured', legend_location='lower right',
79+
revision_label=version_string)
7880
plot_to_fig(x_data=u, y_data=z, figure_handle=fig_u, marker_style='k-', data_label='M-O Theory')
7981
plot_to_fig(x_data=S.iloc[:,1].values, y_data=S.iloc[:,0].values, figure_handle=fig_u, marker_style='k--', data_label='Simulated')
8082

@@ -87,7 +89,8 @@
8789
x_max = col2_first_valid + 5
8890
fig_T = plot_to_fig(x_data=M.iloc[:,2].values, y_data=M.iloc[:,0].values, figure_handle=None, marker_style='ko',
8991
x_label='Temperature (°C)', y_label='Height (m)', plot_title=f'{test[i]} Temperature',
90-
x_min=x_min, x_max=x_max, y_min=0, y_max=30, data_label='Measured', legend_location='lower right')
92+
x_min=x_min, x_max=x_max, y_min=0, y_max=30, data_label='Measured', legend_location='lower right',
93+
revision_label=version_string)
9194
plot_to_fig(x_data=T-273.15, y_data=z, figure_handle=fig_T, marker_style='k-', data_label='M-O Theory')
9295
plot_to_fig(x_data=S.iloc[:,2].values, y_data=S.iloc[:,0].values, figure_handle=fig_T, marker_style='k--', data_label='Simulated')
9396

0 commit comments

Comments
 (0)