Skip to content

Commit

Permalink
Allow trigger times example to be non interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
HealthyPear committed Nov 22, 2024
1 parent 3540155 commit b2f2296
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/trigger_times.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
help="Example file: tests/resources/gamma_20deg_0deg_run102___cta-prod4-sst-1m_desert-2150m-Paranal-sst-1m.simtel.gz",
)
parser.add_argument("--max-shower-events", type=int, default=0)
parser.add_argument("--interactive", action="store_true")
args = parser.parse_args()

with SimTelFile(args.inputfile) as f:
Expand Down Expand Up @@ -68,7 +69,12 @@

d2.image = trig

input("Enter for next telecope event")
if args.interactive:
input("Enter for next telecope event")
else:
fig.savefig(
f"simtel_trigger_times_event_{event["event_id"]}_tel_{t["header"]["telescope_id"]}.png"
)

if i == args.max_shower_events - 1:
parser.exit(
Expand Down

0 comments on commit b2f2296

Please sign in to comment.