Skip to content

Commit 8e2f71e

Browse files
committed
[cytation] code cleanup
1 parent 6edf7f5 commit 8e2f71e

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

pylabrobot/plate_reading/biotek_backend.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ async def _set_up_camera(self) -> None:
244244
nodemap = self.cam.GetNodeMap()
245245

246246
# -- Configure trigger to be software --
247-
# This is needed for longer exposure times (otherwise 23ms is the maximum)
247+
# This is needed for longer exposure times (otherwise 27.8ms is the maximum)
248248
# 1. Set trigger selector to frame start
249249
ptr_trigger_selector = PySpin.CEnumerationPtr(nodemap.GetNode("TriggerSelector"))
250250
if not PySpin.IsReadable(ptr_trigger_selector) or not PySpin.IsWritable(ptr_trigger_selector):
@@ -459,8 +459,8 @@ async def _reset_trigger(self):
459459
return
460460

461461
# adopted from example
462-
nodemap = self.cam.GetNodeMap()
463462
try:
463+
nodemap = self.cam.GetNodeMap()
464464
node_trigger_mode = PySpin.CEnumerationPtr(nodemap.GetNode("TriggerMode"))
465465
if not PySpin.IsReadable(node_trigger_mode) or not PySpin.IsWritable(node_trigger_mode):
466466
return
@@ -1172,16 +1172,6 @@ async def _acquire_image(
11721172
assert self.cam is not None
11731173
nodemap = self.cam.GetNodeMap()
11741174

1175-
# Start acquisition mode (continuous)
1176-
# node_acquisition_mode = PySpin.CEnumerationPtr(nodemap.GetNode("AcquisitionMode"))
1177-
# if not PySpin.IsReadable(node_acquisition_mode) or not \
1178-
# PySpin.IsWritable(node_acquisition_mode):
1179-
# raise RuntimeError("unable to set acquisition mode to continuous (enum retrieval)")
1180-
# node_acquisition_mode_single_frame = node_acquisition_mode.GetEntryByName("Continuous")
1181-
# if not PySpin.IsReadable(node_acquisition_mode_single_frame):
1182-
# raise RuntimeError("unable to set acquisition mode to single frame (entry retrieval)")
1183-
# node_acquisition_mode.SetIntValue(node_acquisition_mode_single_frame.GetValue())
1184-
11851175
assert self.imaging_config is not None, "Need to set imaging_config first"
11861176

11871177
num_tries = 0
@@ -1261,25 +1251,12 @@ async def capture(
12611251

12621252
self.cam.BeginAcquisition()
12631253
try:
1264-
t0 = time.time()
12651254
await self.set_objective(objective)
1266-
t_objective = time.time()
1267-
logger.debug("[cytation5] set objective in %.2f seconds", t_objective - t0)
12681255
await self.set_imaging_mode(mode, led_intensity=led_intensity)
1269-
t_imaging_mode = time.time()
1270-
logger.debug("[cytation5] set imaging mode in %.2f seconds", t_imaging_mode - t_objective)
12711256
await self.select(row, column)
1272-
t_select = time.time()
1273-
logger.debug("[cytation5] selected well in %.2f seconds", t_select - t_imaging_mode)
12741257
await self.set_exposure(exposure_time)
1275-
t_exposure = time.time()
1276-
logger.debug("[cytation5] set exposure in %.2f seconds", t_exposure - t_select)
12771258
await self.set_gain(gain)
1278-
t_gain = time.time()
1279-
logger.debug("[cytation5] set gain in %.2f seconds", t_gain - t_exposure)
12801259
await self.set_focus(focal_height)
1281-
t_focus = time.time()
1282-
logger.debug("[cytation5] set focus in %.2f seconds", t_focus - t_gain)
12831260

12841261
def image_size(magnification: float) -> Tuple[float, float]:
12851262
# "wide fov" is an option in gen5.exe, but in reality it takes the same pictures. So we just

0 commit comments

Comments
 (0)