9 """Harvester to select crops, postprocess, and inspect"""
12 output_file_name =
None
15 """This virtual method must be overridden by the inheriting class"""
16 raise RuntimeError(
"Override the harvesting_module method")
19 """Parse the arguments and append them to the harvester's list"""
21 harvesting_argument_group = argument_parser.add_argument_group(
"Harvest arguments")
23 harvesting_argument_group.add_argument(
26 dest=
"output_file_name",
27 default=argparse.SUPPRESS,
28 help=
"File name for the harvest products"
31 return argument_parser
34 """Save the raw crops as a pickle file"""
36 pickle.dump(crops, pickle_file)
39 """Load the raw crops from a pickle file"""
41 return pickle.load(pickle_file)
44 """Post-process the crops"""
51 except FileNotFoundError:
52 print(
"Crops pickle file not found. Create it now.")
54 harvesting_module.refine(crops)
59 """Add the harvester to the basf2 path"""
65 path.add_module(harvesting_module)
70 """Harvester to generate MC events followed by crop selection, postprocessing, inspection"""