Script to take images for focus stacking
Posted: Wed Feb 10, 2021 9:12 pm
I'm working on a project where i want to find micro meteorites and take images of them, to do that i want to use Sharpcap with a ZWO camera and motorfocuser i have here.
Testing it manually it works great, but i want to do it automatically, would someone be willing to help me write a script for this?
I just need to be able to set auto/manual exposure/gain and move the focuser in 1 direction, take 1 image, move focuser, take image etc.
Here's what i gotten together so far from looking at scripts others have written, it moves the focuser, saves an image, but i don't know how to make it cycle through it a set amount of times.
copy/pasting focusing/imaging several times the focuser doesn't move more than once and the image are are saved over the first.
Here's one of my images so far by doing this process manually. The FOV is around 3x2.5mm
Testing it manually it works great, but i want to do it automatically, would someone be willing to help me write a script for this?
I just need to be able to set auto/manual exposure/gain and move the focuser in 1 direction, take 1 image, move focuser, take image etc.
Here's what i gotten together so far from looking at scripts others have written, it moves the focuser, saves an image, but i don't know how to make it cycle through it a set amount of times.
copy/pasting focusing/imaging several times the focuser doesn't move more than once and the image are are saved over the first.
Code: Select all
import time
focus_steps = 150
settle_time = 2
pos_2 = SharpCap.Focusers.SelectedFocuser.Position
pos_1 = pos_2 - focus_steps
pos_3 = pos_2 + focus_steps
SharpCap.SelectedCamera.Controls.OutputFormat.Value = "PNG files (*.png)"
SharpCap.SelectedCamera.Controls.Exposure.Automatic = True
SharpCap.Focusers.SelectedFocuser.Connected = True
pos_2 = SharpCap.Focusers.SelectedFocuser.Position
pos_1 = pos_2 - focus_steps
pos_3 = pos_2 + focus_steps
SharpCap.Focusers.SelectedFocuser.Move(pos_3)
time.sleep(settle_time)
Name="D:\Test\capture" + str(i) + ".png"
SharpCap.SelectedCamera.CaptureSingleFrameTo(Name)