Skip to content

Commit e43baa6

Browse files
Bug fixes.
Updated user guide.
1 parent b4b632b commit e43baa6

File tree

6 files changed

+90
-74
lines changed

6 files changed

+90
-74
lines changed

Controller.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def plotCustom(self, wave, time, v_min, v_max, model, cont, custom, mul,
376376
def plotSolo(self, wave, time, v_min, v_max, model, cont, solo, mul,
377377
add=""):
378378
"""
379-
Allows for the creation of 1-3 subplots in one plot.
379+
Allows for the creation of single plots.
380380
381381
Parameters
382382
----------
@@ -594,6 +594,8 @@ def saveResults(self, model, tau_start, tau_fit, l_limits, d_limits, A_fit,
594594
None.
595595
596596
"""
597+
for i,n in enumerate(tau_fit):
598+
tau_fit[i] = round(n,2)
597599
time_unit = self.labels[1].split("/")[1]
598600
x_axis_unit = self.labels[0].split("/")[1]
599601
if model == 0:

EfsTA.py

Lines changed: 34 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -136,25 +136,7 @@ def setText(self, model, Controller):
136136
"""
137137
self.ui.textResults.clear()
138138
text = Controller.getResults(model)
139-
self.ui.textResults.append(text)
140-
141-
def closePopupMatrix(self,popup):
142-
"""
143-
Transfers the custom matrix input by the user from the popup object to
144-
the main window and closes the popup window.
145-
146-
Parameters
147-
----------
148-
popup : TableWindow
149-
The TableWindow object created by the main window.
150-
151-
Returns
152-
-------
153-
None.
154-
155-
"""
156-
self.custom_matrix = popup.custom_matrix
157-
popup.close()
139+
self.ui.textResults.append(text)
158140

159141
#####################################MAIN######################################
160142

@@ -921,6 +903,24 @@ def checkIfCustomMatrixEmpty(self):
921903
self.openFailSafe("Please input a kinetic matrix.")
922904
return True
923905

906+
def closePopupMatrix(self,popup):
907+
"""
908+
Transfers the custom matrix input by the user from the popup object to
909+
the main window and closes the popup window.
910+
911+
Parameters
912+
----------
913+
popup : TableWindow
914+
The TableWindow object created by the main window.
915+
916+
Returns
917+
-------
918+
None.
919+
920+
"""
921+
self.custom_matrix = popup.custom_matrix
922+
popup.close()
923+
924924
#####################################PREPARE PARAMETERS########################
925925

926926
def summonRadio(self,layout_origin):
@@ -1120,15 +1120,19 @@ def rawPlotting(self):
11201120
if hasattr(self, "Controller") == False:
11211121
self.openFailSafe("Please select a directory first.")
11221122
else:
1123-
ds = sorted(self.getDelaySlices())
1124-
ws = sorted(self.getWavelengthSlices())
1125-
db = [self.getLowerDelayBound(), self.getUpperDelayBound()]
1126-
wb = [self.getLowerWavelengthBound(), self.getUpperWavelengthBound()]
1127-
self.Controller.createOrigData(db,wb, None, None)
1128-
self.ui.plot_concentrations.setChecked(False)
1129-
self.ui.plot_das_sas.setChecked(False)
1130-
self.ui.plot_residuals.setChecked(False)
1131-
self.plotting(ds, ws, 0, True)
1123+
if hasattr(self.Controller, "delays_filename") == False:
1124+
self.openFailSafe("Please select a valid directory first.")
1125+
else:
1126+
self.getAxis()
1127+
ds = sorted(self.getDelaySlices())
1128+
ws = sorted(self.getWavelengthSlices())
1129+
db = [self.getLowerDelayBound(), self.getUpperDelayBound()]
1130+
wb = [self.getLowerWavelengthBound(), self.getUpperWavelengthBound()]
1131+
self.Controller.createOrigData(db,wb, None, None)
1132+
self.ui.plot_concentrations.setChecked(False)
1133+
self.ui.plot_das_sas.setChecked(False)
1134+
self.ui.plot_residuals.setChecked(False)
1135+
self.plotting(ds, ws, 0, True)
11321136

11331137
def plotting(self,ds,ws,model,raw):
11341138
"""
@@ -1199,7 +1203,7 @@ def checkIfMethodSelected(self):
11991203
self.ui.GTA_radio_preset_model.isChecked() == False and
12001204
self.ui.GTA_radio_custom_model.isChecked() == False and
12011205
self.ui.GTA_radio_custom_matrix.isChecked() == False):
1202-
self.openFailSafe("Please select an evaluation method.")
1206+
self.openFailSafe("Please select an analysis method.")
12031207
return False
12041208

