Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def _direct_delivery(self, message): # pylint: disable=R0201
- """
- Convert message into result-format and return.
- Parameters
- ----------
- :type message: smartfibres.messages.Peak
- Peak message
- """
- time = message.timestamp64
- step = message.sample_interval * 1E-6
- data = message.data
- try:
- data[[data <= message.first_laser_freq]] = np.nan
- except FloatingPointError:
- LOG.debug("data = %s, fist_laser_freq = %s", data, message.first_laser_freq, exc_info=True)
- datalen = message.channel_no * message.grating_no
- samples = data.shape[0]
- result = np.zeros(
- (samples,),
- dtype=[('time', '<f8'), ('data', '<f8', (datalen,))])
- for sample in range(samples):
- result[sample] = (time + sample * step,
- data[sample])
- return [result]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement