def configure(self, time_series, segment_length=None, window_function=None, detrend=None): """ Do any configuration needed before launching. :param time_series: the input time series to which the fft is to be applied :param segment_length: the block size which determines the frequency resolution \ of the resulting power spectra :param window_function: windowing functions can be applied before the FFT is performed :type window_function: None; ‘hamming’; ‘bartlett’; ‘blackman’; ‘hanning’ :param detrend: None; specify if detrend is performed on the time series """ shape = time_series.read_data_shape() LOG.debug("time_series shape is %s" % (str(shape))) LOG.debug("Provided segment_length is %s" % (str(segment_length))) LOG.debug("Provided window_function is %s" % (str(window_function))) LOG.debug("Detrend is %s" % (str(detrend))) ##-------------------- Fill Algorithm for Analysis -------------------## #The enumerate set function isn't working well. A get around strategy is to create a new algorithm algorithm = fft.FFT() if segment_length is not None: algorithm.segment_length = segment_length algorithm.window_function = window_function algorithm.time_series = time_series algorithm.detrend = detrend self.algorithm = algorithm LOG.debug("Using segment_length is %s" % (str(self.algorithm.segment_length))) LOG.debug("Using window_function is %s" % (str(self.algorithm.window_function))) LOG.debug("Using detrend is %s" % (str(self.algorithm.detrend)))
def get_input_tree(self): """ Return a list of lists describing the interface to the analyzer. This is used by the GUI to generate the menus and fields necessary for defining a simulation. """ algorithm = fft.FFT() algorithm.trait.bound = self.INTERFACE_ATTRIBUTES_ONLY tree = algorithm.interface[self.INTERFACE_ATTRIBUTES] for node in tree: if node['name'] == 'time_series': node['conditions'] = entities_filter.FilterChain( fields=[entities_filter.FilterChain.datatype + '._nr_dimensions'], operations=["=="], values=[4]) return tree
def __init__(self): super(FourierAdapter, self).__init__() self.algorithm = fft.FFT() self.memory_factor = 1
def get_traited_datatype(self): return fft.FFT()