Skip to content

Commit

Permalink
help pls
Browse files Browse the repository at this point in the history
  • Loading branch information
ivalaginja committed Oct 23, 2023
1 parent d322004 commit 0b5cf24
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions catkit2/services/andor_camera/andor_camera.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,27 @@ def open(self):
self.initialize_cooling()

# Set properties from config.
def make_property_helper(name, read_only=False):
if read_only:
self.make_property(name, lambda: getattr(self, name))
else:
self.make_property(name, lambda: getattr(self, name), lambda val: setattr(self, name, val))

self.width = self.config.get('width', 400)
self.height = self.config.get('height', 400)
self.offset_y = self.config.get('aoi_left', 1)
self.offset_x = self.config.get('aoi_top', 100)

make_property_helper('width')
make_property_helper('height')
make_property_helper('offset_x')
make_property_helper('offset_y')

make_property_helper('sensor_width', read_only=True)
make_property_helper('sensor_height', read_only=True)

make_property_helper('exposure_time')

# Set standard camera settings
self.cam.PreAmpGainControl = 5
self.cam.AOIWidth = self.width
Expand Down

0 comments on commit 0b5cf24

Please sign in to comment.