Does SGP talk to Planewave's PWI AutoFocus?

Yes that is something for Jared.

@Kurious_George

Hi, Sorry to hear about last night’s SGP/ASTAP glitch. Also I am curious to know if you had ever tried the Auto Focus Metric in SGP FWHM that requires PinPoint?

Yes, I have. FWHM does not work as well as HFR. It has a noticeably larger calculated focus variation.

@han, @mikaelA

Hi,

I have just completed a review of my AF results from the only recent night of decent seeing, comparing the SGP AF result with the ASTAP result.

From my sample it seems that SGP is providing a result that is approximately 5 steps in from the ASTAP result.

I am doubtful that this level of discrepancy would matter much to anyone using even really high-end amateur equipment but as it seems a reasonably consistent amount I feel there is probably a systemic cause rather than merely random variation due to 'noisy data.

Interested to hear your views. I can supply the AF images if you are interested in investigating further.

Mike

Hello Mike,

At least SGP is performing well.The only complain a hear is that SGP focusing could fail under less ideal conditions.

I agree the 5 steps discrepancy look statistically significant. If you used for ASTAP the same images then it would be interesting to further investigate. But probably only a simulation will show where it comes from. But 5 steps is too small to have a real influence on the quality of the images. Looking to your graphs only an error of 20 steps or more will have an impact.

Han

The original post was to compare to the Planewave algorithm which ALWAYS gives me nearly perfect focus.

If we can get ASTAP working on SGP, I can find a situation where they differ significantly.

KG

KG,

I haven’t received any response back from PlaneWave on the request to use PlateSolve2 for focusing but the request is only four working days old.

@Jared should look to your problem in:

Han

KG,

I am looking forward to the next release of SGP as much as you in the hope that it will fix the issue you had with last version.

From my testing to date of the v4 ASTAP star detection / FocPos calcuIation I find it is putting me at near perfect focus very consistently and in worse seeing conditions than the HFR method of v3.2.0.613 achieved. I very much hope you find the same.

If there are FoVs, optical designs or other circumstances that consistently lead to a poor focus result I guess we will all be interested to take a look to identify a cause.

Here’s to the next version.

Mike

