Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Utilities/Python/FDS_verification_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import fdsplotlib
import importlib
importlib.reload(fdsplotlib) # use for development (while making changes to fdsplotlib.py)
print("Using:", fdsplotlib.__file__)

# Scripts to run prior to dataplot

Expand Down
58 changes: 33 additions & 25 deletions Utilities/Python/fdsplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def dataplot(config_filename,**kwargs):

if kwargs.get('plot_range'):
plot_range_in = kwargs.get('plot_range')
plot_range = range(plot_range_in[0]-2,plot_range_in[-1])
plot_range = range(plot_range_in[0]-2,plot_range_in[-1]-1)

# read the config file
df = pd.read_csv(configdir+config_filename, sep=',', engine='python', comment='#', quotechar='"')
Expand Down Expand Up @@ -103,19 +103,24 @@ def dataplot(config_filename,**kwargs):
# read data from exp file
# set header to the row where column names are stored (Python is 0 based)
E = pd.read_csv(expdir+pp.d1_Filename, header=int(pp.d1_Col_Name_Row-1), sep=',', engine='python', comment='#', quotechar='"')

x = E[pp.d1_Ind_Col_Name].values[:].astype(float)
y = E[pp.d1_Dep_Col_Name].values[:].astype(float)
# y = E[pp.d1_Dep_Col_Name].values[:].astype(float)
col_names = [c.strip() for c in pp.d1_Dep_Col_Name.split('|')]
# print(col_names)
y = E[col_names].values.astype(float)

# plot the exp data
f = plot_to_fig(x_data=x, y_data=y,
data_label=pp.d1_Key,
x_label=pp.Ind_Title,
y_label=pp.Dep_Title,
marker_style=pp.d1_Style,
x_min=pp.Min_Ind,x_max=pp.Max_Ind,
y_min=pp.Min_Dep,y_max=pp.Max_Dep,
legend_location=pp.Key_Position
)
for i, label in enumerate(col_names):
# plot the exp data
f = plot_to_fig(x_data=x, y_data=y[:, i],
data_label=pp.d1_Key,
x_label=pp.Ind_Title,
y_label=pp.Dep_Title,
marker_style=pp.d1_Style,
x_min=pp.Min_Ind,x_max=pp.Max_Ind,
y_min=pp.Min_Dep,y_max=pp.Max_Dep,
legend_location=pp.Key_Position
)

# plt.figure(f.number) # make figure current
# plt.show()
Expand Down Expand Up @@ -145,7 +150,9 @@ def dataplot(config_filename,**kwargs):
# get the model results
M = pd.read_csv(cmpdir+pp.d2_Filename, header=int(pp.d2_Col_Name_Row-1), sep=',', engine='python', comment='#', quotechar='"')
x = M[pp.d2_Ind_Col_Name].values[:].astype(float)
y = M[pp.d2_Dep_Col_Name].values[:].astype(float)
# y = M[pp.d2_Dep_Col_Name].values[:].astype(float)
col_names = [c.strip() for c in pp.d2_Dep_Col_Name.split('|')]
y = M[col_names].values.astype(float)

version_string = revision
if (pp.VerStr_Filename):
Expand All @@ -154,18 +161,19 @@ def dataplot(config_filename,**kwargs):
version_string = Lines[0].strip()
file1.close()

f = plot_to_fig(x_data=x, y_data=y,
revision_label=version_string,
figure_handle=f,
x_label=pp.Ind_Title,
y_label=pp.Dep_Title,
data_label=pp.d2_Key,
line_style=pp.d2_Style,
x_min=pp.Min_Ind,x_max=pp.Max_Ind,
y_min=pp.Min_Dep,y_max=pp.Max_Dep,
legend_location=pp.Key_Position,
plot_title=pp.Plot_Title
)
for i, label in enumerate(col_names):
f = plot_to_fig(x_data=x, y_data=y[:, i],
revision_label=version_string,
figure_handle=f,
x_label=pp.Ind_Title,
y_label=pp.Dep_Title,
data_label=pp.d2_Key,
line_style=pp.d2_Style,
x_min=pp.Min_Ind,x_max=pp.Max_Ind,
y_min=pp.Min_Dep,y_max=pp.Max_Dep,
legend_location=pp.Key_Position,
plot_title=pp.Plot_Title
)

plt.figure(f.number) # make figure current
# plt.show()
Expand Down