Skip to content

Commit a2ed962

Browse files
Update adaptive_optics.py
1 parent 6e799e2 commit a2ed962

File tree

1 file changed

+1
-49
lines changed

1 file changed

+1
-49
lines changed

src/navigate/model/features/adaptive_optics.py

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,9 @@ def __init__(self,
180180
#: list: detailed report to save as JSON after
181181
self.report = []
182182

183+
#: bool: True if you want to print the full output string each step
183184
self.verbose = verbose
184185

185-
# TODO: I don't think these are used...
186-
self.laser = None
187-
self.laser_power = 0
188186
self.start_time = 0
189187

190188
#: navigate.model.Model: Model object
@@ -222,21 +220,6 @@ def __init__(self,
222220

223221
self.fit_func = self.tw_settings["fitfunc"]
224222

225-
# if start_from == "flat":
226-
# self.best_coefs = np.zeros(self.n_modes, dtype=np.float32)
227-
# elif start_from == "current":
228-
# curr_expt_coefs = list(
229-
# self.model.configuration["experiment"]["MirrorParameters"][
230-
# "modes"
231-
# ].values()
232-
# )
233-
# self.best_coefs = np.asarray(curr_expt_coefs, dtype=np.float32)
234-
235-
# self.best_coefs_overall = deepcopy(self.best_coefs)
236-
# self.best_metric = 0.0
237-
# self.coef_sweep = None
238-
# self.best_peaks = []
239-
240223
# Queue
241224
self.tw_frame_queue = Queue()
242225
self.tw_data_queue = Queue()
@@ -276,10 +259,6 @@ def run(self, *args):
276259
if frame_num < 1:
277260
return
278261

279-
# Opens correct shutter and puts all signals to false
280-
# self.model.prepare_acquisition()
281-
# self.model.active_microscope.prepare_next_channel()
282-
283262
self.model.addon_feature = [
284263
[
285264
{"name": PrepareNextChannel},
@@ -293,28 +272,6 @@ def run(self, *args):
293272

294273
self.model.run_command("acquire")
295274

296-
# # load signal and data containers
297-
# self.model.signal_container, self.model.data_container = load_features(
298-
# self.model, [[{"name": TonyWilson}]]
299-
# )
300-
301-
# self.model.signal_thread = threading.Thread(
302-
# target=self.model.run_acquisition, name="TonyWilson Signal"
303-
# )
304-
305-
# self.model.data_thread = threading.Thread(
306-
# target=self.model.run_data_process,
307-
# # args=(frame_num,),
308-
# kwargs={"data_func": self.image_writer.save_image},
309-
# name="TonyWilson Data",
310-
# )
311-
312-
# print("\n**** STARTING TONY WILSON ****\n")
313-
314-
# # Start Threads
315-
# self.model.signal_thread.start()
316-
# self.model.data_thread.start()
317-
318275
def get_tw_frame_num(self):
319276
"""Calculate how many frames are needed: iterations x steps x num_coefs"""
320277
return self.tw_settings["iterations"] * self.tw_settings["steps"] * self.n_coefs
@@ -362,8 +319,6 @@ def pre_func_signal(self):
362319
self.target_signal_id = 0
363320
self.total_frame_num = self.get_tw_frame_num()
364321

365-
# print(f"Total frame num: {self.total_frame_num}")
366-
367322
if self.start_from == "flat":
368323
self.best_coefs = np.zeros(self.n_modes, dtype=np.float32)
369324
elif self.start_from == "current":
@@ -673,9 +628,6 @@ def end_func_data(self):
673628
"""
674629
if self.done_all:
675630
self.best_coefs = self.best_coefs_overall
676-
# self.model.stop_acquisition = True
677-
# self.model.end_acquisition()
678-
# print("Ending acquisition...")
679631
try:
680632
stop_time = time.time()
681633
print(f"Total runtime:\t{(stop_time - self.start_time):.3f} sec")

0 commit comments

Comments
 (0)