diff --git a/.gitignore b/.gitignore index a0084a7c90..b166534618 100644 --- a/.gitignore +++ b/.gitignore @@ -20,6 +20,8 @@ __pycache__ */cython_version.py htmlcov .coverage +.coverage.* +coverage.xml MANIFEST # Sphinx diff --git a/lstchain/reco/r0_to_dl1.py b/lstchain/reco/r0_to_dl1.py index 41314154a3..a1c6f5684a 100644 --- a/lstchain/reco/r0_to_dl1.py +++ b/lstchain/reco/r0_to_dl1.py @@ -329,11 +329,10 @@ def r0_to_dl1( ------- """ - # using None as default and using `get_dataset_path` only inside the function # prevents downloading at import time. if input_filename is None: - get_dataset_path('gamma_test_large.simtel.gz') + get_dataset_path('gamma_lstprod2.simtel.gz') if output_filename is None: try: diff --git a/lstchain/scripts/lstchain_mc_r0_to_dl1.py b/lstchain/scripts/lstchain_mc_r0_to_dl1.py index fdceab1764..7d8304e96f 100644 --- a/lstchain/scripts/lstchain_mc_r0_to_dl1.py +++ b/lstchain/scripts/lstchain_mc_r0_to_dl1.py @@ -52,10 +52,10 @@ def main(): args = parser.parse_args() # using a default of None and only using get_dataset_path here - # prevents downloading gamma_test_large when an input file is actually given + # prevents downloading when an input file is actually given # or just --help is called. if args.input_file is None: - args.input_file = get_dataset_path('gamma_test_large.simtel.gz') + args.input_file = get_dataset_path('gamma_lstprod2.simtel.gz') output_dir = args.output_dir.absolute() output_dir.mkdir(exist_ok=True, parents=True) diff --git a/lstchain/scripts/lstchain_mc_r0_to_dl2.py b/lstchain/scripts/lstchain_mc_r0_to_dl2.py index 2d350efbe0..40f7200174 100644 --- a/lstchain/scripts/lstchain_mc_r0_to_dl2.py +++ b/lstchain/scripts/lstchain_mc_r0_to_dl2.py @@ -62,10 +62,10 @@ def main(): args = parser.parse_args() # using a default of None and only using get_dataset_path here - # prevents downloading gamma_test_large when an input file is actually given + # prevents downloading when an input file is actually given # or just --help is called. if args.datafile is None: - args.datafile = get_dataset_path('gamma_test_large.simtel.gz') + args.datafile = get_dataset_path('gamma_lstprod2.simtel.gz') output_dir = args.output_dir.absolute() dl1_file = output_dir / r0_to_dl1_filename(args.datafile.name) diff --git a/lstchain/scripts/tests/test_lstchain_scripts.py b/lstchain/scripts/tests/test_lstchain_scripts.py index 0311225fc5..52b7a570be 100644 --- a/lstchain/scripts/tests/test_lstchain_scripts.py +++ b/lstchain/scripts/tests/test_lstchain_scripts.py @@ -90,6 +90,13 @@ def merged_simulated_dl1_file(simulated_dl1_file, temp_dir_simulated_files): return merged_dl1_file +def test_lstchain_mc_r0_to_dl1_default_mc_file(tmp_path): + """Run R0 to DL1 script for the default MC file without specifying an input file.""" + output_file = tmp_path / "dl1_gamma_lstprod2.h5" + run_program("lstchain_mc_r0_to_dl1", "-o", tmp_path) + assert output_file.is_file() + + def test_lstchain_mc_r0_to_dl1(simulated_dl1_file): assert simulated_dl1_file.is_file() diff --git a/notebooks/disp.ipynb b/notebooks/disp.ipynb index 50192abbd8..14680dbba3 100644 --- a/notebooks/disp.ipynb +++ b/notebooks/disp.ipynb @@ -69,7 +69,7 @@ }, "outputs": [], "source": [ - "infile = get_dataset_path(\"gamma_test_large.simtel.gz\")\n", + "infile = get_dataset_path(\"gamma_lstprod2.simtel.gz\")\n", "\n", "allowed_tels = {1} # select LST1 only\n", "max_events = (\n", diff --git a/notebooks/example_container.ipynb b/notebooks/example_container.ipynb index bcf069ddda..aed4a356a8 100644 --- a/notebooks/example_container.ipynb +++ b/notebooks/example_container.ipynb @@ -47,7 +47,7 @@ }, "outputs": [], "source": [ - "infile = get_dataset_path(\"gamma_test_large.simtel.gz\")\n", + "infile = get_dataset_path(\"gamma_lstprod2.simtel.gz\")\n", "\n", "dl1_parameters_filename = \"dl1.h5\"\n", "\n", diff --git a/notebooks/lstchain.ipynb b/notebooks/lstchain.ipynb index 84698cd9b1..31f9b09351 100644 --- a/notebooks/lstchain.ipynb +++ b/notebooks/lstchain.ipynb @@ -79,10 +79,11 @@ }, "outputs": [], "source": [ - "#datafile = get_dataset_path('gamma_test_large.simtel.gz')\n", + "# test data file from the ctapipe data server\n", + "datafile = get_dataset_path('gamma_lstprod2.simtel.gz')\n", "\n", - "# Local files can be also imported.\n", - "datafile = \"/fefs/aswg/data/mc/DL0/20190415/gamma/south_pointing/gamma_20deg_180deg_run9___cta-prod3-demo-2147m-LaPalma-baseline-mono_off0.4.simtel.gz\"" + "# Local files can be also be used:\n", + "# datafile = \"/fefs/aswg/data/mc/DL0/20190415/gamma/south_pointing/gamma_20deg_180deg_run9___cta-prod3-demo-2147m-LaPalma-baseline-mono_off0.4.simtel.gz\"" ] }, { diff --git a/notebooks/mc_energy_distr.ipynb b/notebooks/mc_energy_distr.ipynb index c819b2bc2c..c05c380cdc 100644 --- a/notebooks/mc_energy_distr.ipynb +++ b/notebooks/mc_energy_distr.ipynb @@ -27,7 +27,7 @@ "metadata": {}, "outputs": [], "source": [ - "simtel_file = get_dataset_path('gamma_test_large.simtel.gz')" + "simtel_file = get_dataset_path('gamma_lstprod2.simtel.gz')" ] }, { diff --git a/notebooks/step_by_step_dl0_to_dl1.ipynb b/notebooks/step_by_step_dl0_to_dl1.ipynb index d6a7511fc4..60fdbc768d 100644 --- a/notebooks/step_by_step_dl0_to_dl1.ipynb +++ b/notebooks/step_by_step_dl0_to_dl1.ipynb @@ -82,7 +82,7 @@ "metadata": {}, "outputs": [], "source": [ - "#input_filename=get_dataset_path('gamma_test_large.simtel.gz')\n", + "#input_filename=get_dataset_path('gamma_prod2.simtel.gz')\n", "input_filename=\"/home/queenmab/DATA/LST1/Gamma/gamma_20deg_0deg_run8___cta-prod3-lapalma-2147m-LaPalma-FlashCam.simtel.gz\"" ] },