Skip to content

Commit

Permalink
added command line flag for getting trigger patches from file
Browse files Browse the repository at this point in the history
set default back to simulation
  • Loading branch information
TjarkMiener committed Jul 2, 2024
1 parent 95f97e3 commit d4edbdc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ctlearn/default_config_files/triggerSingleCNN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Data:
number_of_trigger_patches: [7, 7]
reco_cherenkov_photons: False
include_nsb_patches: 'off'
get_trigger_patch: 'file'
get_trigger_patch: 'simulation'
waveform_settings:
waveform_type: 'raw'
waveform_sequence_length: 5
Expand Down
2 changes: 1 addition & 1 deletion ctlearn/default_config_files/triggerTRN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Data:
number_of_trigger_patches: [7, 7]
reco_cherenkov_photons: False
include_nsb_patches: 'off'
get_trigger_patch: 'file'
get_trigger_patch: 'simulation'
waveform_settings:
waveform_type: 'raw'
waveform_sequence_length: 5
Expand Down
12 changes: 12 additions & 0 deletions ctlearn/run_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ def main():
action=argparse.BooleanOptionalAction,
help="Flag, if the network should include NSB trigger patches at training phase. In prediction mode, the network should only predict on NSB trigger patches",
)
parser.add_argument(
"--trigger_patches_from_file",
default=False,
action=argparse.BooleanOptionalAction,
help="Flag, if the trigger patches should be retrieved from an external file",
)
parser.add_argument(
"--pretrained_weights", "-w", help="Path to the pretrained weights"
)
Expand Down Expand Up @@ -668,6 +674,8 @@ def main():
config["Data"]["trigger_settings"]["include_nsb_patches"] = "auto"
else:
config["Data"]["trigger_settings"]["include_nsb_patches"] = "off"
if args.trigger_patches_from_file:
config["Data"]["trigger_settings"]["get_trigger_patch"] = "file"

run_model(config, mode="train", debug=args.debug, log_to_file=args.log_to_file)

Expand Down Expand Up @@ -705,6 +713,8 @@ def main():
config["Data"]["trigger_settings"]["include_nsb_patches"] = "all"
else:
config["Data"]["trigger_settings"]["include_nsb_patches"] = "off"
if args.trigger_patches_from_file:
config["Data"]["trigger_settings"]["get_trigger_patch"] = "file"
if args.tel_types:
config["Data"]["selected_telescope_types"] = args.tel_types
if args.allowed_tels:
Expand Down Expand Up @@ -780,6 +790,8 @@ def main():
config["Data"]["trigger_settings"]["include_nsb_patches"] = "all"
else:
config["Data"]["trigger_settings"]["include_nsb_patches"] = "off"
if args.trigger_patches_from_file:
config["Data"]["trigger_settings"]["get_trigger_patch"] = "file"
if args.tel_types:
config["Data"]["selected_telescope_types"] = args.tel_types
if args.allowed_tels:
Expand Down

0 comments on commit d4edbdc

Please sign in to comment.