comparison spyboat_cli.py @ 4:a4c6fcf2c456 draft

"planemo upload commit 0584e8878deaf91614c6bb3c0122975300132c25"
author gregor.m
date Thu, 26 Nov 2020 16:40:47 +0000
parents 4d7f30a7e2f6
children d5a4180410c4
comparison
equal deleted inserted replaced
3:4d7f30a7e2f6 4:a4c6fcf2c456
10 10
11 import spyboat 11 import spyboat
12 import output_report 12 import output_report
13 13
14 logging.basicConfig(level=logging.INFO, stream=sys.stdout, force=True) 14 logging.basicConfig(level=logging.INFO, stream=sys.stdout, force=True)
15 logger = logging.getLogger('wrapper') 15 logger = logging.getLogger('spyboat-cli')
16 16
17 # ----------command line parameters --------------- 17 # ----------command line parameters ---------------
18 18
19 parser = argparse.ArgumentParser(description='Process some arguments.') 19 parser = argparse.ArgumentParser(description='Process some arguments.')
20 20
77 # ------------Read the input---------------------------------------- 77 # ------------Read the input----------------------------------------
78 try: 78 try:
79 movie = spyboat.open_tif(arguments.input_path) 79 movie = spyboat.open_tif(arguments.input_path)
80 except FileNotFoundError: 80 except FileNotFoundError:
81 logger.critical(f"Couldn't open {arguments.input_path}, check movie storage directory!") 81 logger.critical(f"Couldn't open {arguments.input_path}, check movie storage directory!")
82
83 sys.exit(1) 82 sys.exit(1)
84 83 # problems get logged in 'open_tif'
84 if movie is None:
85 sys.exit(1)
85 # -------- Do (optional) spatial downsampling --------------------------- 86 # -------- Do (optional) spatial downsampling ---------------------------
86 87
87 scale_factor = arguments.rescale 88 scale_factor = arguments.rescale
88 89
89 # defaults to None 90 # defaults to None
160 161
161 if arguments.report_img_path != '.': 162 if arguments.report_img_path != '.':
162 logger.info(f'Creating report directory {arguments.report_img_path}') 163 logger.info(f'Creating report directory {arguments.report_img_path}')
163 os.mkdir(arguments.report_img_path) 164 os.mkdir(arguments.report_img_path)
164 165
165 # make 6 times 4 snapshots each 166 # 4 snapshots each
166 Nsnap = 6 167 Nsnap = 7
167 NFrames = movie.shape[0] 168 NFrames = movie.shape[0]
168 # show only frames at least one Tmin 169 # show only frames at least one Tmin
169 # away from the edge (-effects) 170 # away from the edge (-effects)
170 start_frame = int(Wkwargs['Tmin']/Wkwargs['dt']) 171 start_frame = int(Wkwargs['Tmin']/Wkwargs['dt'])
171 172