Jump to content

  •  

CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.

Photo

Binning 4x4 for autofocus in SGP

  • Please log in to reply
19 replies to this topic

#1 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 01:42 AM

Just what the title says. I was using unbinned images to autofocus and was getting unreliable results, not to mention the long time durations for autofocus routines. I increased the step size following SGP help file. I changed binning for autofocus frames to 4x4 just to make it fast. . Earlier, my autofocus curves were shallow and zigzag like leading to failing of autofocus. Here's the comparison of autofocus curves  :
ABOVE ---- Step size = 30 ; Bin = 1x1
BELOW ------ Step size = 125; Bin = 4x4
GRAPH_AFID-003_POS-17545_HFR-000_Q-97_FINAL.jpg

GRAPH_AFID-006_POS-17296_HFR-127_Q-98_FINAL.jpg


So the final question : Is using 4x4 binning reliable in terms of quality/accuracy of focus ? Or should I just stick to 2x2 binning recommended in SGP help file?


  • Jon Rista likes this

#2 Jon Rista

Jon Rista

    ISS

  • *****
  • Posts: 24,324
  • Joined: 10 Jan 2014
  • Loc: Colorado

Posted 28 May 2020 - 01:47 AM

You tested 1x1 and 4x4. What does a 2x2 run look like?



#3 freestar8n

freestar8n

    Vendor - MetaGuide

  • *****
  • Vendors
  • Posts: 9,622
  • Joined: 12 Oct 2007

Posted 28 May 2020 - 03:37 AM

I believe the main difference in the curves is simply the step size.

 

Binning will speed up the process - but the shape of the curve is largely set by step size.

 

I would try bin x2 and the step size you used for your bin x4 run.

 

If the sgp help file suggested increasing step size based on binning - well I'm not sure that's a good idea.

 

Frank



#4 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 03:43 AM

You tested 1x1 and 4x4. What does a 2x2 run look like?

 I'll try that the next time I setup.



#5 freestar8n

freestar8n

    Vendor - MetaGuide

  • *****
  • Vendors
  • Posts: 9,622
  • Joined: 12 Oct 2007

Posted 28 May 2020 - 03:50 AM

 I'll try that the next time I setup.

If you leave the step size as in 1x1 - it will likely look much like the 1x1 plot - but take less time to acquire.

 

The x-axis is focus position;  The y-axis is star size. 

 

Going farther from focus in the curve due to a larger step size will cause a big change in star size, independent of binning.

 

Frank


  • IshanAstronomer likes this

#6 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 03:51 AM

I believe the main difference in the curves is simply the step size.

 

Binning will speed up the process - but the shape of the curve is largely set by step size.

 

I would try bin x2 and the step size you used for your bin x4 run.

 

If the sgp help file suggested increasing step size based on binning - well I'm not sure that's a good idea.

 

Frank

No the sgp help file didn't suggest changing step size based on binning. I was just looking at my autofocus settings trying to find if something was wrong and I noticed bin1x1 setting. I had the idea that large step size does lead to deep curves. Just wasn't sure. So thanks for clarification.

I will try bin 2x2 next time. Meanwhile, am I (theoretically) trading accuracy for speed using a higher binning ? In other words, is there a drawback of using a higher binning for focus?



#7 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 03:54 AM

If you leave the step size as in 1x1 - it will likely look much like the 1x1 plot - but take less time to acquire.

 

The x-axis is focus position;  The y-axis is star size. 

 

Going farther from focus in the curve due to a larger step size will cause a big change in star size, independent of binning.

 

Frank

So, autofocus accuracy should be the same irrespective of binning?



#8 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 04:07 AM

As a part of a discussion I found on the SGP forum, Ken (developer of SGP) writes the following :

"Running AF at 4x4 will reduce resolution so significantly that results of AF are not reliable."

It will be interesting to test this.
 



#9 freestar8n

freestar8n

    Vendor - MetaGuide

  • *****
  • Vendors
  • Posts: 9,622
  • Joined: 12 Oct 2007