12051209
def finalCheck(self):
@@ -1655,4 +1659,4 @@ def clearPickle(self):
16551659
EfsTA.setStyle('Fusion')
16561660
mainwindow = MainWindow()
16571661
mainwindow.show()
1658-
sys.exit(EfsTA.exec_())
1662+
sys.exit(EfsTA.exec_())

Model.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import matplotlib as mpl
22
import matplotlib.pyplot as plt
33
import matplotlib.colors as col
4-
from matplotlib.ticker import LogLocator
54
import matplotlib.ticker as mticker
65
import os
76
import numpy as np
@@ -711,11 +710,11 @@ def plot1(self, grid, wave, wave_index, spectra, mul, labels):
711710
ax1.set_xlabel(labels[2] + dot)
712711
ax1.set_ylabel(labels[1])
713712

714-
for ind in wave_index:
713+
for i, ind in enumerate(wave_index):
715714
ax1.plot(
716715
spectra[ind],
717716
self.delays,
718-
label=str(self.lambdas[ind]) + unit
717+
label=str(wave[i]) + unit
719718
)
720719
ax1.axvline(0, color="black",lw = 0.5 , alpha=0.75)
721720
temp = np.concatenate([spectra[i]
@@ -847,15 +846,15 @@ def plot3(self, grid, time, time_index, spectra, mul, labels):
847846
y = np.zeros(len(self.lambdas))
848847
hoehe = 0
849848
temp = np.zeros(len(self.lambdas))
850-
for i in time_index:
849+
for i, ind in enumerate(time_index):
851850
for j in range(len(self.lambdas)):
852-
temp[j] = spectra[j][i]
851+
temp[j] = spectra[j][ind]
853852
y[j] = temp[j] + hoehe
854-
if i == time_index[0]:
853+
if ind == time_index[0]:
855854
mini = min(y)
856855
ax3.plot(self.lambdas, y, color="black")
857856
ax3.annotate(
858-
str(self.delays[i]) + unit, (0.5 * (min(self.lambdas) +
857+
str(time[i]) + unit, (0.5 * (min(self.lambdas) +
859858
max(self.lambdas)), hoehe)
860859
)
861860
ax3.axhline(hoehe, color="black", lw = 0.5, alpha = 0.75)
@@ -1009,7 +1008,7 @@ def plotCustom(self, spectra, wave, time, v_min, v_max, custom, cont, mul, label
10091008
if w3 == 0:
10101009
cb.set_label(labels[2] + dot)
10111010
if w2 == 4.7:
1012-
ax2.yaxis.set_major_locator(LogLocator())
1011+
ax2.yaxis.set_major_locator(mticker.LogLocator())
10131012
ax2.set_ylabel(labels[1])
10141013
if w3 != 0:
10151014
self.plot3(grid, time, time_index, spectra*mul, mul, labels)
@@ -1200,7 +1199,7 @@ def plotHeat(self, wave, time, v_min, v_max, spectra, cont, mul, labels, add):
12001199
ax.set_yscale("log")
12011200
ax.set_xlabel(labels[0])
12021201
ax.set_ylabel(labels[1])
1203-
A_t = spectra.T
1202+
A_t = spectra.T*mul
12041203
pcm = ax.pcolormesh(
12051204
self.lambdas,
12061205
self.delays,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626

2727
NumPy, SciPy, asteval, uncertainties, lmfit, PyQt, matplotlib
2828

29+
## **Known Problems**
2930

30-
31-
31+
On rare occasions the program randomly segfaults. After starting the program again usually everything is just fine

0 commit comments

Comments
 (0)