I've been working on a little project of mine and it entails running a script to plate solve (no syncing) a capture and work with the resulting RA/Dec coordinates. After looking through forum posts and trying things with the log and API, I have arrived at trying to use the following:
Code: Select all
SharpCap.BlindSolver.Solve(...)
- self: PlateSolveOnly (this one I think can just be ignored)
- frt: PlateSolvePurpose
- cancellationToken: CancellationToken
- radius: float
- hintPosition: RADecPosition
- setPixelPositionData: bool
I wasn't sure how to go about interpreting PlateSolvePurpose and CancellationToken, though I did figure out how I could get the latter by importing it from System.Threading. However, I believe I need to somehow have an argument for the frt: PlateSolvePurpose? I am guessing it should be something along the lines of "PlateSolveOnly", but I don't know where to import that from for usage.
Hoping someone can point me in the right direction! And also let me know if I've misunderstood something. I'm not sure if the cancellation token is necessary, but I feel like I definitely need the PlateSolvePurpose thing and the radius.
Here's where my (relevant) code is at for reference. There's some stuff that's just commented out as placeholders so those can be disregarded. Also, I'm using Astap as my plate solving application if that helps.
Code: Select all
# A script to automate the process of plate solving to obtain RA/Dec coordinates for a specified position
import time
from System.Threading import CancellationToken
def connect_synscan():
for x in SharpCap.Mounts:
if x.Name == "SynScan App Driver":
SharpCap.Mounts.SelectedMount = x
#_____ connect to the camera
SharpCap.SelectedCamera = SharpCap.Cameras.Find(lambda x : x.DeviceName == "Test Camera 1 (Deep Sky)")
#SharpCap.SelectedCamera.Controls.OutputFormat.Value = "PNG Files (*.png)"
#_____ connect to the SynScan Pro app
connect_synscan()
print SharpCap.Mounts.SelectedMount
#_____ move telescope to specified position /// set necessary values
#SharpCap.Mounts.SelectedMount.SlewToAltAz(..., ...) #floats for alt value and az value
#SharpCap.SelectedCamera.GetControl(CommonPropertyIDs.Exposure).Value = 300
#SharpCap.SelectedCamera.GetControl(CommonPropertyIDs.Gain).Value = 1.00
#_____ take photos (capture)
#SharpCap.SelectedCamera.CaptureSingleFrame()
#_____ use platesolving to obtain the RA/Dec coordinates of the capture
#SharpCap.Mounts.SelectedMount.SolveAndSync()
SharpCap.BlindSolver.Solve(CancellationToken.None, 180) # <----------------------------------- what to put here?
#_____ pass the calculated RA/Dec coordinates to SynScan Pro
print SharpCap.Mounts.SelectedMount.RA
print SharpCap.Mounts.SelectedMount.Coordinates.RightAscension
print SharpCap.Mounts.SelectedMount.Dec
print SharpCap.Mounts.SelectedMount.Coordinates.Declination
# i know these are the same, just keeping them here as reference
#Solution : RA=05:35:20,Dec=-05:18:32 (J2000)
#Field of View : 1.5528x1.1402 degrees
#Time : Tue, 22 Aug 2023 19:03:08 GMT
#Orientation : up is 87.2 degrees E of N
#_____ close the camera / exit application
#SharpCap.ExitApplication
RL