Posted 28 May 2020 - 04:10 AM

So, autofocus accuracy should be the same irrespective of binning?

Small pixels may give a better idea of the fwhm at each step - but if they are small enough it won't matter.

 

As a general rule for a situation where the image is well sampled already and you want autofocus to go fast - I would use bin x2.

 

If you use a given binning and the curve looks fine but takes a lot of time - I would bin more.

 

If you know the image is already undersampled then it might be good not to bin.  But you can compare bin x1 to bin x2 in terms of how the curve looks and how much time it takes.

 

The curve should be a nice parabola with a well defined central axis.  Some noise is ok - but if it is hard to fit to parabola then I would work on the focus parameters.

 

Frank


  • IshanAstronomer likes this

#10 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 04:59 AM

Small pixels may give a better idea of the fwhm at each step - but if they are small enough it won't matter.

 

As a general rule for a situation where the image is well sampled already and you want autofocus to go fast - I would use bin x2.

 

If you use a given binning and the curve looks fine but takes a lot of time - I would bin more.

 

If you know the image is already undersampled then it might be good not to bin.  But you can compare bin x1 to bin x2 in terms of how the curve looks and how much time it takes.

 

The curve should be a nice parabola with a well defined central axis.  Some noise is ok - but if it is hard to fit to parabola then I would work on the focus parameters.

 

Frank

The image scale of my setup is 1.2"/px which I think is not undersampled at my location. So I guess I could try some binning.
 



#11 ChrisWhite

ChrisWhite

    Fly Me to the Moon

  • *****
  • Posts: 5,855
  • Joined: 28 Feb 2015
  • Loc: Colchester, VT

Posted 28 May 2020 - 05:22 AM

Dont forget that the curve is created by the algorithm first recognizing stars and then measuring.  While step size is important for pushing the focus out far enough at the extremes to genreate a nice u or v shaped curve, you must have stars being measured for the analysis and compilation of that data. 

 

If you are binning 1x1 and your exposures are too short, you may not be recognizing enough stars in the routine despite the step size being optimal.  Make sure that with 1x1 binning your exposures are LONG enough.  When binning 2x2 or 3x3 or 4x4 you can use shorter exposures, but at 1x1 you will need long enough exposures. 

 

Also, I would like to point out that looking at both of your graphs, your step size looks insufficient.  I have found that I get best results when I use a step size such that the extremes of the HFR measurement are between 8 and 11.  You are barely breaking 3 HFR.   Increasing your step size will also improve the reliability of the routine should you be starting from a point of slightly more out of focus.

 

I think you need to increase your step size, and if you will be using bin 1x1 you need to lengthen your exposures.   Personally, I bin at 2x2 for autofocus as I get a nice balance between wasting time in the exposure and download as well as extremely accurate results. 


Edited by ChrisWhite, 28 May 2020 - 05:23 AM.

  • IshanAstronomer likes this

#12 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 28 May 2020 - 06:04 AM

Dont forget that the curve is created by the algorithm first recognizing stars and then measuring.  While step size is important for pushing the focus out far enough at the extremes to genreate a nice u or v shaped curve, you must have stars being measured for the analysis and compilation of that data. 

 

If you are binning 1x1 and your exposures are too short, you may not be recognizing enough stars in the routine despite the step size being optimal.  Make sure that with 1x1 binning your exposures are LONG enough.  When binning 2x2 or 3x3 or 4x4 you can use shorter exposures, but at 1x1 you will need long enough exposures. 

 

Also, I would like to point out that looking at both of your graphs, your step size looks insufficient.  I have found that I get best results when I use a step size such that the extremes of the HFR measurement are between 8 and 11.  You are barely breaking 3 HFR.   Increasing your step size will also improve the reliability of the routine should you be starting from a point of slightly more out of focus.

 

I think you need to increase your step size, and if you will be using bin 1x1 you need to lengthen your exposures.   Personally, I bin at 2x2 for autofocus as I get a nice balance between wasting time in the exposure and download as well as extremely accurate results. 

