Commit 20a25952 authored by Somnath, Suhas's avatar Somnath, Suhas
Browse files

PEP8 renaming of getNoiseFloor and downSample

parent 379c2f86
......@@ -99,7 +99,7 @@ def fft_to_real(image):
return np.real(np.fft.ifft2(np.fft.ifftshift(image)))
def getNoiseFloor(fft_data, tolerance):
def get_noise_floor(fft_data, tolerance):
"""
Calculate the noise floor from the FFT data. Algorithm originally written by Mahmut Okatan Baris
......@@ -148,7 +148,7 @@ def getNoiseFloor(fft_data, tolerance):
###############################################################################
def downSample(fft_vec, freq_ratio):
def down_sample(fft_vec, freq_ratio):
"""
Downsamples the provided data vector
......@@ -466,7 +466,7 @@ class HarmonicPassFilter(FrequencyFilter):
this_parms.update(basic_parms)
return this_parms
# def removeNoiseHarmonics(F_AI_vec,samp_rate,noise_combs):
# def remove_noise_harmonics(F_AI_vec,samp_rate,noise_combs):
# """
# Removes specified noise frequencies from the signal
#
......
......@@ -10,7 +10,7 @@ from collections import Iterable
from warnings import warn
import matplotlib.pyplot as plt
import numpy as np
from .fft import getNoiseFloor, are_compatible_filters, build_composite_freq_filter
from .fft import get_noise_floor, are_compatible_filters, build_composite_freq_filter
from ..io.io_hdf5 import ioHDF5
from ..io.pycro_data import PycroDataset
from ..io.hdf_utils import getH5DsetRefs, linkRefs, getAuxData, copy_main_attributes
......@@ -83,7 +83,7 @@ def test_filter(resp_wfm, frequency_filters=None, noise_threshold=None,
fft_pix_data = np.fft.fftshift(np.fft.fft(resp_wfm))
if noise_threshold is not None:
noise_floor = getNoiseFloor(fft_pix_data, noise_threshold)[0]
noise_floor = get_noise_floor(fft_pix_data, noise_threshold)[0]
if verbose:
print('The noise_floor is', noise_floor)
......
......@@ -16,7 +16,7 @@ from ..io.microdata import MicroDataset, MicroDataGroup
from ..io.hdf_utils import getH5DsetRefs, getAuxData, copyAttributes, link_as_main, linkRefs, check_for_old
from ..io.translators.utils import build_ind_val_dsets
from ..io.io_hdf5 import ioHDF5
from .fft import getNoiseFloor, are_compatible_filters, build_composite_freq_filter
from .fft import get_noise_floor, are_compatible_filters, build_composite_freq_filter
# TODO: implement phase compensation
# TODO: correct implementation of num_pix
......@@ -244,7 +244,7 @@ class SignalFilter(Process):
@staticmethod
def _unit_function():
return getNoiseFloor
return get_noise_floor
def compute(self, *args, **kwargs):
"""
......@@ -274,7 +274,7 @@ class SignalFilter(Process):
self.data = np.fft.fftshift(np.fft.fft(self.data, axis=1), axes=1)
if self.noise_threshold is not None:
self.noise_floors = parallel_compute(self.data, getNoiseFloor, cores=self._cores,
self.noise_floors = parallel_compute(self.data, get_noise_floor, cores=self._cores,
func_args=[self.noise_threshold])
if isinstance(self.composite_filter, np.ndarray):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment