terapy.filters package
Submodules
terapy.filters.apodization module
Apodization window
-
class terapy.filters.apodization.ApodizationWindow
Bases: terapy.filters.base.Filter
Apodization window
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
-
class terapy.filters.apodization.WindowSelectionDialog(parent=None, title='Apodization window', wlist=[], sel=0, custom='')
Bases: wx._windows.Dialog
-
GetValue()
-
onWindowSelect(event=None)
terapy.filters.base module
Generic post-processing filter class
-
class terapy.filters.base.Filter
Generic post-processing filter class
- Properties:
- __extname__ - long name (str)
dim - dimension of data that this filter can treat (int)
-
apply_filter(array)
Apply filter to given array.
- Parameters:
- array - data array (DataArray)
-
dim = -1
-
get_icon()
Return filter icon.
- Output:
- 16x16 icon (wx.Bitmap)
-
get_units(units)
Compute units of array coordinates and data after processsing.
- Parameters:
- units - list of units (list of quantities)
- Output:
- list of units (list of quantities)
-
set_filter(parent=None)
Set filter properties.
- Parameters:
- parent - parent window (wx.Window)
- Output:
- True (success) / False (failure/cancellation)
terapy.filters.centering module
Center maximum value by zero-padding
-
class terapy.filters.centering.Centering
Bases: terapy.filters.base.Filter
Center maximum value by zero-padding
-
apply_filter(array)
-
dim = 1
-
get_icon()
terapy.filters.control module
Filter bank control widget
-
class terapy.filters.control.FilterControl(parent=None, dim=1)
Bases: wx._windows.Panel
Filter bank control widget
-
EnableControl(inst)
Set control to given state (through pubsub)
- Parameters:
- inst - pubsub event data (bool)
-
LoadFilterList(event=None, fname='')
Load filter bank from given file or open dialog box.
Set result to displayed filter bank.
- Parameters:
- event - wx.Event
fname - file name (str, open dialog box if empty)
-
OnAddFilter(ft, event=None)
Add given filter to current filter bank.
- Parameters:
- ft - filter (Filter)
event - wx.Event
-
OnEnableFilter(pos)
Enable/Disable filter at given position.
- Parameters:
- pos - position (int)
-
OnEndDrag(x, y, data)
Actions after a drag and drop event.
- Parameters:
x,y - drop position (int)
data - dropped data (str)
not used - assume instead that selected list item has been dragged
-
OnFilterDoubleClick(event=None)
Actions triggered by left double click on filter list.
- Parameters:
- event - wx.Event
-
OnFilterLeftClick(event=None)
Actions triggered by left mouse button click on filter list.
- Parameters:
- event - wx.Event
-
OnFilterListRightClick(event=None)
Actions following a right mouse button click.
- Parameters:
- event - wx.Event
-
OnFilterUpdate(inst=None)
Actions triggered by changes in filter bank.
- Parameters:
- inst - pubsub event data or wx.Event
-
OnMove(disp)
Move selected filter by given amount within list.
- Parameters:
- disp - displacement (int)
-
OnRemoveFilter(event=None)
Actions following a filter delete request
- Parameters:
- event - wx.Event
-
OnStartDrag(event=None)
Actions initiating a drag and drop event.
- Parameters:
- event - wx.Event
-
RefreshFilters(inst=None)
Refresh displayed filter list.
- Parameters:
- inst - pubsub event data (FilterBank)
-
RemoveReference(inst=None)
Remove reference filter, is any.
- Parameters:
- inst - pubsub event data
-
SaveFilterList(event=None, fname='')
Save current filter list to given file.
- Parameters:
- event - wx.Event
fname - file name (str)
-
SetFilterBank(inst)
Set filter bank through pubsub.
- Parameters:
- inst - pubsub event data (FilterBank)
-
SetReference(inst)
Set given array as reference.
- Parameters:
- inst - data array (DataArray)
- or pubsub event data
-
UpdateFilterDisplay(inst=None)
Update display of apodization window.
- Parameters:
- inst - pubsub event data
-
class terapy.filters.control.FilterList(parent, id=-1, pos=wx.Point(-1, -1), size=wx.Size(-1, -1), style=4, validator=<wx._core.Validator; proxy of <Swig Object of type 'wxValidator *' at 0x103542368> >, name=u'listCtrl')
Bases: wx._controls.ListCtrl, wx.lib.mixins.listctrl.ListCtrlAutoWidthMixin
Listbox with auto width mixin
terapy.filters.ft module
Fourier transform
-
class terapy.filters.ft.FourierTransform
Bases: terapy.filters.base.Filter
Fourier transform
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
get_units(units)
terapy.filters.harminv module
Harmonic inversion
Adapted from Harminv: http://ab-initio.mit.edu/wiki/index.php/Harminv
-
class terapy.filters.harminv.Harminv
Bases: terapy.filters.base.Filter
Harmonic inversion
Adapted from Harminv: http://ab-initio.mit.edu/wiki/index.php/Harminv
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
-
class terapy.filters.harminv.HarminvDialog(parent=None, title='Harmonic inversion settings', nf=100)
Bases: wx._windows.Dialog
-
GetValue()
-
class terapy.filters.harminv.HarminvFilter(signal=[], dt=0.1, fmin=0.0, fmax=10, nf=100)
-
compute_amplitudes()
-
compute_frequency_errors()
-
generate_U(U, U1, p, z, z2, store_G=False)
-
get_Q(k)
-
get_amplitude(k)
-
get_decay(k)
-
get_freq(k)
-
get_freq_error(k)
-
get_omega(k)
-
harminv_solve_again(ok, ok_d)
-
harminv_solve_once()
-
init_z()
-
isort(criterion=0)
-
mode_ok(k, ok_d)
-
run()
-
solve_eigenvects(A0)
-
solve_ok_modes(ok, ok_d)
-
u_near_unity(u, n)
-
class terapy.filters.harminv.mode_ok_data(fmin=0.0, fmax=1.0)
terapy.filters.highpass module
High pass filter
-
class terapy.filters.highpass.HighPass
Bases: terapy.filters.base.Filter
High pass filter
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
terapy.filters.lombscargle module
Lomb-Scargle filter
-
class terapy.filters.lombscargle.LombScargle
Bases: terapy.filters.base.Filter
Lomb-Scargle filter
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
get_units(units)
terapy.filters.lowpass module
Low pass filter
-
class terapy.filters.lowpass.BandpassFilterSelectionDialog(parent=None, title='', wlist=[], sel=0, custom='', sz=0, relative=True, position=25)
Bases: wx._windows.Dialog
-
GetValue()
-
onPositionChange(event=None)
-
onRelativeCheck(event=None)
-
onSizeChange(event=None)
-
onWindowSelect(event=None)
-
class terapy.filters.lowpass.LowPass
Bases: terapy.filters.base.Filter
Low pass filter
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
terapy.filters.multiply module
Multiply by factor
-
class terapy.filters.multiply.Multiply
Bases: terapy.filters.base.Filter
Multiply by factor
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
terapy.filters.normalize module
Normalize with reference
-
class terapy.filters.normalize.Normalize
Bases: terapy.filters.base.Filter
Normalize with reference
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_arrays(inst)
-
set_filter(parent=None)
-
class terapy.filters.normalize.ReferenceSelectionDialog(parent=None, title='Reference measurement', reflist=[], sel=0, isel=1)
Bases: wx._windows.Dialog
-
GetValue()
terapy.filters.offset module
Offset correction
-
class terapy.filters.offset.Offset
Bases: terapy.filters.base.Filter
Offset correction
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
-
class terapy.filters.offset.OffsetDialog(parent=None, title='Offset correction', position=0.0, width=0.1)
Bases: wx._windows.Dialog
-
GetValue()
terapy.filters.power module
Raise to power n
-
class terapy.filters.power.Power
Bases: terapy.filters.base.Filter
Raise to power n
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
terapy.filters.usampling module
Uniform resampling
-
class terapy.filters.usampling.ResamplingSelectionDialog(parent=None, title='Interpolation method', sel=1)
Bases: wx._windows.Dialog
-
GetValue()
-
class terapy.filters.usampling.UniformSampling
Bases: terapy.filters.base.Filter
Uniform resampling
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
terapy.filters.welch module
Welch periodogram
-
class terapy.filters.welch.Welch
Bases: terapy.filters.base.Filter
Welch periodogram
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
get_units(units)
-
set_filter(parent=None)
-
class terapy.filters.welch.WelchSelectionDialog(parent=None, title='Welch periodogram', wlist=[], val_length=20, val_overlap=50, sel_window=0, sel_qty=0)
Bases: wx._windows.Dialog
-
GetValue()
-
onChangeLength(event=None)
terapy.filters.wldenoise module
Wavelet denoising
-
class terapy.filters.wldenoise.WaveletDenoise
Bases: terapy.filters.base.Filter
Wavelet denoising
-
apply_filter(array)
-
dim = 1
-
get_icon()
-
set_filter(parent=None)
-
class terapy.filters.wldenoise.WaveletSelectionDialog(parent=None, title='Wavelet denoising', wlist=[], sel=0, thresh=0, atr=True, trval=0.1)
Bases: wx._windows.Dialog
-
GetValue()
-
onAutoThreshold(event=None)
terapy.filters.zeropadding module
Zero padding
-
class terapy.filters.zeropadding.ZeroPadding
Bases: terapy.filters.base.Filter
Zero padding
-
apply_filter(array)
-
dim = 1
-
get_icon()
Module contents
Post-processing filter functions
- Properties:
- modules - list of available filters
Each filter must be implemented as a Filter class (see base.py).
Filter classes contained in Python scripts within this folder will be
automatically recognized and added to filter list.
-
class terapy.filters.FilterBank(parent=None, children=[], filters=[], name='Filter bank', dim=1)
Filter bank class
-
AppendFilter(ft)
Append given filter at the end of the filter list.
- Parameters:
- ft - filter (Filter)
-
ApplyFilters(array)
Apply filter bank to given data array.
- Parameters:
- array - data array (DataArray)
-
ComputeReference(inst)
Compute reference from given data if reference filter exists.
- Parameters:
- inst - array (DataArray)
- or pubsub event data (DataArray)
-
DefaultFilters()
Set default filters from default filter file.
-
GetReferenceFilter()
Return reference filter, if any.
- Output:
- reference filter (Filter) or None
-
GetUnits(units)
Return how given physical units are modified by filter bank
- Parameters:
- units - list of dim+1 units
- Output:
- units of coordinates and data after processing (list of quantities)
-
HasReference()
Tell if filter bank has reference filter.
- Output:
- True/False
-
InsertFilter(pos, ft)
Insert given filter at given position.
- Parameters:
- pos - position (int)
ft - filter (Filter)
-
LoadFilterList(fname)
Load filter list from given file.
- Parameters:
- fname - file name (str)
- Output:
- list of filters (list of Filter)
-
RecomputeReference()
Recompute reference data for reference filter, if any.
-
RemoveFilter(pos)
Remove filter in given position.
- Parameters:
- pos - position (int)
-
RemoveReference(inst=None)
Remove reference filter.
- Parameters:
- inst - pubsub event data
-
SaveFilterList(fname)
Save current filter list to given file.
- Parameters:
- fname - file name (str)
-
terapy.filters.GetFilterFiles(dim=1)
Get saved filter banks for given dimension.
- Parameters:
- dim - dimension (int)
- Output:
- list of filter bank files (list of str)
-
terapy.filters.GetModules(dim=1)
Get modules for a given dimension.
- Parameters:
- dim - dimension (int)
- Output:
- list of filters (list of Filter)