122122 type = str ,
123123 help = "File path for background image, e.g. for screen." ,
124124)
125- def analyze_image (fp , gamma , width , bayer , lens , lensless , bg , rg , plot_width , save , save_auto , nbits , down , back ):
125+ def analyze_image (
126+ fp , gamma , width , bayer , lens , lensless , bg , rg , plot_width , save , save_auto , nbits , down , back
127+ ):
126128 assert fp is not None , "Must pass file path."
127129
128130 # initialize plotting axis
@@ -142,7 +144,7 @@ def analyze_image(fp, gamma, width, bayer, lens, lensless, bg, rg, plot_width, s
142144 red_gain = rg ,
143145 nbits_out = nbits ,
144146 return_float = False ,
145- downsample = down
147+ downsample = down ,
146148 )[0 ]
147149 else :
148150 img = load_image (
@@ -153,7 +155,7 @@ def analyze_image(fp, gamma, width, bayer, lens, lensless, bg, rg, plot_width, s
153155 red_gain = rg ,
154156 nbits_out = nbits ,
155157 back = back ,
156- downsample = down
158+ downsample = down ,
157159 )
158160 if nbits is None :
159161 nbits = int (np .ceil (np .log2 (img .max ())))
@@ -198,7 +200,7 @@ def analyze_image(fp, gamma, width, bayer, lens, lensless, bg, rg, plot_width, s
198200 # -- grey
199201 fig_auto , ax_auto = plt .subplots (ncols = 4 , nrows = 2 , num = "Autocorrelations" , figsize = (15 , 5 ))
200202 _ , autocorr_grey = plot_autocorr2d (img_grey , ax = ax_auto [0 ][0 ])
201- print (f "-- grayscale" )
203+ print ("-- grayscale" )
202204 plot_cross_section (
203205 autocorr_grey , color = "gray" , plot_db_drop = width , ax = ax_auto [1 ][0 ], plot_width = plot_width
204206 )
@@ -233,8 +235,6 @@ def analyze_image(fp, gamma, width, bayer, lens, lensless, bg, rg, plot_width, s
233235 print (f"\n Autocorrelation saved to: { auto_fp } " )
234236 else :
235237 plt .show ()
236-
237-
238238
239239
240240if __name__ == "__main__" :
0 commit comments