def test_nonuniform_quadratic(self): x = np.linspace(0, 10, 11)**1.3 a = 1.2 b = 1.8 c = 0.3 y = a + b * x + c * x * x / 2 surf = NonuniformLineScan(x, y) self.assertAlmostEqual(surf.rms_curvature(), c) surf = surf.detrend(detrend_mode='height') self.assertAlmostEqual(surf.mean(), 0.0) surf.detrend_mode = 'curvature' self.assertAlmostEqual(surf.mean(), 0.0) self.assertAlmostEqual(surf.rms_slope(), 0.0) self.assertAlmostEqual(surf.rms_curvature(), 0.0)
def test_nonuniform_linear(self): x = np.linspace(0, 10, 11)**2 y = 1.8 * x + 1.2 surf = NonuniformLineScan(x, y).detrend(detrend_mode='height') self.assertAlmostEqual(surf.mean(), 0.0) self.assertAlmostEqual(surf.rms_slope(), 0.0)