Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use private data to validate lstchain config if possible, solving EFFECTIVE_FOCAL_LENGTH issue #431

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions lstmcpipe/scripts/script_lstmcpipe_validate_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@


def mc_r0_path():
return get_dataset_path("gamma_test_large.simtel.gz")
testfile_private_data = Path("test_data/mc/simtel_theta_20_az_180_gdiffuse_10evts.simtel.gz")
if testfile_private_data.exists():
return testfile_private_data.absolute()
else:
print("Using public test file")
return get_dataset_path("gamma_test_large.simtel.gz")


def run_lstchain_mc_r0_dl1(simtel_file, outdir, config_file):
Expand All @@ -33,10 +38,12 @@ def mc_requirements(config):


def test_dl1ab(config_file):
r0_path = mc_r0_path()
dl1_filename = 'dl1_' + Path(r0_path).name.replace('.simtel.gz', '.h5')
tmpdir = tempfile.mkdtemp()
dl1file = Path(tmpdir, 'dl1_gamma_test_large.h5')
dl1file = Path(tmpdir, dl1_filename)
dl1fileout = Path(tmpdir, 'dl1ab.h5')
run_lstchain_mc_r0_dl1(mc_r0_path(), tmpdir, config_file)
run_lstchain_mc_r0_dl1(r0_path, tmpdir, config_file)
cmd = ['lstchain_dl1ab', '-f', dl1file, '-o', dl1fileout, '-c', config_file]
subprocess.run(cmd)

Expand Down