mirror of
https://github.com/nqrduck/nqrduck-spectrometer-limenqr.git
synced 2024-11-09 19:20:02 +00:00
Added option for measurement error signal.
This commit is contained in:
parent
181ea90c0d
commit
bb1ecb3985
1 changed files with 9 additions and 5 deletions
|
@ -71,13 +71,14 @@ class LimeNQRController(BaseSpectrometerController):
|
||||||
evidx = np.where((lime.HDF.tdx > evran[0]) & (lime.HDF.tdx < evran[1]))[0]
|
evidx = np.where((lime.HDF.tdx > evran[0]) & (lime.HDF.tdx < evran[1]))[0]
|
||||||
except:
|
except:
|
||||||
logger.error("Error while reading the measurement data")
|
logger.error("Error while reading the measurement data")
|
||||||
|
self.module.nqrduck_signal.emit("measurement_error", "Error")
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
# time domain x and y data
|
# time domain x and y data
|
||||||
tdx = lime.HDF.tdx[evidx]
|
tdx = lime.HDF.tdx[evidx] - lime.HDF.tdx[evidx][0]
|
||||||
tdy = lime.HDF.tdy[evidx] / lime.nav
|
tdy = lime.HDF.tdy[evidx] / lime.nav
|
||||||
|
|
||||||
measurement_data = Measurement(tdx, tdy, self.module.model.target_frequency)
|
measurement_data = Measurement(tdx, tdy, self.module.model.target_frequency, frequency_shift=self.module.model.if_frequency)
|
||||||
|
|
||||||
# Emit the data to the nqrduck core
|
# Emit the data to the nqrduck core
|
||||||
logger.debug("Emitting measurement data")
|
logger.debug("Emitting measurement data")
|
||||||
|
@ -244,6 +245,7 @@ class LimeNQRController(BaseSpectrometerController):
|
||||||
|
|
||||||
previous_events_duration = 0
|
previous_events_duration = 0
|
||||||
offset = 0
|
offset = 0
|
||||||
|
rx_duration = 0
|
||||||
for event in events:
|
for event in events:
|
||||||
logger.debug("Event %s has parameters: %s", event.name, event.parameters)
|
logger.debug("Event %s has parameters: %s", event.name, event.parameters)
|
||||||
for parameter in event.parameters.values():
|
for parameter in event.parameters.values():
|
||||||
|
@ -265,6 +267,8 @@ class LimeNQRController(BaseSpectrometerController):
|
||||||
rx_duration = event.duration
|
rx_duration = event.duration
|
||||||
|
|
||||||
rx_begin = previous_events_duration + offset + CORRECTION_FACTOR
|
rx_begin = previous_events_duration + offset + CORRECTION_FACTOR
|
||||||
|
if rx_duration:
|
||||||
rx_stop = rx_begin + rx_duration
|
rx_stop = rx_begin + rx_duration
|
||||||
|
|
||||||
return rx_begin * 1e6, rx_stop * 1e6
|
return rx_begin * 1e6, rx_stop * 1e6
|
||||||
|
|
||||||
|
else: return None, None
|
||||||
|
|
Loading…
Reference in a new issue