Ejemplo n.º 1
0
def test_extract_charge_resolution(tmpdir):
    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', get_dataset_path("gamma_test_large.simtel.gz"),
            '-o', output_path,
        ])
Ejemplo n.º 2
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator
    )

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', get_dataset_path("gamma_test_large.simtel.gz"),
            '-o', output_path,
        ])
Ejemplo n.º 3
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator)

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f',
            GAMMA_TEST_LARGE,
            '-o',
            output_path,
        ])
Ejemplo n.º 4
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator
    )

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', GAMMA_TEST_LARGE,
            '-O', output_path,
        ])
    # TODO: Test files do not contain true charge, cannot test tool fully
    # assert os.path.exists(output_path)

    with pytest.raises(SystemExit):
        tool.run(['--help-all'])
Ejemplo n.º 5
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import ChargeResolutionGenerator

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    assert run_tool(tool, ["-f", GAMMA_TEST_LARGE, "-O", output_path]) == 1
    # TODO: Test files do not contain true charge, cannot test tool fully
    # assert os.path.exists(output_path)
    assert run_tool(tool, ["--help-all"]) == 0
Ejemplo n.º 6
0
def test_extract_charge_resolution(tmpdir):
    from ctapipe.tools.extract_charge_resolution import (
        ChargeResolutionGenerator
    )

    output_path = os.path.join(str(tmpdir), "cr.h5")
    tool = ChargeResolutionGenerator()
    with pytest.raises(KeyError):
        tool.run([
            '-f', GAMMA_TEST_LARGE,
            '-O', output_path,
        ])
    # TODO: Test files do not contain true charge, cannot test tool fully
    # assert os.path.exists(output_path)

    with pytest.raises(SystemExit):
        tool.run(['--help-all'])