Exemple #1
0
def test_compare_mcvine(className, num_neutrons=int(1e7), debug=False, interactive=False):
    """
    Tests the acc cpu implementation of a slit or beamstop against mcvine
    """
    from mcvine.acc.test.compare_acc_nonacc import compare_acc_nonacc
    compare_acc_nonacc(
        className,
        ["Ixy", "Ixdivx", "Ixdivy"],
        {"float32": 1e-7, "float64": 1e-25},
        num_neutrons, debug,
        interactive=interactive, workdir = thisdir,
    )
Exemple #2
0
def test_compare_mcvine(num_neutrons=int(1e7), debug=False, interactive=False):
    """
    Tests the acc cpu implementation of a straight guide against mcvine
    """
    instr = os.path.join(thisdir, "isotropic_box_instrument.py")
    from mcvine.acc.test.compare_acc_nonacc import compare_acc_nonacc
    compare_acc_nonacc("isotropic_box", ["psd_4pi"], {
        "float32": 2e-10,
        "float64": 2e-10
    },
                       num_neutrons,
                       debug,
                       instr=instr,
                       interactive=interactive)
Exemple #3
0
def test_compare_mcvine(num_neutrons=int(1e7), debug=False, interactive=False):
    """
    Tests the acc cpu implementation of a straight guide against mcvine
    """
    from mcvine.acc.test.compare_acc_nonacc import compare_acc_nonacc
    compare_acc_nonacc(
        "Guide",
        ["Ixy", "Ixdivx", "Ixdivy"],
        {
            "float32": 1e-7,
            "float64": 1e-8
        },
        num_neutrons,
        debug,
        interactive=interactive,
        workdir=thisdir,
    )
Exemple #4
0
def test_compare_mcvine(num_neutrons=int(1e6), debug=False, interactive=False):
    """
    Tests the acc cpu implementation of a straight guide against mcvine
    """
    mcvine_instr = os.path.join(thisdir, "guide_instrument.py")
    from mcvine.acc.test.compare_acc_nonacc import compare_acc_nonacc
    compare_acc_nonacc(
        "oo_guide",
        ["Ixy", "Ixdivx"],
        {
            "float32": 1e-7,
            "float64": 1e-8
        },
        num_neutrons,
        debug,
        interactive=interactive,
        instr=mcvine_instr,
        nonacc_component_spec=dict(
            guide_factory="mcvine.components.optics.Guide", ),
        acc_component_spec=dict(
            guide_mod="mcvine.acc.components.optics.oo_guide", ),
    )
    return