Skip to content

Commit b2ded25

Browse files
committed
Fix previous bug with thermo data plotting
Previous implementation multiplied list by 418400 length rather than scaling each item by said amount. This caused the plot to show basically the same value plotted a bunch of times because it was stretched out.
1 parent 67d2895 commit b2ded25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rmgpy/tools/canteramodel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,10 @@ def plot(self, data, top_species=10, top_sensitive_reactions=10, top_sensitive_s
433433
num_reactions=top_sensitive_reactions).barplot(
434434
os.path.join(self.output_directory, '{0}_{1}_reaction_sensitivity.png'.format(i + 1, species.to_chemkin())))
435435
if self.thermo_SA:
436+
for k in range(len(thermodynamic_sensitivity_data)):
437+
thermodynamic_sensitivity_data[k].data *= 4184000 # convert from J/kmol to kcal/mol
436438
ThermoSensitivityPlot(x_var=time,
437-
y_var=thermodynamic_sensitivity_data[j * num_ct_species:(j + 1) * num_ct_species]*4184000,
439+
y_var=thermodynamic_sensitivity_data[j * num_ct_species:(j + 1) * num_ct_species],
438440
xlabel='dln(c)/d(H_i) [(kcal/mol)^-1]',
439441
num_species=top_sensitive_species).barplot(
440442
os.path.join(self.output_directory, '{0}_{1}_thermo_sensitivity.png'.format(i + 1, species.to_chemkin())))

0 commit comments

Comments
 (0)