def test_1d_fractal_figure_error(self): mirror_length=200.0 step=1.0 rms=1.25e-7 x, f = simulate_profile_1D_fractal(step=step,mirror_length=mirror_length, renormalize_to_heights_sd=rms) print("%s, HEIGHTS Stdev: input=%g, obtained=%g"%("test_1d_fractal_figure_error",rms,f.std())) assert numpy.abs( rms - f.std() ) < 0.01 * numpy.abs(rms) if do_plot: from srxraylib.plot.gol import plot plot(x,f,title="test_1d_fractal_figure_error",xtitle="Y",ytitle="heights profile Z")
def test_1d_fractal_slope_error(self): mirror_length=200.0 step=1.0 rms=3e-6 x, f = simulate_profile_1D_fractal(step=step,mirror_length=mirror_length, renormalize_to_slopes_sd=rms) slopes = numpy.gradient(f, x[1]-x[0]) print("%s, SLOPES Stdev: input=%g, obtained=%g"%("test_1d_fractal_slope_error",rms,slopes.std())) assert numpy.abs( rms - slopes.std() ) < 0.01 * numpy.abs(rms) if do_plot: from srxraylib.plot.gol import plot plot(x,slopes,title="test_1d_fractal_slope_error",xtitle="Y",ytitle="slopes Z'")
def test_1d_fractal_slope_error(self): mirror_length = 200.0 step = 1.0 rms = 3e-6 x, f = simulate_profile_1D_fractal(step=step, mirror_length=mirror_length, renormalize_to_slopes_sd=rms) slopes = numpy.gradient(f, x[1] - x[0]) print("%s, SLOPES Stdev: input=%g, obtained=%g" % ("test_1d_fractal_slope_error", rms, slopes.std())) assert numpy.abs(rms - slopes.std()) < 0.01 * numpy.abs(rms) if do_plot: from srxraylib.plot.gol import plot plot(x, slopes, title="test_1d_fractal_slope_error", xtitle="Y", ytitle="slopes Z'")
def test_1d_fractal_figure_error(self): mirror_length = 200.0 step = 1.0 rms = 1.25e-7 x, f = simulate_profile_1D_fractal(step=step, mirror_length=mirror_length, renormalize_to_heights_sd=rms) print("%s, HEIGHTS Stdev: input=%g, obtained=%g" % ("test_1d_fractal_figure_error", rms, f.std())) assert numpy.abs(rms - f.std()) < 0.01 * numpy.abs(rms) if do_plot: from srxraylib.plot.gol import plot plot(x, f, title="test_1d_fractal_figure_error", xtitle="Y", ytitle="heights profile Z")