def _get_missing_m_trend(self, pad='DEFAULT_PAD', **kwargs):
"""Get a single second of missing data."""
logging.debug('Fetching missing m-trend: {}'.format(self))
missing_buf = self.fetch() # explicitly fetch from NDS2
trend = self.channel.split('.')[1].split(',')[0]
# make m-trend value for this minute based on trend extension
if len(np.nonzero(missing_buf == -1)[0]) != 0:
# this won't actually check for anything at the moment because
# gwpy.timeseries.TimeSeries.fetch() does not have a padding option
# yet
logging.warn('Still missing data in {}'.format(self))
elif trend == 'mean':
buf_trend = missing_buf.mean()
elif trend == 'min':
buf_trend = missing_buf.min()
elif trend == 'max':
buf_trend = missing_buf.max()
elif trend == 'rms':
buf_trend = missing_buf.rms(60)[0]
elif trend == 'n':
buf_trend = missing_buf.sum()
else:
raise ValueError('Unrecognized trend type: {}'.format(trend))
return buf_trend
评论列表
文章目录