Measurement.fromnpy(): accept sensitivity as scalar or 0-dim numpy.ndarray
This commit is contained in:
parent
6b0442fe90
commit
5a051d21a1
@ -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
|
||||
|
@ -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]:
|
||||
|
Loading…
Reference in New Issue
Block a user