Compare commits

...

7 Commits

Author SHA1 Message Date
Anne de Jong fd8366c362 Bugfix in measurementset
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Waiting to run Details
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Blocked by required conditions Details
2024-01-12 15:18:58 +01:00
Anne de Jong 6d5899c880 Merged in develop
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Successful in 2m39s Details
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Has been skipped Details
2024-01-10 17:31:59 +01:00
Anne de Jong 061beaf88b Small bugfix of some dead code 2024-01-10 17:30:56 +01:00
Anne de Jong 44fe7f2689 Bump 1.0.4
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Successful in 2m13s Details
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Successful in -46s Details
2023-10-27 15:02:44 +02:00
Anne de Jong f72a635cc7 Cleanup volume before copying
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Successful in 2m14s Details
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Has been skipped Details
2023-10-26 15:17:50 +02:00
Anne de Jong e9d7f0561e Revert "Possible bugfix for pyinstaller"
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Successful in 2m16s Details
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Has been skipped Details
This reverts commit 17319c4925.
2023-10-24 22:38:34 +02:00
Anne de Jong 17319c4925 Possible bugfix for pyinstaller
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Has been skipped Details
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Failing after 2m7s Details
2023-10-24 20:56:07 +02:00
4 changed files with 59 additions and 5 deletions

View File

@ -23,8 +23,9 @@ jobs:
pip install dist/lasp*.whl
pytest
- name: Copy dist files to /dist dir
run:
- name: Cleanup old dist files and copy new to /dist dir
run: |-
rm /dist/*
cp -v dist/* /dist
Release-Ubuntu:

View File

@ -209,6 +209,7 @@ class FilterBankDesigner:
Returns:
h: Linear filter transfer function [-]
"""
fs = self.fs
fir = self.createFirFilter(fs, x)
# Decimated sampling frequency [Hz]

View File

@ -91,6 +91,15 @@ class MeasurementType(Enum):
# Measurement serves as impedance tube calibration (long tube case)
muZCalLong = 1 << 3
def __str__(self):
match self:
case MeasurementType.NotSpecific: return '-'
case MeasurementType.ILReference: return 'Insertion loss reference'
case MeasurementType.CALGeneral: return 'General calibration'
case MeasurementType.muZCalShort: return 'ASCEE μZ short length calibration'
case MeasurementType.muZCalLong: return 'ASCEE μZ long length calibration'
case _: raise ValueError("Not a MeasurementType")
def getSampWidth(dtype):
"""Returns the width of a single sample in **bytes**.

View File

@ -4,8 +4,9 @@ on a group of measurements at the same time.
"""
__all__ = ['MeasurementSet']
from .lasp_measurement import Measurement
from .lasp_measurement import Measurement, MeasurementType
from typing import List
import time
class MeasurementSet(list):
@ -14,7 +15,8 @@ class MeasurementSet(list):
is used to operate on multiple measurements at once.
"""
def __init__(self, mlist: List[Measurement] =[]):
def __init__(self, mlist: List[Measurement]=[]):
"""
Initialize a measurement set
@ -27,6 +29,48 @@ class MeasurementSet(list):
super().__init__(mlist)
def getNewestReferenceMeasurement(self, mtype: MeasurementType):
"""Return the newest (in time) measurement in the current list of a certain type. Returns None in case no measurement could be found.
Args:
mtype (MeasurementType): The type required.
"""
mnewest = None
for m in self:
if m.measurementType() == mtype:
if mnewest is None:
mnewest = m
else:
if mnewest.time < m.time:
mnewest = m
return mnewest
def getNewestReferenceMeasurements(self):
"""Returns a dictionary with newest measurement of each type that is not specific returns None in case no measurement is found."""
newest = {}
for m in self:
mtype = m.measurementType()
if mtype == MeasurementType.NotSpecific:
continue
if not mtype in newest:
newest[mtype] = m
else:
if m.time > newest[mtype].time:
newest[mtype] = m
return newest
def newestReferenceOlderThan(self, secs):
"""Returns a dictionary of references with the newest reference, that is still
older than `secs` seconds. """
curtime = time.time()
newest = self.getNewestReferenceMeasurements()
newest_older_than = {}
for key, m in newest.items():
if curtime - m.time >= secs:
newest_older_than[key] = m
return newest_older_than
def measTimeSame(self):
"""
Returns True if all measurements have the same measurement
@ -50,7 +94,6 @@ class MeasurementSet(list):
"""
return self.measTimeSame() and self.measChannelsSame()
def measChannelsSame(self):
"""
This method is used to check whether a set of measurements can be