ENLIGHTEN
Cross-platform desktop GUI for Wasatch Photonics spectrometers
Loading...
Searching...
No Matches
SavitzkyGolay.SavitzkyGolay Class Reference

This plugin applies the Savitzky-Golay smoothing algorithm on the current spectrum. More...

Inheritance diagram for SavitzkyGolay.SavitzkyGolay:
[legend]
Collaboration diagram for SavitzkyGolay.SavitzkyGolay:
[legend]

Public Member Functions

 get_configuration (self)
 End backwards compatible object-returning wrappers #####.
 
 process_request (self, request)
 
- Public Member Functions inherited from EnlightenPlugin.EnlightenPluginBase
 __init__ (self, ctl)
 
 connect (self)
 Do whatever you have to do to prepare for processing measurements.
 
 disconnect (self)
 Called when ENLIGHTEN is shutting down.
 
 field (self, **kwargs)
 
 get_axis (self, processed_reading=None)
 
 get_axis_name (self)
 
 get_axis_short_name (self)
 
 get_configuration_obj (self)
 End functional-plugins backend ####.
 
 get_plugin_field (self, name)
 get the associated enlighten.Plugins.PluginFieldWidget (which IS a QWidget, mind you)
 
 get_widget_from_name (self, name)
 get the associated QLabel, QSpinBox, etc
 
 log (self, *msgs)
 Begin functional-plugins backend ###.
 
 output (self, name, value)
 
 plot (self, y, x=None, title=None, color=None)
 When plotting on the main scope graph the (co)domain matches that existing graph.
 
 process_request_obj (self, request)
 
 to_graph (self, x)
 Undo to_pixel conversion, and set point back to currently selected graph X-Axis.
 
 to_pixel (self, x, domain=None)
 domain is an array where the index corresponds to a detector pixel number.
 
 update_visibility (self)
 Something has happened which might cause the plugin to wish to refresh its visible state – perhaps a new spectrometer was connected.
 
 wavelength_to_pixel (self, wavelength)
 
 wavenumber_to_pixel (self, wavenumber)
 

Additional Inherited Members

- Public Attributes inherited from EnlightenPlugin.EnlightenPluginBase
 auto_enable = None
 
bool block_enlighten = False
 
 ctl = ctl
 
 error_message = None
 
bool has_other_graph = False
 
bool is_blocking = False
 
bool lock_enable = False
 
 logfile = os.path.join(common.get_default_data_dir(), 'plugin.log')
 
 marquee_message = None
 
dict metadata = {}
 
bool multi_devices = False
 
 name = None
 
dict outputs = {}
 
dict overrides = {}
 
bool process_requests = True
 
dict series = {}
 
list signals = []
 
bool streaming = True
 
 table = None
 
 x_axis_label = None
 
 y_axis_label = None
 
- Protected Attributes inherited from EnlightenPlugin.EnlightenPluginBase
 _config = None
 
list _fields = []
 

Detailed Description

This plugin applies the Savitzky-Golay smoothing algorithm on the current spectrum.

It does not add an additional "smoothed" graph line, and instead actively smooths the "standard" spectrum, much as if you used Boxcar Smoothing or Scan Averaging to smooth the spectrum.

The main advantage of Savitzky-Golay over a simple "boxcar" is that it tries to preserve peak intensity (height).

Parameters:

  • Half-Width is defined the same as in Boxcar Smoothing for consistency: the number of pixels to the left and right of each "smoothed" pixel which will be used in the moving window convolved across the spectrum. Lower values will provide less smoothing, and higher values will provide more smoothing (at the cost of lost detail). A half-width of 5 means the actual window will be 11 (5 pixels to either side, plus the central pixel).
  • Poly Order is the polynomial order (a 2nd-order polynomial will use 3 coefficients).

For insight into other parameters see scipy.signal.savgol_filter documentation.

See also
https://en.wikipedia.org/wiki/Savitzky%E2%80%93Golay_filter
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.savgol_filter.html

Member Function Documentation

◆ get_configuration()

SavitzkyGolay.SavitzkyGolay.get_configuration ( self)

End backwards compatible object-returning wrappers #####.

Can be called BEFORE or AFTER connect. Should be idempotent. Ideally should return same object on multiple calls, but at least should be "equivalent" objects.

Returns
an EnlightenPluginConfiguration

Reimplemented from EnlightenPlugin.EnlightenPluginBase.

◆ process_request()

SavitzkyGolay.SavitzkyGolay.process_request ( self,
request )

The documentation for this class was generated from the following file: