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

Add progress bar to both TRAINING and DL2 production scripts #150

Merged
merged 4 commits into from
Jul 7, 2021
Merged
Show file tree
Hide file tree
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
12 changes: 9 additions & 3 deletions protopipe/scripts/data_training.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import signal
import tables as tb
import pandas as pd
from tqdm import tqdm

from ctapipe.utils import CutFlow
from ctapipe.io import EventSource
Expand Down Expand Up @@ -251,9 +252,14 @@ def main():
impact_dict,
good_event,
good_for_reco,
) in preper.prepare_event(
source, save_images=args.save_images, debug=args.debug
):
) in tqdm(
preper.prepare_event(source,
save_images=args.save_images,
debug=args.debug),
desc=source.__class__.__name__,
total=source.max_events,
unit="event"
):

if good_event:

Expand Down
12 changes: 9 additions & 3 deletions protopipe/scripts/write_dl2.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from astropy.coordinates.angle_utilities import angular_separation
import tables as tb
import astropy.units as u
from tqdm import tqdm

# ctapipe
from ctapipe.io import EventSource
Expand Down Expand Up @@ -297,9 +298,14 @@ class RecoEvent(tb.IsDescription):
impact_dict,
good_event,
good_for_reco,
) in preper.prepare_event(
source, save_images=args.save_images, debug=args.debug
):
) in tqdm(
preper.prepare_event(source,
save_images=args.save_images,
debug=args.debug),
desc=source.__class__.__name__,
total=source.max_events,
unit="event"
):

# True direction
true_az = event.simulation.shower.az
Expand Down