If values of sediment attenuation parameters are infinite, a warning is added and inversion computatio is not allowed #41

This commit is contained in:
brahim committed 2025-03-17 17:25:55 +01:00
1 parent 477ad00cf8
commit b99e950a8e
2 files changed
+22

No files matched your search

+11
View File
@@ -23,6 +23,7 @@
import os import os
import numpy as np import numpy as np
import pandas as pd import pandas as pd
from math import isinf
from copy import deepcopy from copy import deepcopy
@@ -398,6 +399,16 @@ class AcousticInversionTab(QWidget):
msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.exec() msgBox.exec()
elif isinf(stg.alpha_s[0]) or isinf(stg.alpha_s[1]):
msgBox = QMessageBox()
msgBox.setWindowTitle("Alpha computation error")
msgBox.setIconPixmap(
QPixmap(self.path_icon + "no_approved.png").scaledToHeight(32, Qt.SmoothTransformation))
msgBox.setText("Sediment sound attenuation is infinite !")
msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.exec()
else: else:
self.compute_VBI() self.compute_VBI()
+11
View File
@@ -27,6 +27,7 @@ from scipy.stats import linregress
import numpy as np import numpy as np
import pandas as pd import pandas as pd
from math import isinf
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm from matplotlib.colors import LogNorm
@@ -2246,6 +2247,16 @@ class SedimentCalibrationTab(QWidget):
msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.exec() msgBox.exec()
elif isinf(alpha_s_freq1) or isinf(alpha_s_freq2):
msgBox = QMessageBox()
msgBox.setWindowTitle("Alpha computation error")
msgBox.setIconPixmap(
QPixmap(self._path_icon("no_approved.png")).scaledToHeight(32, Qt.SmoothTransformation))
msgBox.setText("Sediment sound attenuation is infinite !")
msgBox.setStandardButtons(QMessageBox.Ok)
msgBox.exec()
else: else:
msgBox = QMessageBox() msgBox = QMessageBox()