gammasim / simtools

Tools and applications for the Simulation System of the CTA Observatory.
https://gammasim.github.io/simtools
BSD 3-Clause "New" or "Revised" License
10 stars 1 forks source link

Fix execution error because of unexisting empty CORSIKA file in the ray tracing simulations #146

Closed RaulRPrado closed 2 years ago

RaulRPrado commented 3 years ago

The empty CORSIKA file does not exist in the sim_telarray package, which makes sim_telarray to return an error code.

GernotMaier commented 2 years ago

So this is related e.g. to calling the ray_tracing routines with:

/workdir/sim_telarray/sim_telarray/bin/sim_telarray -c /tmp/pytest-of-root/pytest-23/test-data0/output/simtools-output/test-lst/model/CTA-North-LST-1-Current_test-lst.cfg -I../cfg/CTA -I/tmp/pytest-of-root/pytest-23/test-data0/output/simtools-output/test-lst/model -C IMAGING_LIST=/tmp/pytest-of-root/pytest-23/test-data0/output/simtools-output/test-lst/ray-tracing/photons-North-LST-1-d10.0-za20.0-off5.000_test-lst.lis -C stars=/tmp/pytest-of-root/pytest-23/test-data0/output/simtools-output/test-lst/ray-tracing/stars-North-LST-1-d10.0-za20.0-off5.000_test-lst.lis -C altitude=2158.0 -C telescope_theta=25.0 -C star_photons=100000 -C telescope_phi=0 -C camera_transmission=1.0 -C nightsky_background=all:0. -C trigger_current_limit=1e10 -C telescope_random_angle=0 -C telescope_random_error=0 -C convergent_depth=0 -C maximum_telescopes=1 -C show=all -C camera_filter=none /workdir/sim_telarray/run9991.corsika.gz 2>&1 > /tmp/pytest-of-root/pytest-23/test-data0/output/simtools-output/test-lst/ray-tracing/log-North-LST-1-d10.0-za20.0-off5.000_test-lst.log 2>&1

The corsika file used here is /workdir/sim_telarray/run9991.corsika.gz, which does not exist (run9991 is hardwired in ./simtools/simtel/simtel_runner_ray_tracing.py). The ray-tracing step is running correctly. Is the issue here that the log file from sim_telarray reports

...
Input file: /workdir/sim_telarray/run9991.corsika.gz
No (or only empty) input files have been processed.

If this is the only issue, then I suggest to close this issue and don't do anything.


For easy testing this, use

pytest --no-cov tests/integration_tests/test_ray_tracing.py::test_rx -s
orelgueta commented 2 years ago

Wait, didn't I solve this with a recent PR? Despite this error in the log file, sim_telarray returns an integer zero as the exit code and I changed the test to compare to an integer instead of a string which solved this issue (see https://github.com/gammasim/gammasim-tools/commit/220e67b97aa4d8360be73a37de3878d8395f9da1). At least when I ran the various ray-tracing simulations I didn't get an error again. Do you still see an error?

GernotMaier commented 2 years ago

No, there is no error in all tests I have done and the issue seems to be resolved. Closing...