Compare commits
2 Commits
33439354f8
...
46d1eda94d
Author | SHA1 | Date |
---|---|---|
Anne de Jong | 46d1eda94d | |
Anne de Jong | 3005f17400 |
|
@ -5,7 +5,7 @@ requires-python = ">=3.10"
|
|||
description = "Library for Acoustic Signal Processing"
|
||||
license = { "file" = "LICENSE" }
|
||||
authors = [{ "name" = "J.A. de Jong", "email" = "j.a.dejong@ascee.nl" }]
|
||||
version = "1.5.1"
|
||||
version = "1.6.0"
|
||||
|
||||
keywords = ["DSP", "DAQ", "Signal processing"]
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@ Provides class MeasurementSet, a class used to perform checks and adjustments
|
|||
on a group of measurements at the same time.
|
||||
|
||||
"""
|
||||
__all__ = ['MeasurementSet']
|
||||
|
||||
__all__ = ["MeasurementSet"]
|
||||
from .lasp_measurement import Measurement, MeasurementType
|
||||
from typing import List
|
||||
import time
|
||||
|
@ -25,7 +26,7 @@ class MeasurementSet(list):
|
|||
|
||||
"""
|
||||
if any([not isinstance(i, Measurement) for i in mlist]):
|
||||
raise TypeError('Object in list should be of Measurement type')
|
||||
raise TypeError("Object in list should be of Measurement type")
|
||||
|
||||
# Sort by time stamp, otherwise the order is random
|
||||
mlist.sort(key=lambda x: x.time, reverse=True)
|
||||
|
@ -47,6 +48,18 @@ class MeasurementSet(list):
|
|||
mnewest = m
|
||||
return mnewest
|
||||
|
||||
def getReferenceMeasurements(self, mtype: MeasurementType):
|
||||
"""Get all available reference measurements of a certain type in the
|
||||
current set.
|
||||
|
||||
Args:
|
||||
mtype (MeasurementType): The type of which to list
|
||||
|
||||
Returns:
|
||||
a new measurement set including all measurements of a certain type
|
||||
"""
|
||||
return [m for m in self if m.measurementType() == mtype]
|
||||
|
||||
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 = {}
|
||||
|
@ -72,7 +85,6 @@ class MeasurementSet(list):
|
|||
newest_older_than[key] = m
|
||||
return newest_older_than
|
||||
|
||||
|
||||
def measTimeSame(self):
|
||||
"""
|
||||
Returns True if all measurements have the same measurement
|
||||
|
|
Loading…
Reference in New Issue