Yes, here’s to the next version Mike. (-:

KG

For each AF run I loaded the 7 AF images plus 1 validation frame into ASTAP, added the FocPos parameter then used the hyperbolic curve fit routine to determine the ASTAP result.

Unless I am missing something these are the same images as analysed by ASTAP during the actual AF run. The only difference I know of is that SGP is using @mikaelA’s parabolic curve fit method rather than ASTAPs hyperbolic fit. I cannot say either is giving a poor result and I guess it is arguable which is the most near perfect from even a theoretical perspective.

Not sure about lucky imaging, but for lengthier exposures I agree that such small differences would in general be totally overwhelmed by atmospheric turbulence etc.

Mike

I’m guessing but one reason could be an asymmetrical V-curve which some people report. One of the wings has a different angle and you will probably find different focus by using a parabolic or hyperbolic match.

With an asymmetrical V-curve, also the calculation method of the curve-fit-error has an influence because it has to find the best fit/compromise. The actual curve and perfect curve will never fit perfectly. Calculating the errors linear or squared will make a difference in the calculated focus I assume.

Han

@mikaelA, cc @jared

Hi,

Have you ever considered offering the user the option of selecting say parabolic, hyperbolic and V-curve fit?

I am thinking that the current AF solution offers good user feed-back as to how an AF run is progressing.

So rather than re-engineer all that useful part, I am thinking that having got a reasonable set of 5, 7, 9 whatever AF data points, the last step would be to use these values to perform a final AF curve fit / best focpos determinaton as selected by the user prior to capturing the validation frame.

From my stand-point I think the hyperbolic fit would best suit the AF curves that I get from my present rig but appreciate that other users may think differently.

By offering a set of options it seems to me that SGP can appeal to the widest audience.

Mike

Hi Mike,

Just for record, I did not write the quadratic fitting routine, which was written by Jerry Macon. I participated in that effort with @bulrichl in that they used my AF logviewer to process a lot of SGP user logs to test out the quadratic routine.

Since then I have developed a hyperbolic routine for a “private” software project, so I can help out with the code if @Jared would like to go in this direction. The modifiations would be quite minor.

I completely agree that it would make sense to let the user chose between a quadratic and hyperbolic routine, as people with a working setup is less inclined to tinker with something that works for them.

Mikael

Mike,

Your comparison of SGP vs. ASTAP results I think shows that for that particular target the difference is not important, with your setup.

In my setup I have really only seen repetedely failed AF runs when imaging some globular clustars, as I think quite a few people have been pointing out on this forum. @han, do you think your star detection routine has any reason to work better on such targets ? As I remember you made some changes to the plate solving part of ASTAP for globular clusters, would that impact the HFD measurement ?

Personally I would be interested in testing out ASTAP focusing on such a “hard” target. I would test it myself, if my imaging gear was not in France, where the current lockdown situation is very strict!

@Kurious_George, @han

In fact, looks like PlateSolve2 focus analysis can be invoked through the command line. It was discussed and solved on this APT forum thread:

https://aptforum.com/phpbb/viewtopic.php?f=17&t=794

I tested it with KG’s images, and it worked as expected.
It would not allow a “live” focus analysis, as all the images would need to be taken before they can be analyses.

I don’t know if SGP can use this function without some kind of licence agreement…

Mikael

1 Like

Mikael,

I completely agree that it would make sense to let the user chose between a quadratic and*
hyperbolic routine,as people with a working setup is less inclined to tinker with something that works for them.*

For my APO the detected hyperbole fits perfectly up to HFD 30. Once you master the hyperbole math there is no need for any other curve. The wings are almost perfect linear lines (using HFD as input) and only a hyperbole will fit best. Some pioneers like Focusmax developers came to the same conclusion.

do you think your star detection routine has any reason to work better on such targets ? *
As I remember you made some changes to the plate solving part of ASTAP for globular clusters, would that impact the HFD measurement ?*

My problem was that Gaia database contained huge amount of global cluster stars and an Earth based telescope could not separate them due to the tiny distances <1arcsec. But the star detection works well around the global clusters.

In fact, looks like PlateSolve2 focus analysis can be invoked through the command line. It was discussed and solved on this APT forum thread:

Great then it is technical possible and easy to implement. If @Jared has permission and implements it you could try all star detection options and use the one which performs best for you making everybody happy.

Han

If you have Globular Cluster subs available the you can load these directly into ASTAP to get a feel for the detecions it is making.

I did this when the issue of GCs first came up on this thread and the results seemed very comparable to those obtained using more regular images.

Also Han kindly made a change to ASTAP to output a list of its star detections so as to facilitate more detailed analysis. Details elsewhere in this thread if I can only find the post!

Mike

PS: And unless @jared has made a change, I think the AF image and star detections displayed in SGP are still based on the pre-ASTAP star detection, so SGP star detection image is not an accurate display of the ASTAP star analysis.

The HFD values displayed in the image by SGP beta from 2 ? weeks ago are still based on the internal algorithm. So ASTAP is not fully integrated.

Easiest way to demonstrate the star detection is to use the ASTAP image inspector (ASTAP viewer, tools, image(CCD) inspector) on a global cluster image. The HFD value annotated should be pretty constant especially for out of focus images

I think you can do the same with PlateSolve2. It will also show the used stars for solving.

See for example:

1 Like

@Jared, cc @han, @mikaelA

Hi, I managed to get a short period of testing of v.643 HFD AF the other evening. Near full moon and rather hazy so not much use for anything else.

Overall, I managed 22 AF runs:

100% quality : 2
99% quality : 9
98% quality : 3
97% quality : 5

: the remaining 3 were naff due to passing clouds.

The focpos numbers were very consistent in my opinion, so generally a satisfying result.

When checking the results in the logfile however I noticed that the #stars detected when close to good focus were at a lower level to the numbers detected when at the extremities! Counter-intuitive to say the least.

I am guessing this effect is due to down-sampling of the image or an effect of the minimum star size parameter value. The ultimate FocPos calculation does not seem to have been unduly harmed but certainly not an effect I was expecting!

Also I observe that while the #stars detected at the curve extremities using HFD were generally higher that the HFR result, the level of difference seemed lower that what I was anticipating based on loading the as captured images direct into ASTAP. To my mind with parabolic fit of AF curve the star detections / measurements found at the extremities has a very significant impact on the final calculated focpos. I think a little further investigation is warranted.

Regards

Mike

PS Have you had any furter thoughts about a) incuding focpos etc in the AF images FITS header, and b) providing a hyperbolic curve fit? With regard to b), Han has obviously got the hyperbolic curve fit problem cracked so I am wondering if he would perhaps share some in-sight.

OK, to expand on the point I was aiming to make in the above post.

Here is a link to one of the AF Packs produced during my test session:

I am familiar with loading the FITS image files into ASTAP as illustrated below to get #star detections (i.e ranging from 19 to 180), an HFD measurement for each image, and finally a best focus focuser position (ie 5684) using hyperbolic curve fit, i.e.

