Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
20a25952
Commit
20a25952
authored
Dec 21, 2017
by
Somnath, Suhas
Browse files
PEP8 renaming of getNoiseFloor and downSample
parent
379c2f86
Changes
3
Hide whitespace changes
Inline
Side-by-side
pycroscopy/processing/fft.py
View file @
20a25952
...
...
@@ -99,7 +99,7 @@ def fft_to_real(image):
return
np
.
real
(
np
.
fft
.
ifft2
(
np
.
fft
.
ifftshift
(
image
)))
def
get
N
oise
F
loor
(
fft_data
,
tolerance
):
def
get
_n
oise
_f
loor
(
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
down
S
ample
(
fft_vec
,
freq_ratio
):
def
down
_s
ample
(
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 remove
N
oise
H
armonics(F_AI_vec,samp_rate,noise_combs):
# def remove
_n
oise
_h
armonics(F_AI_vec,samp_rate,noise_combs):
# """
# Removes specified noise frequencies from the signal
#
...
...
pycroscopy/processing/gmode_utils.py
View file @
20a25952
...
...
@@ -10,7 +10,7 @@ from collections import Iterable
from
warnings
import
warn
import
matplotlib.pyplot
as
plt
import
numpy
as
np
from
.fft
import
get
N
oise
F
loor
,
are_compatible_filters
,
build_composite_freq_filter
from
.fft
import
get
_n
oise
_f
loor
,
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
=
get
N
oise
F
loor
(
fft_pix_data
,
noise_threshold
)[
0
]
noise_floor
=
get
_n
oise
_f
loor
(
fft_pix_data
,
noise_threshold
)[
0
]
if
verbose
:
print
(
'The noise_floor is'
,
noise_floor
)
...
...
pycroscopy/processing/signal_filter.py
View file @
20a25952
...
...
@@ -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
get
N
oise
F
loor
,
are_compatible_filters
,
build_composite_freq_filter
from
.fft
import
get
_n
oise
_f
loor
,
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
get
N
oise
F
loor
return
get
_n
oise
_f
loor
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
,
get
N
oise
F
loor
,
cores
=
self
.
_cores
,
self
.
noise_floors
=
parallel_compute
(
self
.
data
,
get
_n
oise
_f
loor
,
cores
=
self
.
_cores
,
func_args
=
[
self
.
noise_threshold
])
if
isinstance
(
self
.
composite_filter
,
np
.
ndarray
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment