Auto-Align script for SkyWatcher telescope

Discussions on extending SharpCap using the built in Python scripting functionality
Post Reply
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Auto-Align script for SkyWatcher telescope

#1

Post by Jean-Francois »

Hello Ruby and Robin,

It was this evening a surprise after installing the last version of the SynScan software (2.4.8).
I found a directory with 2 script for SharpCap.

I tested one script this evening.
It was not working at the first time and not at the second time ... and not at the end because several GOTO was too much north where I have no visible sky.

First problem is the print function in line 129 ... it changes between IronPython 2.7 and 3.4.
>>> print Latitude is not working on SharpCap 4.1.x, but
>>> print(Latitude) will work on both.

Other problem was the function SharpCap.BlindSolver.Solve() at the line 94 ... the function is not "present" in SharpCap 4.1.11251.0.
I replaced the Solve() function with the SolveAsync() function ... then it was working.

Other point ... the script should test the SynScan driver version.
Normally I use the 1.19.20 while it is better working as all the other 2.xx version.

The script starts a lot of GOTO in several direction and at both pier sides ... it takes more time as to perform the polar alignment with the SharpCap tool (for the location with the polar star visibility) or it takes more time as the SynScan 2 stars alignment + the following polar alignment method.

It would be interesting to have the list of the command available to the SynScan software.

Idea for the next version ... please add the possibility to set an user horizon file with the local sky visibility.
The script could then use the horizon file for selecting only target visible from the location.
The horizon file would be a simple text file. Ideally the same as the Carte du Ciel or the OccultWatcher software.

Regards,
Jean-Francois
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Auto-Align script for SkyWatcher telescope

#2

Post by Jean-Francois »

Hello,

I remark now the following code:

Code: Select all

# For SharpCap version 4.0 or earlier.
BlindSolveTask = SharpCap.BlindSolver.Solve(PlateSolvePurpose.MountSync, CancellationToken())
while (BlindSolveTask.Status < TaskStatus.RanToCompletion):
	sleep(0.1)
	Application.DoEvents()
# Obtaining the RA/Dec coordinates from the results of the task
ra = BlindSolveTask.Result.RightAscension   
dec = BlindSolveTask.Result.Declination
# end for SharpCap version 4.0 or earlier
#
#for SharpCap 4.1 or later
#BlindSolveTaskTask = SharpCap.BlindSolver.SolveAsync(PlateSolvePurpose.MountSync, CancellationToken() )
#BlindSolveResult = SharpCap.SafeGetAsyncResult(BlindSolveTask)
#ra  = BlindSolveResult.RightAscension   
#dec = BlindSolveResult.Declination
#end for SharpCap 4.1 or later 
The user needs to change the code depending on the version of SharpCap.

In my scripts, I used now the following code for the import of the ASCOM functions:

Code: Select all

SharpCap_version = SharpCap.AppName.Split("v")[1].Split(",")[0]

if (SharpCap_version.CompareTo("4.1") == -1):   # if version below 4.1, use old ASCOM driver
    clr.AddReference("ASCOM.DriverAccess")
    clr.AddReference("ASCOM.Astrometry")
    from ASCOM.DriverAccess import *
    from ASCOM.Astrometry import *
else:                                           # if version 4.1 or above, use new ASCOM driver
    clr.AddReference("ASCOM.Com")
    clr.AddReference("ASCOM.Tools")
    from ASCOM.Com import *
    from ASCOM.Tools import *
I will be simple to use it in the Auto-Align script.

Regards,
Jean-Francois
User avatar
admin
Site Admin
Posts: 13344
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Auto-Align script for SkyWatcher telescope

#3

Post by admin »

Hi Jean-Francois,

that's interesting... I personally still use EQMOD for my Skywatcher mount (although I had all sorts of issues with the position being bad after my PC accidentally booted onto an old SSD partition the other day, so I am considering replacing it).

I will re-add the Solve command for easier use in scripting - that's simple to do. Unfortunately the ASCOM change is something that cannot be undone.

cheers,

Robin
Jean-Francois
Posts: 402
Joined: Sun Oct 13, 2019 10:52 am
Location: Germany

Re: Auto-Align script for SkyWatcher telescope

#4

Post by Jean-Francois »

Hello Robin,

OK thanks for the Solve() function.
Concerning the different ASCOM ... that is not a problem as long as the programmer of the script knows the difference.
I found now how to test the SharpCap version at the beginning ... my scripts can select the correct method for importing the ASCOM driver.

Jean-Francois
Post Reply