Maximum lateral range and minimum autofocus range
This commit is contained in:
parent
e611840aca
commit
c4e02d9087
1 changed files with 40 additions and 33 deletions
|
|
@ -385,6 +385,11 @@ class SmartScanThing(Thing):
|
|||
# It's annoying to have to wait to find out!
|
||||
max_dist = self.max_range
|
||||
|
||||
if self.autofocus_dz == 0:
|
||||
logger.info(f'Running scan without autofocus')
|
||||
elif self.autofocus_dz <= 200:
|
||||
logger.warning(f'Your dz range is {self.autofocus_dz} steps, which is too short to attempt to focus. Running without autofocus')
|
||||
|
||||
if self.skip_background:
|
||||
d = background_detect.background_distributions
|
||||
if not d:
|
||||
|
|
@ -489,6 +494,7 @@ class SmartScanThing(Thing):
|
|||
path.append(pos)
|
||||
|
||||
attempts = 0
|
||||
if self.autofocus_dz > 200:
|
||||
while True:
|
||||
recentre.looping_autofocus(dz=self.autofocus_dz)
|
||||
current_height = stage.position["z"]
|
||||
|
|
@ -524,6 +530,7 @@ class SmartScanThing(Thing):
|
|||
stage.move_absolute(z=int(focused_path[z_index][2]))
|
||||
attempts += 1
|
||||
|
||||
|
||||
name = f"image_{loc[0]}_{loc[1]}.jpg"
|
||||
# img = Image.open(cam.capture_jpeg(resolution="full").open())
|
||||
jpegblob = cam.capture_jpeg(resolution="full")
|
||||
|
|
@ -607,7 +614,7 @@ class SmartScanThing(Thing):
|
|||
@thing_property
|
||||
def max_range(self) -> int:
|
||||
"""The maximum distance from the centre of the scan before we break"""
|
||||
return self.thing_settings.get("max_range", 400000)
|
||||
return self.thing_settings.get("max_range", 70000)
|
||||
|
||||
@max_range.setter
|
||||
def max_range(self, value: int) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue