diff --git a/View/acoustic_inversion_tab.py b/View/acoustic_inversion_tab.py index f702ede..ec13ce3 100644 --- a/View/acoustic_inversion_tab.py +++ b/View/acoustic_inversion_tab.py @@ -23,6 +23,7 @@ import os import numpy as np import pandas as pd +from math import isinf from copy import deepcopy @@ -398,6 +399,16 @@ class AcousticInversionTab(QWidget): msgBox.setStandardButtons(QMessageBox.Ok) 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: self.compute_VBI() diff --git a/View/sediment_calibration_tab.py b/View/sediment_calibration_tab.py index d1575a8..838dea4 100644 --- a/View/sediment_calibration_tab.py +++ b/View/sediment_calibration_tab.py @@ -27,6 +27,7 @@ from scipy.stats import linregress import numpy as np import pandas as pd +from math import isinf import matplotlib.pyplot as plt from matplotlib.colors import LogNorm @@ -2246,6 +2247,16 @@ class SedimentCalibrationTab(QWidget): msgBox.setStandardButtons(QMessageBox.Ok) 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: msgBox = QMessageBox()