Thanks Chris. At present, I use exposure of 3s for LRGB and 7s for Ha. I am wary of using longer exposures as it would eat into the imaging time.

I am quite surprised you could go to HFR of 8. I read it in the SGP help file that autofocus wont work if its completely out of focus. At HFR of about 4, the stars in my images all but disappear. Also, I was just following the advice in help file that says:

"While this is happening (looping frames are captured) begin to move your focuser outward until the HFR reading is ~3-5x greater than your "at-focus" HFR that you noted earlier."

Subtract the "in-focus" focuser position from the new (current) focuser position.  Multiply this number by 2, divide it by the number of "Auto Focus Data Points" minus 1 and you now have a good "Step Size".


I did just that. Here are my measurements. Note that my focuser is reverse so it moves inwards as it focuses.
0.8 at 17515 [In-focus]
0.97 at 17485
1.14 at 17455
1.19 at 17425
1.35 at 17395
1.59 at 17305
1.94 at 17245
2.18 at 17185
2.49 at 17125
2.8 at 17065 [ ~4 x lowest HFR ]


Is something wrong with these measurements? Please point out if it is. I have really enjoyed being imaging with SGP. Meridian flips and all the automation. Except the downtime in downloading images & dithering.



#13 ChrisWhite

ChrisWhite

    Fly Me to the Moon

  • *****
  • Posts: 5,855
  • Joined: 28 Feb 2015
  • Loc: Colchester, VT

Posted 28 May 2020 - 06:10 AM

Well, with 3 second exposures (I use 10) you're guaranteed to have a tiny hfr when you are in focus and stars will dissappear when out of focus.   Way too short of an exposure!

Yes, your exposures are too short and your step size is too small.

Of course you can do what you want and you don't need to increase your exposure length or your step size, but I think you will get better results if you do.

The extra 4 minutes a night (if you af 4 times) wasted on autofocusing won't be missed when your data is in better focus.

I use 10 second for lrgb and I use 15 to 20 second for narrowband binned 2x2.

On my at92 at f3.6 I use 5 second exposures and 10 second respectively.. but that thing sucks down photons.


Edited by ChrisWhite, 28 May 2020 - 08:15 AM.

  • pfile and IshanAstronomer like this

#14 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 29 May 2020 - 12:30 AM

Thank you once again Chris.

Now that you mention, it makes sense why I lose stars altogether if focus drifted off. My thinking was that to reduce the effect of mount tracking errors or winds, I should keep autofocus exposures short (just to get about 50 or so stars in the field).

But in quest of better result,  I will definitely give longer exposures a try. Who doesn't like crisp dust lanes of a galaxy? I hope the incoming storm and the clouds pass through soon. Waiting for the next time to setup.



#15 freestar8n

freestar8n

    Vendor - MetaGuide

  • *****
  • Vendors
  • Posts: 9,622
  • Joined: 12 Oct 2007

Posted 29 May 2020 - 05:58 AM

The shape of the curve in the second image is perfectly fine for determining focus and there is no need to go wider.

 

The step size used there and the number of steps looks good regardless of binning - as long as the software can detect the stars at that size and at that binning.

 

If you try that bin x4 curve at bin x2 and you find it is losing the ability to detect and measure stars - then I would increase the exposure.  But my guess is that it will be ok.  If not - increase the exposure - but a close view of the parabola is fine for determining focus as long as the flat part of the parabola is fairly central.

 

Frank


  • IshanAstronomer likes this

#16 ChrisWhite

ChrisWhite

    Fly Me to the Moon

  • *****
  • Posts: 5,855
  • Joined: 28 Feb 2015
  • Loc: Colchester, VT

Posted 29 May 2020 - 06:04 AM

The shape of the curve in the second image is perfectly fine for determining focus and there is no need to go wider.

The step size used there and the number of steps looks good regardless of binning - as long as the software can detect the stars at that size and at that binning.

