Does SGP talk to Planewave's PWI AutoFocus?

Here a spreadsheet analyse of some of Mike’s image series:

The resulting curves look better then the SGP curves but are still not ideal curves. Anyhow it looks good enough for field tests.

As an experiment I have added the focus position to the fits header of one series of Mike. Then the ASTAP inspector tab can measure the ideal focus, see red mark. This tab is intended to measure the curvature of your optical system:

Note the HFD values are a little different since it accepts stars brighter then SNR>10 rather then SNR>30:

Hi folks,

How can I attach an actual focus sequence from a Planewave CDK24? It may not contain measurable non-stellar objects, but it has few stars and includes the central obstruction.

The .zip file is about 16 MB.

KG

Hi,

See Han’s post 21. I used DropBox instead but it works the same.

@Han,

I think I’m missing something. I’ve

installed 0.9.441
inserted FocPos into a set of AF images
In Stack Menu, Analyse and order images works fine:

In Inspector Menu, Hyperbola Curve Fitting reports an error.

I am loading the image files separately into Stack and Inspector. Is this right?

Mike

PS: Can you recommend a good editor for FITS headers? I’ve been using F4W2HDU but it’s quite old design and rather clunky?

Mike, I think there are not enough stars detected. In images it detects as low as 5 stars for the whole image. So the inspector tab look for stars in the middle and the corners, so the 5 stars will be separated over the 5 areas. For the inspector tab you would need longer exposures such that it sees enough stars to analyse each area and try to conclude on the system curvature.

The modify the header you can just type the correction in the header displayed in the viewer and save the file. But is is easier to load the files in tab images and use the following popup menu to change/add keyword focuspos (I will add this option to the inspector tab later):

1 Like

I have added an -extract option to ASTAP. It will report the detected stars to a .csv file. I have also added an option to specify the minimum snr value required for detection. So

-analyse snr_minimum
-extract snr_minimum

The output file has the same name as the image but with extension .csv containing the following comma separated data:

csv_format

Download:
http://www.hnsky.org/astap_setup.exe

11:15 UTC Just corrected the output file X, Y coordinates with one pixel to be conform FITS coordinates.

1 Like

@Jared, @han

Hi Jared,

I don’t know what other feedback you’ve rceived but I’ve analysed some more of the AF Packs I have to hand and my conclusions are:

a) ASTAP star detection method is considerable more sensitive than current SGP (circa 5 times more stars detected)
b) As a result of more stars, I believe the median HFR calculation is generally more reliable than current SGP
c) By visual inspection, I consider that the AF HFR vs Foc Position is rather smoother using ASTAP median HFR result. This is not so noticeable on smoother curves (e.g using L filter) but more pronounced on STP curves with low star detections, typically RGB filters.
d) Using ASTAP CCD Inspector and Hyperbola curve fitting, it would seem that with my 80/480mm scope that current SGP AF is giving me a focus position that is outside of best focus by c3-10 steps, or around 12 - 40 microns.

In my opinion it would be good to see an SGP beta release offering ASTAP as an AF option for further comparison.

It would be good to see the FITS header for the AF images extended to include: Exposure, Binning, Date/Time, Filter and Temperature.

https://www.dropbox.com/s/fbujsveqkzcb6nf/SGP%20ASTAP%20AF%20v441.xlsx?dl=0

1 Like

Here’s a link if you would like to test. This is also a 64bit build so depending on your hardware it could be problematic. If you use all ASCOM things it should be good:

I would not use this for “production” things at the moment.

Jared

1 Like

Here’s a focus sequence from a CDK24 using a small star field at 2X magnification. There’s a zip file with the 8 captures, each individual capture, and the Planewave PWI3 focus results…

https://spaces.hightail.com/receive/A8pYnZBwwp

@Kurious_George,
Hi,

If understood your files correctly, PWI13 has given a result of 8969.2.

I guess you do not know what position current SGP would have given with these results but uploadng and analysing the image files with ASTAP’s Hyperbolic curve fitting gives a best focus position over the whole image of 8955 or 8985 for the centre region, see attached screen shot.

Mike

That’s good Mike. Now if some of those “donuts” were slightly fatter because they were actually a small galaxy, nebula or double star, would they have been ignored? That’s the problem I’ve been seeing.

KG

Interesting discussion here.

I did my own hyperbolic fitting of the data ASTAP outputs in your screen shot Mike, I took the hfd column which I assume is the full image HFD values(?). I got a very nice fit, the data is excellent, with a fitted min position of 8974. This is slightly different than the 8955 ASTAP fitted. You need to keep one thing in mind when you compare outputs of hyperbolic fitting. This is a so-called non-linear fitting problem, as opposed to a quadratic (parabola) fitting which is linear. Non-linear fitting problems are inherently none deterministic, meaning the estimated parameters will vary depending on the initial guesses one makes of those parameters, and the particular alhorithm that one uses. Two numerical fitting packages will generally output different results, given the same data.

I totally support going for hyperbolic fitting in SGP. I have already proposed to Ken and Jared to help them with the math, because there is a neat mathematical trick one can do to cast the problem into a quadratic fitting problem, and that code is already in place in SGP. It would be a very minor modification of the code Jerry wrote.

Mikael

image

1 Like

I would dearly love to say unequivocally that your concerns are unfounded but can you upload some AF images that you think might be problematic?

I’m not entirely sure about unresolved double stars but aside from these I’m doubtful that the type of detections you mention would likely happen in sufficient numbers to materially change the median HFR/HFD.

