Beispiel #1
0
    def test_1d_aps_slope_error(self):

        mirror_length = 200.0
        step = 1.0
        random_seed = 898882
        rms = 1e-7

        # units mm
        wName_x, wName = create_simulated_1D_file_APS(
            mirror_length=mirror_length,
            step=step,
            random_seed=random_seed,
            error_type=SLOPE_ERROR,
            rms=rms)

        slopes = numpy.gradient(wName, wName_x[1] - wName_x[0])
        print(
            "test_1d: test function: %s, SLOPES Stdev: input=%g, obtained=%g" %
            ("test_1d_aps_figure_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(wName_x,
                 slopes,
                 title="test_1d_aps_slope_error",
                 xtitle="Y",
                 ytitle="slopes Z'")
Beispiel #2
0
    def test_1d_aps_figure_error(self):

        mirror_length = 200.0
        step = 1.0
        random_seed = 898882
        rms = 1e-7

        # units mm
        wName_x, wName = create_simulated_1D_file_APS(
            mirror_length=mirror_length,
            step=step,
            random_seed=random_seed,
            error_type=FIGURE_ERROR,
            rms=rms)

        print("%s, HEIGHTS Stdev: input=%g, obtained=%g" %
              ("test_1d_aps_figure_error", rms, wName.std()))
        assert numpy.abs(rms - wName.std()) < 0.01 * numpy.abs(rms)
        if do_plot:
            from srxraylib.plot.gol import plot
            plot(wName_x,
                 wName,
                 title="test_1d_aps_figure_error",
                 xtitle="Y",
                 ytitle="heights profile Z")
    def test_1d_aps_figure_error(self):

        mirror_length=200.0
        step=1.0
        random_seed=898882
        rms=1e-7

         # units mm
        wName_x,wName = create_simulated_1D_file_APS(mirror_length=mirror_length,step=step, random_seed=random_seed,
                                                     error_type=FIGURE_ERROR, rms=rms)

        print("%s, HEIGHTS Stdev: input=%g, obtained=%g"%("test_1d_aps_figure_error",rms,wName.std()))
        assert numpy.abs( rms - wName.std() ) < 0.01 * numpy.abs(rms)
        if do_plot:
            from srxraylib.plot.gol import plot
            plot(wName_x,wName,title="test_1d_aps_figure_error",xtitle="Y",ytitle="heights profile Z")
    def test_1d_aps_slope_error(self):

        mirror_length=200.0
        step=1.0
        random_seed=898882
        rms=1e-7

         # units mm
        wName_x,wName = create_simulated_1D_file_APS(mirror_length=mirror_length,step=step, random_seed=random_seed,
                                                     error_type=SLOPE_ERROR, rms=rms)

        slopes = numpy.gradient(wName, wName_x[1]-wName_x[0])
        print("test_1d: test function: %s, SLOPES Stdev: input=%g, obtained=%g"%("test_1d_aps_figure_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(wName_x,slopes,title="test_1d_aps_slope_error",xtitle="Y",ytitle="slopes Z'")