If you try that bin x4 curve at bin x2 and you find it is losing the ability to detect and measure stars - then I would increase the exposure. But my guess is that it will be ok. If not - increase the exposure - but a close view of the parabola is fine for determining focus as long as the flat part of the parabola is fairly central.

Frank


Mostly agree. If the scope is for some reason just a little bit out of focus when the routine starts, the step size will likely be too small to successfully autofocus.
  • IshanAstronomer likes this

#17 IshanAstronomer

IshanAstronomer

    Mariner 2

  • -----
  • topic starter
  • Posts: 212
  • Joined: 26 Dec 2011

Posted 29 May 2020 - 06:32 AM

The shape of the curve in the second image is perfectly fine for determining focus and there is no need to go wider.

 

The step size used there and the number of steps looks good regardless of binning - as long as the software can detect the stars at that size and at that binning.

 

If you try that bin x4 curve at bin x2 and you find it is losing the ability to detect and measure stars - then I would increase the exposure.  But my guess is that it will be ok.  If not - increase the exposure - but a close view of the parabola is fine for determining focus as long as the flat part of the parabola is fairly central.

 

Frank

 

 

Mostly agree. If the scope is for some reason just a little bit out of focus when the routine starts, the step size will likely be too small to successfully autofocus.

Great points !! There's so much I'm learning from this topic I made. All thanks to knowledgeable friends like both of you.
 



#18 Mika76

Mika76

    Lift Off

  • -----
  • Posts: 5
  • Joined: 10 Sep 2017

Posted 29 May 2020 - 12:03 PM

With the new quadratic fitting routine that SGP uses, we do not advice people to use a too wide focus range as the quadratic function is only a valid approximation closer to the focus point. Most people get optimal result going out to a HFR value that is about 3x your best focus. So in the 4x4 bin curve you posted in the beginning, that would mean an HFR of about 4.5 at the edges, so you could extend your range a bit further. If you go much beyond this range you will likely get a les optimal result. Here is an example of a user that got bad results going a bit too wide: http://forum.mainseq...ge-shifts/12054. There are more examples like that on the SGP forum.

And I dont think the SGP manual has been updated yet on this point.

 

Looks to me that you are really close to optimum with your step size, you just need to figure out what is the best combination of binning and exposure time for your setup. 

 

Good luck! Mikael


  • IshanAstronomer likes this

#19 ChrisWhite

ChrisWhite

    Fly Me to the Moon

  • *****
  • Posts: 5,855
  • Joined: 28 Feb 2015
  • Loc: Colchester, VT

Posted 29 May 2020 - 12:39 PM

With the new quadratic fitting routine that SGP uses, we do not advice people to use a too wide focus range as the quadratic function is only a valid approximation closer to the focus point. Most people get optimal result going out to a HFR value that is about 3x your best focus. So in the 4x4 bin curve you posted in the beginning, that would mean an HFR of about 4.5 at the edges, so you could extend your range a bit further. If you go much beyond this range you will likely get a les optimal result. Here is an example of a user that got bad results going a bit too wide: http://forum.mainseq...ge-shifts/12054. There are more examples like that on the SGP forum.

And I dont think the SGP manual has been updated yet on this point.

 

Looks to me that you are really close to optimum with your step size, you just need to figure out what is the best combination of binning and exposure time for your setup. 

 

Good luck! Mikael

I think the reason that the optimal value is so low for the OP is that exposure length is so short....



#20 pfile

pfile

    Fly Me to the Moon

  • -----
  • Posts: 5,551
  • Joined: 14 Jun 2009

Posted 29 May 2020 - 03:11 PM


I use 10 second for lrgb and I use 15 to 20 second for narrowband binned 2x2.

 

same here, f/5.5 refractor, 5mn narrowband and 8300M. works very well for me especially since the new quadratic fit algorithm appeared.

 

rob




CNers have asked about a donation box for Cloudy Nights over the years, so here you go. Donation is not required by any means, so please enjoy your stay.


Recent Topics






Cloudy Nights LLC
Cloudy Nights Sponsor: Astronomics