In [6]: PySpectra.calc.smooth?
Signature: PySpectra.calc.smooth(name=None, nameNew=None, box_pts=7)
Docstring:
smooth <scanName> [<newScanName>]
moving average box algorithm:
def smooth(y, box_pts):
box = np.ones(box_pts)/box_pts
y_smooth = np.convolve(y, box, mode='same')
return y_smooth
In [11]: PySpectra.calc.smoothSG?
Signature: PySpectra.calc.smoothSG(name=None, nameNew=None, window_size=7, order=3, deriv=0, rate=1)
Docstring:
smooth <scanName> [<newScanName>]
uses Savitzky-Golay to filter noise
for details see: PySpectra.calc.savitzky_golay?
In [11]: PySpectra.calc.savitzky_golay?
Signature: PySpectra.calc.savitzky_golay(y, window_size=7, order=3, deriv=0, rate=1)
Docstring:
Smooth (and optionally differentiate) data with a Savitzky-Golay filter.
The Savitzky-Golay filter removes high frequency noise from data.
It has the advantage of preserving the original shape and
features of the signal better than other types of filtering
approaches, such as moving averages techniques.
Parameters
----------
y : array_like, shape (N,)
the values of the time history of the signal.
window_size : int
the length of the window. Must be an odd integer number.
order : int
the order of the polynomial used in the filtering.
Must be less then `window_size` - 1.
deriv: int
the order of the derivative to compute (default = 0 means only smoothing)
Returns
-------
ys : ndarray, shape (N)
the smoothed signal (or it's n-th derivative).
Notes
-----
The Savitzky-Golay is a type of low-pass filter, particularly
suited for smoothing noisy data. The main idea behind this
approach is to make for each point a least-square fit with a
polynomial of high order over a odd-sized window centered at
the point ...
# # eh_mot65 print " restoring haso107d1:10000/p09/motor/eh.65 (eh_mot65) " proxy = PyTango.DeviceProxy( "haso107d1:10000/p09/motor/eh.65") proxy.write_attribute( "acceleration", 200000) proxy.write_attribute( "conversion", 200000.0) proxy.write_attribute( "baserate", 20) proxy.write_attribute( "stepbacklash", 60000) proxy.write_attribute( "cutormap", 0.0) proxy.write_attribute( "slewratemax", 50000) proxy.write_attribute( "steppositioncontroller", -8690) proxy.write_attribute( "steppositioninternal", -8690) proxy.write_attribute( "unitcalibration", 0.0) proxy.write_attribute( "flagprotected", 0) proxy.write_attribute( "settletime", 0.0) # proxy.write_attribute( "position", -0.04345) [Attr. config: -15, 15] proxy.write_attribute( "slewratemin", 0) proxy.write_attribute( "slewrate", 40000) proxy.write_attribute( "stepcalibration", 0) proxy.write_attribute( "unitlimitmax", 15.0) proxy.write_attribute( "unitlimitmin", -15.0) proxy.write_attribute( "conversionencoder", 70200.0) proxy.write_attribute( "correctiongain", 100) # read-only attribute encoderratio: 1.0 proxy.write_attribute( "homeposition", 0.0) # read-only attribute positionencoderraw: -1.0 proxy.write_attribute( "UnitCalibrationUser", 0.0) # # p09/motor/eh.65 uses ZMX device p09/zmx/exp.01 proxyZMX = PyTango.DeviceProxy( "p09/zmx/exp.01") proxyZMX.write_attribute( "axisname", "Mot_1") proxyZMX.write_attribute( "deactivation", 0) # read-only attribute deactivationstr: Activated # delayTime read-value 40 maps to write-value 10 proxyZMX.write_attribute( "delaytime", 10) # read-only attribute error: no error proxyZMX.write_attribute( "inputlogiclevel", 0) # read-only attribute inputlogiclevelstr: High active # read-only attribute intermediatevoltage: 62.5 proxyZMX.write_attribute( "overdrive", 1) # read-only attribute overdrivestr: On proxyZMX.write_attribute( "preferentialdirection", 0) # read-only attribute preferentialdirectionstr: Negative proxyZMX.write_attribute( "runcurrent", 1.0) proxyZMX.write_attribute( "stepwidth", 8) # read-only attribute stepwidthstr: 1/20 proxyZMX.write_attribute( "stopcurrent", 0.5400000214576721) # read-only attribute temperature: 31.0