From eg Wikipedia I understand that approx 50% of visible stars are in fact doubles or multiple star systems . But for these to significant influence the AF curve it seems to me they would need to go through an (asymetric?) transformation unresolved - resolved - unresolved as the scope moves into and out of focus.

However to try to definitively answer your question, Han (see post 66) has kindly provided an option to output a list of values for the star detections made by ASTAP? I suggest ideally we need to show that a) unsuitable detections are occurring and b) these ‘false’ detections are causing the median hfd / hyperbolic curve to be majorly deformed.

Alternatively, as I’ve mentioned already, it seems to me (intellectually at least) to be not overly difficult to use a star catalogue to generate a star mask so as to hide potentially problematic objects from a plate-solved AF image. Sadly I doubt that I have the skills personally to take this idea forward.

Mike

Hi Mikael,

I much appreciate your interest.

I’ve subsequently noticed in my earlier spreadsheet that I had (I think twice) wrongly entered a different hfd value to the full image hfd. I can upload the corrected version if you wish but I doubt the corrections are material to the overall debate.

Of the comments I seen on the AF curve question the consensus seems to be that hyperbolic fit is the better approach. If the change is straightforward and Jared and Jerry are comfortable I see no reason not to proceed.

I’ve noticed that I was seeing different hfd values from different hfd calulations using ostensibly the same image data but had assumed this was due to marginally different hfd measurements taken from the original images.

Out of my comfort zone but I’ve read somewhere that the general hyperbolic curve function:

   y=mx / (k+x) 

: can be rearranged to an equivalent linear form that is readily solved. I had assumed that using the linear transformation could be used to iterate to a definitive result.

I assume that a required initial guestimate could be simply interpolated from say the three lowest hfd values / focusser steps?

I accept your assertion that there are mathematical tricks to ensure a robust result!

Mike

Original issue discussed and illustrated here in detail…

https://forum.sequencegeneratorpro.com/t/bullet-proof-auto-focus-with-platesolving/11834

I started this thread to see if we could interface with PWI3 to help resolve the original issue.

IMHO, we don’t have a curve fitting issue. The issue is not rejecting outliers mostly caused by double stars and small galaxies.

KG

Double stars can be separated or excluded if the detected combined star image is too oval.
Galaxies are normally in the minority and will have a very minor influence as long the median value is calculated. Elongated galaxies can be filtered out due to ovality. But excluding ovality can be counterproductive if tested too strict.

As long the majority of stars is good, the median HFD will give a good representative value.

I have the impression that for small (star) diameters in the image, the SGP star detection has a too large variation/spread in the measured HFD value then what technically is possible. As a result for a small set of stars, the calculated median HFD value will be less accurate.

Han

An other possibility would be to apply a sigma clip routine on the measured HFD values for each image. So you calculate the median or mean of the values and the standard deviation. Then remove outliers (double stars, galaxies) above 3 or 2.5 time standard deviation and with the remaining HFD values you calculate again the median or mean again and the standard deviation to repeat the same outlier filtering till the median/mean is stable.

I think in general the mean value will be less noisy, so it could be superior to median as long you have enough measurements. But the median has the beauty it still works well for three two or one measurement. For three measured values with one severely wrong it still will give a good value.

The practical problem is that the number of star detection’s in the wings of the V-curve can be small or even a single detection. Then you can’t apply statistics and you have to fall back to something more simple.

Statistics can help but it is more important to have a good HFD measurement.

Han

There is no doubt that accurate HFR/HFD calculations are important to producing an accurate auto focus result. However, In all this pursuit of precision focusing, let’s not overlook the issue of “depth of field.” There is no such thing as a single focuser position that represents best focus. There are many ways to calculate the DOF for an optical system. There are some that are specific to CCD sensors, which yield the smallest DOF values. For my f/6 (1830mm) system, the seeing limited DOF is about 100 microns. My focuser has 0.1 micron steps, so for my system, the DOF is +/- 500 steps! Positioning the focuser anywhere in that range will produce an image that is focused as well as possible. Something to keep in mind when debating the value of various curve fitting routines.

Charlie

This sigma clip logic may be a good alternative to a platesolving solution.

The weather forecast for tonight is currently showing clear skies though with a 98% moon, wind-speed of 15-20mph and jet-stream directly overhead, not good for imaging but hopefully good enough for some focusing tests.

My plan is to use GoldFocus (http://www.goldastro.com/) to obtain a near pin-point focus position for each of my LRGB&Ha filters, then to cycle through each of my filters with SGP and to record an AFPack and 60 second image for each. Hopefully weather conditions will hold out long enough to repeat this cycle at least twice.

Scope: 80/480 f/6
CCD: SV814M with 3.69 x 3.69 micron pixels
Focuser: c6000 steps per inch, equivalent to 4.2 microns per step.
SGP: v4.0.0.617
ASTAP: v0.9.444

For those not familiar with GoldFocus, it claims to be one of the most accurate focus aids around. It utilises a modified Bhatinov mask to capture and analyse an image as below.

I’m not sure that tonight’s conditions will permit getting to an accuracy of 0.3 pixel but at this level the GoldFocus calculator (GoldFocus - Calculator) indicates that with my scope and seeing of 3.0 arc-sec, I should be within 0.1 per cent margin of ideal focus, equivalent to a CFZ of 5.4 microns.

For the record, I normally use GoldFocus only occasionally in order to accurately measure my filter off-sets. Having gone to this level of effort however I feel it would be nice if SGP autofocus could regularly get to within 10-15 microns margin of error with L filter even if this is a rather spurious level of accuracy (ie trading accuracy of GoldFocus for speed and convenience of SGP AF).