def clip_signals(self): max_time = max(self.time) min_time = min(self.time) if (max_time - min_time) < self.area_around_echo_size: interval = range(np.searchsorted(self.time, min_time), np.searchsorted(self.time, max_time)) elif self.echo_time - self.area_around_echo_size/2 < min_time: interval = range(np.searchsorted(self.time, min_time), int(np.searchsorted(self.time, min_time + self.area_around_echo_size))) elif self.echo_time + self.area_around_echo_size/2 > max_time: interval = range(int(np.searchsorted(self.time, (max_time - self.area_around_echo_size))), np.searchsorted(self.time, max_time)) else: interval = range(int(np.searchsorted(self.time, self.echo_time - (self.area_around_echo_size/2))), int(np.searchsorted(self.time, self.echo_time + (self.area_around_echo_size/2)))) self.interval_near_echo = interval self.time = self.time[interval] self.signal = self.signal[interval] self.seis = self.seis[interval] self.phono = self.phono[interval] self.signal = hb.bandpass_filter(time = self.time, signal = self.signal, freqmin = 59, freqmax = 61) self.seis = hb.bandpass_filter(time = self.time, signal = self.seis, freqmin = 59, freqmax = 61) self.phono = hb.bandpass_filter(time = self.time, signal = self.phono, freqmin = 59, freqmax = 61) self.signal = hb.lowpass_filter(time = self.time, signal = self.signal, cutoff_freq = 10) self.seis = hb.lowpass_filter(time = self.time, signal = self.seis, cutoff_freq = 50)
# # if interval_number != sample_interval: # # continue # if interval_number != 1: # continue print("Interval: ", interval_number) # Load Data time, signal, seis1, seis2, phono1, phono2 = hb.load_file_data( files, folder_name, dosage, file_number, interval_number, preloaded_signal, save_signal) # Calculate Composite lowpass_signal = hb.bandpass_filter(time = time, signal = signal, freqmin = 59, freqmax = 61) # Low-Pass filter under 10Hz lowpass_signal = hb.lowpass_filter(time = time, signal = lowpass_signal, cutoff_freq = 50) peaks = hb.get_peaks_for_composites(time = time, signal = lowpass_signal, dosage = dosage, seis1 = seis1, phono1 = phono1) peaks.get_inital_statistics()
# hb.get_spectrum(time = time, # signal = signal) # Bandblock if show_bandpass == True: bandpass_signal = hb.lowpass_filter(time=time, signal=signal, cutoff_freq=10) hb.get_fft(time=time, signal=bandpass_signal, plot=True) # View Derivatives if show_derivatives == True: bandpass_signal = hb.bandpass_filter(time=time, signal=signal, freqmin=59, freqmax=61) hb.get_derivatives(signal=bandpass_signal, plot=True) # Find Peaks if show_peaks: # Bandpass out 60 Hz filtered_signal = hb.bandpass_filter(time=time, signal=signal, freqmin=59, freqmax=61) filtered_seis2 = hb.bandpass_filter(time=time, signal=seis2, freqmin=59,