Skip to content

Commit

Permalink
Add trace interval 'processing frame' to Hamamatsu camera
Browse files Browse the repository at this point in the history
  • Loading branch information
ivalaginja committed Feb 4, 2025
1 parent 9a8777e commit 476efe0
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions catkit2/services/hamamatsu_camera/hamamatsu_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import threading
import numpy as np
from catkit2.testbed.service import Service
from catkit2.testbed.tracing import trace_interval

try:
sdk_path = os.environ.get('CATKIT_DCAM_SDK_PATH')
Expand Down Expand Up @@ -223,15 +224,16 @@ def acquisition_loop(self):

img = self.cam.buf_getlastframedata()

if i == 0:
# The first frame often contains systematic errors, so drop it.
self.log.info('Dropping first camera frame')
i += 1
continue
with trace_interval('processing frame'):
if i == 0:
# The first frame often contains systematic errors, so drop it.
self.log.info('Dropping first camera frame')
i += 1
continue

self.images.submit_data(img.astype('float32'))
self.images.submit_data(img.astype('float32'))

i += 1
i += 1

finally:
# Stop acquisition.
Expand Down

0 comments on commit 476efe0

Please sign in to comment.