From f50cf26d53b489b787965d79bc5ba3d6ece8d980 Mon Sep 17 00:00:00 2001 From: Thomas Vuillaume Date: Thu, 28 Sep 2023 12:24:33 +0200 Subject: [PATCH] use private data to validate lstchain config if possible, solving EFFECTIVE_FOCAL_LENGTH issue (#431) --- .../scripts/script_lstmcpipe_validate_config.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lstmcpipe/scripts/script_lstmcpipe_validate_config.py b/lstmcpipe/scripts/script_lstmcpipe_validate_config.py index e6843daa..d3c596d8 100644 --- a/lstmcpipe/scripts/script_lstmcpipe_validate_config.py +++ b/lstmcpipe/scripts/script_lstmcpipe_validate_config.py @@ -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): @@ -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)