Below are the corresponding SGP logfile records made during the course of this AF run:

FocPos 5800
[12/01/20 19:56:39.655][DEBUG][Main Thread][AF;] Star list contains 6 stars…
[12/01/20 19:56:39.655][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:56:41.088][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 4.68 with 10 stars
[12/01/20 19:56:41.099][INFO][Camera Thread][AF;] Incremental Fit Result (1): quality=%; a=0; b=0; c=0;

FocPos 5760
[12/01/20 19:56:52.120][DEBUG][Main Thread][AF;] Star list contains 24 stars…
[12/01/20 19:56:52.120][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:56:53.443][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 3.29 with 29 stars
[12/01/20 19:56:53.451][INFO][Camera Thread][AF;] Incremental Fit Result (2): quality=%; a=0; b=0; c=0;

FocPos 5720
[12/01/20 19:57:05.179][DEBUG][Main Thread][AF;] Star list contains 91 stars…
[12/01/20 19:57:05.179][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:57:06.410][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 2.30 with 58 stars
[12/01/20 19:57:06.419][INFO][Camera Thread][AF;] Incremental Fit Result (3): quality=%; a=0; b=0; c=0;

FocPos 5680
[12/01/20 19:57:17.092][DEBUG][Main Thread][AF;] Star list contains 76 stars…
[12/01/20 19:57:17.092][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:57:18.301][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 1.90 with 39 stars
[12/01/20 19:57:18.309][INFO][Camera Thread][AF;] Incremental Fit Result (4): quality=100%; a=154.687500000006; b=-1752.48750000007; c=4965.42950000019;

FocPos 5640
[12/01/20 19:57:29.167][DEBUG][Main Thread][AF;] Star list contains 82 stars…
[12/01/20 19:57:29.167][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:57:30.319][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 2.31 with 44 stars
[12/01/20 19:57:30.326][INFO][Camera Thread][AF;] Incremental Fit Result (5): quality=100%; a=187.053571428596;

FocPos 5600
[12/01/20 19:57:41.161][DEBUG][Main Thread][AF;] Star list contains 14 stars…
[12/01/20 19:57:41.161][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:57:42.351][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 3.38 with 10 stars
[12/01/20 19:57:42.360][INFO][Camera Thread][AF;] Incremental Fit Result (6): quality=100%; a=199.776785714333; b=-2270.42678571483; c=6452.72928571584;

FocPos 5580
[12/01/20 19:57:53.153][DEBUG][Main Thread][AF;] Star list contains 10 stars…
[12/01/20 19:57:53.153][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:57:54.337][DEBUG][Camera Thread][AF;] Auto focus HFD calculated at: 4.75 with 11 stars
[12/01/20 19:57:54.346][INFO][Camera Thread][AF;] Incremental Fit Result (7): quality=100%; a=191.369047619048; b=-2174.30952380952; c=6178.05857142857;

FocPos 5681 (Validation Frame)
[12/01/20 19:58:10.188][DEBUG][Main Thread][AF;] Star list contains 61 stars…
[12/01/20 19:58:10.188][DEBUG][Main Thread][AF;] Calculating HFR with sample size: 3
[12/01/20 19:58:11.398][DEBUG][Camera Thread][AF;] Auto focus validation frame HFD calculated at: 1.98 (N.B NO WITH #STARS?)
[12/01/20 19:58:11.402][INFO][Camera Thread][AF;] Auto focus is complete (5681; HFD 1.98)…

Conclusions

I was expecting the #star detections etc recorded in the SGP logfile to be very similar/identical to the ASTAP analysis made using the same image files, but the results (10-61 #stars) are about 50% less than the ASTAP analysis. This is particularly noticeable for the analysis of the AF image at focuser position 5680 (39 stars identified versus 112 on the ASTAP screenshot). I assume that this is due to some downsizing of the image prior to analysis in the SGP run leading, I guess, to some of the smallest stars being eliminated as hot pixels!!

Overall in this AF run, this difference in approach has not made a great deal of difference to the final recommended best focus position, i.e.

ASTAP analysis of original 2x2 binned FITS files using hyperblic curve fit, recommende focpos 5684

SGP/ASTAP HFD analysis of down sampled FITS images using parabolic fit, recommended focpos 5681.

I estimate that my one step on my focuser is circa 1.25 microns, so well within even a tight definition of CFZ.

Going Forward

Does anyone else have a view on this?

Does anyone have better handle on the pros and cons of the AF image downsampling (assuming I am correct in this?).