Compare commits

...

1 Commits

Author SHA1 Message Date
5a051d21a1 Measurement.fromnpy(): accept sensitivity as scalar or 0-dim numpy.ndarray
All checks were successful
Building, testing and releasing LASP if it has a tag / Build-Test-Ubuntu (push) Successful in -3m20s
Building, testing and releasing LASP if it has a tag / Release-Ubuntu (push) Has been skipped
2024-09-10 13:40:47 +02:00
2 changed files with 7 additions and 10 deletions

View File

@ -10,11 +10,11 @@ from .lasp_cpp import *
# from .lasp_imptube import * # TwoMicImpedanceTube
from .lasp_measurement import * # Measurement, scaleBlockSens
from .lasp_octavefilter import *
from .lasp_octavefilter import * # OverallFilterBank, SosOctaveFilterBank, SosThirdOctaveFilterBank
from .lasp_slm import * # SLM, Dummy
from .lasp_record import * # RecordStatus, Recording
from .lasp_daqconfigs import *
from .lasp_measurementset import *
from .lasp_daqconfigs import * # DaqConfigurations
from .lasp_measurementset import * # MeasurementSet
# from .lasp_siggen import * # SignalType, NoiseType, SiggenMessage, SiggenData, Siggen
# from .lasp_weighcal import * # WeighCal

View File

@ -77,9 +77,9 @@ class MeasurementType(Enum):
Measurement flags related to the measurement. Stored as bit flags in the measurement file. This is for possible changes in the API later.
"""
# Not specific measurement type
# Not specific measurement type
NotSpecific = 0
# Measurement serves as an insertion loss reference measurement
ILReference = 1 << 0
@ -1156,11 +1156,8 @@ class Measurement:
if data.ndim != 2:
data = data[:, np.newaxis]
try:
len(sensitivity)
except:
raise ValueError("Sensitivity should be given as array-like data type")
sensitivity = np.asarray(sensitivity)
if not (isinstance(sensitivity, np.ndarray) and sensitivity.ndim >= 1):
sensitivity = np.asarray(sensitivity)[np.newaxis]
nchannels = data.shape[1]
if nchannels != sensitivity.shape[0]: