Hi,
a few things you can do to improve this...
1) Specify a hint position and a search radius using extra parameters in your call to BlindSolver.Solve - the hint position you can just take from the current co-ordinates of the mount, and a search radius of maybe 15 degrees will limit the search area and the time taken.
2) If the user cancels the plate solve then I think you will get an OperationCancelledException thrown, which you can catch and treat as if the solve had failed.
3) If you want to be able to cancel the operation from your code, you need to create a CancellationTokenSource and pass the Token from that to the call to Solve(...). You can set up the cancellation token source to cancel after a fixed time (say 15s) or potentially cancel from another thread if a new frame arrives or something.
cheers,
Robin
Polar Alignment via Platesolving
-
Jean-Francois
- Posts: 826
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Polar Alignment via Platesolving
Hello Robin,
Thanks for information ... but, it will be a situation ... you write some words that seems to be easy, but in fact it takes me days to understand and test until something work
I try to have in my script the possibility to have a polar alignment without any computer connection to a mount.
OK in this case it is easy to check if a mount is connected or not. If not, then a full sky plate solve will be perform each time or at least for the first point. The next point can used the preceding solved point as starting point.
The point 1) seems to be easy to code.
Regards,
Jean-Francois
Thanks for information ... but, it will be a situation ... you write some words that seems to be easy, but in fact it takes me days to understand and test until something work
I try to have in my script the possibility to have a polar alignment without any computer connection to a mount.
OK in this case it is easy to check if a mount is connected or not. If not, then a full sky plate solve will be perform each time or at least for the first point. The next point can used the preceding solved point as starting point.
The point 1) seems to be easy to code.
Regards,
Jean-Francois
Re: Polar Alignment via Platesolving
Hi everyone.
Jean, I´m very interesting with your project. How is it going? Do you have a new version?
Best regards!
Jean, I´m very interesting with your project. How is it going? Do you have a new version?
Best regards!
-
Jean-Francois
- Posts: 826
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Polar Alignment via Platesolving
Hello Nandojoe,
Sorry, but I did not finish my script.
I have a last test version from end May, but I do not remember what I changed.
The main problem is the testing and correction of the "last" bug
I did hundred of tests with the ASCOM Sky Simulator (very good for testing), but the Sky Simulator does not produce star trails.
That is what happen when I perform the mount basis alignment ... the telescope moves a little bit and the stars have trails ... and the Plate Solve software does not find a solution and my script crash.
The point is I can only test a new version of the script with a real sky and my mount/telescope.
OK, you are in the south hemisphere ... so I can see you as "south beta tester"
My script should work in the south hemisphere ... I simulated it one time with the Sky Simulator, but no test on a real sky.
It was sometimes possible to finish the adjustment with my script, but only with very slow movement of the mount (Alt and Az adjustment screws) so that no star trails or other star vibration on the image. If the Plate Solve does not find a solution, then the script crash and you need to start from the beginning.
Regards,
Jean-Francois
Sorry, but I did not finish my script.
I have a last test version from end May, but I do not remember what I changed.
The main problem is the testing and correction of the "last" bug
I did hundred of tests with the ASCOM Sky Simulator (very good for testing), but the Sky Simulator does not produce star trails.
That is what happen when I perform the mount basis alignment ... the telescope moves a little bit and the stars have trails ... and the Plate Solve software does not find a solution and my script crash.
The point is I can only test a new version of the script with a real sky and my mount/telescope.
OK, you are in the south hemisphere ... so I can see you as "south beta tester"
My script should work in the south hemisphere ... I simulated it one time with the Sky Simulator, but no test on a real sky.
It was sometimes possible to finish the adjustment with my script, but only with very slow movement of the mount (Alt and Az adjustment screws) so that no star trails or other star vibration on the image. If the Plate Solve does not find a solution, then the script crash and you need to start from the beginning.
Regards,
Jean-Francois
Re: Polar Alignment via Platesolving
1 189
Hi Jean. I’d love to keep testing your script here in the Southern Hemisphere. I actually ran some tests yesterday, but the version I have is from your April 12, 2026 post, so I don't think it's the latest one. I’d appreciate it if you could send me the most recent version. My version is:
# SharpCap script "SASPA_Beta-Test.py"
# 2026/04/25 Jean-Francois
#
# **************************** The script will run only with SharpCap 4.1.xxxx ******************************
# --------------------------------------------------------------------------------------------------------------
#
# Version: 0.0.7: First version
In the tests I ran yesterday, I noticed that during the 3-point phase, if it fails to plate-solve, it moves on to the next point anyway. So, in the end, the user has 3 points but only 1 or 2 successful plate-solves.
I also noticed that during the alignment phase—after obtaining 3 points and 3 successful plate-solves—it performs another plate-solve, and if it fails to solve, the system throws an error.
I’m going to try modifying it so that, during the 3-point phase, it only proceeds to the next point after a successful plate-solve. And for the alignment phase, I’ll try changing it so that it keeps attempting to plate-solve (regardless of success or failure) until the user cancels the process.
One more thing: could you give me a brief explanation of how the error is calculated? Does it rely solely on the plate-solving data, or does it perform calculations based on star trails?
Could you please make your latest version available?
Thanks a lot.
Best regards.
Hi Jean. I’d love to keep testing your script here in the Southern Hemisphere. I actually ran some tests yesterday, but the version I have is from your April 12, 2026 post, so I don't think it's the latest one. I’d appreciate it if you could send me the most recent version. My version is:
# SharpCap script "SASPA_Beta-Test.py"
# 2026/04/25 Jean-Francois
#
# **************************** The script will run only with SharpCap 4.1.xxxx ******************************
# --------------------------------------------------------------------------------------------------------------
#
# Version: 0.0.7: First version
In the tests I ran yesterday, I noticed that during the 3-point phase, if it fails to plate-solve, it moves on to the next point anyway. So, in the end, the user has 3 points but only 1 or 2 successful plate-solves.
I also noticed that during the alignment phase—after obtaining 3 points and 3 successful plate-solves—it performs another plate-solve, and if it fails to solve, the system throws an error.
I’m going to try modifying it so that, during the 3-point phase, it only proceeds to the next point after a successful plate-solve. And for the alignment phase, I’ll try changing it so that it keeps attempting to plate-solve (regardless of success or failure) until the user cancels the process.
One more thing: could you give me a brief explanation of how the error is calculated? Does it rely solely on the plate-solving data, or does it perform calculations based on star trails?
Could you please make your latest version available?
Thanks a lot.
Best regards.
Re: Polar Alignment via Platesolving
***********UPDATE**********
I’ve already made a few adjustments, all for "manual" mode. The first relates to plate solving: if it fails to find a solution, it keeps trying rather than moving on to the next point.
The second concerns the "alignment" phase: if plate solving fails, the script keeps trying; if it succeeds, it proceeds with the process.
Based on the tests I ran in SharpCap, it worked exactly as intended with these changes.
I noticed in the thread that you mentioned discovering a calculation error. Does the version I have already include the corrected calculation?
I’ve already made a few adjustments, all for "manual" mode. The first relates to plate solving: if it fails to find a solution, it keeps trying rather than moving on to the next point.
The second concerns the "alignment" phase: if plate solving fails, the script keeps trying; if it succeeds, it proceeds with the process.
Based on the tests I ran in SharpCap, it worked exactly as intended with these changes.
I noticed in the thread that you mentioned discovering a calculation error. Does the version I have already include the corrected calculation?
- Attachments
-
- Test - sucessifull plate solving.jpg (533 KiB) Viewed 54 times
-
- Test - no plate solving.png (127.96 KiB) Viewed 54 times
-
Jean-Francois
- Posts: 826
- Joined: Sun Oct 13, 2019 10:52 am
- Location: Germany
Re: Polar Alignment via Platesolving
Hello nandojoe,
the last script I have is the following:
"I noticed in the thread that you mentioned discovering a calculation error. Does the version I have already include the corrected calculation?"
If you do some tests with the ASCOM Sky Simulator or with your real mount/sky with a good polar aligned mount, and if you have no big jump of the Altitude & Azimut display, then the calculation error was corrected.
"One more thing: could you give me a brief explanation of how the error is calculated? Does it rely solely on the plate-solving data, or does it perform calculations based on star trails?"
Star trails ? ... no star trails "calculation" ... the images should avoid any trails of the stars.
How the polar alignment is calculated ? ... it is done in several steps from J2000 coordinates to JNow (mount angles) and some "magic"
I use the ASCOM.Transform function for the transformation between J2000 and Topocentric (JNow).
The trigonometric equation fit is done with some smart calculation (no extern non-linear library).
You have some updates in the script around the Plate Solve ... can you communicate it ? ... so that I can have a look and insert it in my script ?
Regards,
Jean-Francois
the last script I have is the following:
"I noticed in the thread that you mentioned discovering a calculation error. Does the version I have already include the corrected calculation?"
If you do some tests with the ASCOM Sky Simulator or with your real mount/sky with a good polar aligned mount, and if you have no big jump of the Altitude & Azimut display, then the calculation error was corrected.
"One more thing: could you give me a brief explanation of how the error is calculated? Does it rely solely on the plate-solving data, or does it perform calculations based on star trails?"
Star trails ? ... no star trails "calculation" ... the images should avoid any trails of the stars.
How the polar alignment is calculated ? ... it is done in several steps from J2000 coordinates to JNow (mount angles) and some "magic"
I use the ASCOM.Transform function for the transformation between J2000 and Topocentric (JNow).
The trigonometric equation fit is done with some smart calculation (no extern non-linear library).
You have some updates in the script around the Plate Solve ... can you communicate it ? ... so that I can have a look and insert it in my script ?
Regards,
Jean-Francois
Re: Polar Alignment via Platesolving
I kept the polar-alignment calculation unchanged. The changes I made were mainly to make the Plate Solve failure handling more robust:
1.Plate Solve failure is now caught with try/except. If SharpCap.BlindSolver.Solve() fails, the script does not terminate. It returns a failure status and enters the retry procedure.
2. Automatic P1/P2/P3 sequence retries the same position.
When a Plate Solve fails, the script does not advance the mount to the next position. It waits for another frame and tries the Plate Solve again at the same physical position.
3. A failed solve does not consume a measurement point.
SolveN and the measurement arrays are only updated after a successful Plate Solve.
4. Retry timing was made safer.
I added a WaitForRetryFrame() routine which waits according to the current camera exposure instead of using WaitNewImage() after a failed solve. This avoids the retry loop becoming blocked while waiting for a new image event.
5. A successful Plate Solve is separated from subsequent processing.
The actual BlindSolver.Solve() result determines whether the Plate Solve succeeded. Errors occurring afterwards during ASCOM coordinate transformation, UI updates or star annotation are not treated as a new Plate Solve failure.
6. Star annotation is treated as visual only.
If displaying the solved stars produces an error, the valid Plate Solve is still retained.
7. The measurement positions are checked for actual sky separation before the final calculation, avoiding a mathematically valid-looking but physically degenerate solution caused by repeated solves of essentially the same sky position.
The main idea was therefore to make the script recover automatically from a failed Plate Solve instead of forcing the user to restart the entire polar-alignment procedure.
The actual polar-alignment mathematics was not changed.
I only have conditions to testando in real world next Friday.
1.Plate Solve failure is now caught with try/except. If SharpCap.BlindSolver.Solve() fails, the script does not terminate. It returns a failure status and enters the retry procedure.
2. Automatic P1/P2/P3 sequence retries the same position.
When a Plate Solve fails, the script does not advance the mount to the next position. It waits for another frame and tries the Plate Solve again at the same physical position.
3. A failed solve does not consume a measurement point.
SolveN and the measurement arrays are only updated after a successful Plate Solve.
4. Retry timing was made safer.
I added a WaitForRetryFrame() routine which waits according to the current camera exposure instead of using WaitNewImage() after a failed solve. This avoids the retry loop becoming blocked while waiting for a new image event.
5. A successful Plate Solve is separated from subsequent processing.
The actual BlindSolver.Solve() result determines whether the Plate Solve succeeded. Errors occurring afterwards during ASCOM coordinate transformation, UI updates or star annotation are not treated as a new Plate Solve failure.
6. Star annotation is treated as visual only.
If displaying the solved stars produces an error, the valid Plate Solve is still retained.
7. The measurement positions are checked for actual sky separation before the final calculation, avoiding a mathematically valid-looking but physically degenerate solution caused by repeated solves of essentially the same sky position.
The main idea was therefore to make the script recover automatically from a failed Plate Solve instead of forcing the user to restart the entire polar-alignment procedure.
The actual polar-alignment mathematics was not changed.
I only have conditions to testando in real world next Friday.
- Attachments
-
- SASPA_Beta-Test%200.0.16%20ok_2.py
- (73.43 KiB) Not downloaded yet