diff --git a/lasp/lasp_avstream.py b/lasp/lasp_avstream.py index 58f24d9..283b25b 100644 --- a/lasp/lasp_avstream.py +++ b/lasp/lasp_avstream.py @@ -157,6 +157,14 @@ class AudioStream: return 1 self.aframectr += 1 + # TODO: Fix this. This gives bug on Windows, the threading lock does + # give a strange erro. + try: + if not self.running(): + return 1 + except Exception as e: + print(e) + rv = self.processCallback(self, indata, outdata) if rv != 0: self.running <<= False diff --git a/lasp/lasp_measurement.py b/lasp/lasp_measurement.py index 76d0c25..94120ee 100644 --- a/lasp/lasp_measurement.py +++ b/lasp/lasp_measurement.py @@ -246,7 +246,7 @@ class Measurement: except KeyError: # If quantity data is not available, this is an 'old' # measurement file. - logging.debug('Physical quantity data not available in measurement file. Assuming {SIQtys.default}') + logging.debug(f'Physical quantity data not available in measurement file. Assuming {SIQtys.default}') self._qtys = [SIQtys.default for i in range(self.nchannels)] def setAttribute(self, atrname, value): diff --git a/lasp/tools/tools.py b/lasp/tools/tools.py index 07b88ca..742f7b0 100644 --- a/lasp/tools/tools.py +++ b/lasp/tools/tools.py @@ -84,6 +84,7 @@ def smoothSpectralData(freq, M, sw: SmoothingWidth, assert Noct > 0, "'Noct' must be absolute positive" if Noct < 1: raise Warning('Check if \'Noct\' is entered correctly') assert len(freq)==len(M), 'f and M should have equal length' + if st == SmoothingType.ps: assert np.min(M) >= 0, 'absolute magnitude M cannot be negative' if st == SmoothingType.levels and isinstance(M.dtype, complex):