Good morning everyone. I have a Skywatcher Az/GTI and I usually do two-star alignment. But since I have a limited field of view, I ended up creating a script to create a list of two stars and rank them according to their position, magnitude, and separation.
The script connects to the Stellarium server (via localhost:8090), checks the stars' positions relative to my current date, time, and location, and creates the list. Then the script lists the two stars and sends them to the sequencer to perform the alignment. During alignment, the sequencer performs plate solve, syncs the first star, and then goes to the second star and does the same procedure. The script starts automatically when I open Sharpcap and creates the list. Then it's just a matter of running the sequencer for alignment.
Finally, to test the quality, it returns to the second star and checks its centering on the screen.
My question is: the sequence opens a prompt for me to choose the first star to perform the plate solve, then after it finishes, it opens the prompt again for the second star. Instead of opening the prompt, is there a way to make the sequence go directly to the plate solve without showing the prompt for me to choose the star?
I'm waiting clear skies to test it.
Script - 2 Star alignment
Script - 2 Star alignment
- Attachments
-
- Script Result.jpg (120.56 KiB) Viewed 382 times
-
- 1 star detec.jpg (116.7 KiB) Viewed 382 times
Re: Script - 2 Star alignment
Ok. Forget it. Justo got how to do it.
Thanks anyway!!
Thanks anyway!!
-
Jean-Francois
- Posts: 822
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Script - 2 Star alignment
Hello,
Interesting.
Are you sure that you need really to point the mount/telescope to the (defined) stars ?
Do you have a mobile setup every time with different local horizon visibility ?
The 2 (or 3) stars alignment done with Plate Solve and synchronisation ... does not need to select a star.
I think that you can point where you want somewhere in the sky. The mount will know the wanted position and the Plate Solve gives the real position. So the mount can generate a table of the difference after the sync ... and then do a very simple pointing model with these 2 (or 3 points).
The need to use a star is when you use an eyepiece (with reticle) or the manual centring on the camera centre (reticle).
But with a Plate Solve ... you can point everywhere.
With the script .. you can use the ASCOM Transform functions ... and you can set some fixed Alt-Az position. The script will then calculate the RA/DEC coordinates for these Alt-Az. In other words ... you can set the best 2 positions for your location and reuse it every night.
Here an example that I use for a pointing model:
Regards,
Jean-Francois
Interesting.
Are you sure that you need really to point the mount/telescope to the (defined) stars ?
Do you have a mobile setup every time with different local horizon visibility ?
The 2 (or 3) stars alignment done with Plate Solve and synchronisation ... does not need to select a star.
I think that you can point where you want somewhere in the sky. The mount will know the wanted position and the Plate Solve gives the real position. So the mount can generate a table of the difference after the sync ... and then do a very simple pointing model with these 2 (or 3 points).
The need to use a star is when you use an eyepiece (with reticle) or the manual centring on the camera centre (reticle).
But with a Plate Solve ... you can point everywhere.
With the script .. you can use the ASCOM Transform functions ... and you can set some fixed Alt-Az position. The script will then calculate the RA/DEC coordinates for these Alt-Az. In other words ... you can set the best 2 positions for your location and reuse it every night.
Here an example that I use for a pointing model:
Code: Select all
import time
import clr
clr.AddReference("ASCOM.AstrometryTools")
clr.AddReference("ASCOM.Tools")
from ASCOM.Tools import Transform
from ASCOM.Tools.Utilities import DegreesToDMS, DegreesToHMS
from SharpCap.Base import CoordinateParser, RADecPosition, AltAzPosition, Epoch
from SharpCap.Interfaces import PlateSolvePurpose
from System.Threading import CancellationToken
t = Transform()
t.SiteLongitude = 11.12345
t.SiteLatitude = 47.12345
t.SiteElevation = 123
t.SitePressure = 1000
t.SiteTemperature = 10
# Normal Pointing
P = ((26,210),(22,225),(29,240),(22,250),(18,260),(9,267),(10,271),(24,270),(30,255))
P = P + ((35,205),(35,220),(35,270),(40,270),(40,250),(40,230),(40,210),(40,195),(40,182))
P = P + ((50,182),(50,210),(50,230),(50,250),(50,273))
P = P + ((60,287),(60,270),(60,250),(60,230),(60,210),(60,182))
P = P + ((70,182),(70,220),(70,265),(70,310),(75,345),(76,288),(78,230),(85,288))
P_Position = P + ((70,182),(70,220),(70,265),(70,310),(75,345),(76,288),(78,230),(85,288))
Pos_n = 1
for pos in P_Position:
AltAz_Pos = AltAzPosition(pos[0], pos[1])
print(AltAz_Pos)
t.JulianDateUTC = 0.0
t.SetAzimuthElevation(AltAz_Pos.Azimuth, AltAz_Pos.Altitude)
coordinates = CoordinateParser.Parse(str(t.RAJ2000) + ";" + str(t.DecJ2000), True)
SharpCap.Mounts.SelectedMount.AscomMount.SlewToCoordinatesAsync(t.RAJ2000, t.DecJ2000)
print("Slewing ..", end="", flush=True)
time.sleep(1.0)
while SharpCap.Mounts.SelectedMount.Slewing == True: #wait for the mount to stop slewing
time.sleep(1.0)
print(".", end="", flush=True)
print(" done")
time.sleep(2.0) # Normally capture a new image, ideally in "Still Mode"
try:
SharpCap.DisplayStretch.CalcAutoStretch()
result = SharpCap.BlindSolver.Solve(PlateSolvePurpose.Annotation, CancellationToken()) # Take an image
time.sleep(2.0)
Diff_RA = result.RightAscension - t.RAJ2000 # degree
Diff_DEC = result.Declination - t.DecJ2000
Diff_RA = 15 * Diff_RA # hours
print(str("%8.4f" % round(Diff_RA,6)), str("%8.4f" % round(Diff_DEC,6)))
print("Sync to coordinates")
SharpCap.Mounts.SelectedMount.AscomMount.SyncToCoordinates(result.RightAscension, result.Declination)
time.sleep(2.0)
Pos_n = Pos_n + 1
print()
except:
print("Plate Solve error")
t.Dispose()Regards,
Jean-Francois
- admin
- Site Admin
- Posts: 17342
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Script - 2 Star alignment
Hi,
I guess maybe the handset interaction for the alignment is only able to pick pre-determined stars for alignment, rather than any point in the sky?
Looking at this idea makes me think that I should offer easier scripting access to the full star/DSO catalog inside SharpCap - that would make it possible to do something like this entirely within SharpCap rather than needing the connection to Stellarium. I will try to enable that in 4.2
cheers,
Robin
I guess maybe the handset interaction for the alignment is only able to pick pre-determined stars for alignment, rather than any point in the sky?
Looking at this idea makes me think that I should offer easier scripting access to the full star/DSO catalog inside SharpCap - that would make it possible to do something like this entirely within SharpCap rather than needing the connection to Stellarium. I will try to enable that in 4.2
cheers,
Robin
-
Jean-Francois
- Posts: 822
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Script - 2 Star alignment
Hello,
"offer easier scripting access to the full star/DSO catalog inside SharpCap" ... yes, good idea.
Jean-Francois
"offer easier scripting access to the full star/DSO catalog inside SharpCap" ... yes, good idea.
Jean-Francois
- admin
- Site Admin
- Posts: 17342
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Script - 2 Star alignment
Good - that is now coming in 4.2...
cheers,
Robin
Code: Select all
things = SharpCap.FullCatalog.CatalogEntries # all the entries
thing = SharpCap.FullCatalog.Find("M42") # find a specific entry, including partial match if no exact match
SharpCap.FullCatalog.ForceReload() # reload all the catalog, including custom
Robin