Rerun focus when initial focus does not fail but cannot find best focus

Somewhere to ask questions about the best way to use SharpCap
Forum rules
‍

If you have a problem or question, please check the FAQ to see if it already has an answer : https://www.sharpcap.co.uk/sharpcap-faqs
Post Reply
yomamma
Posts: 105
Joined: Wed Mar 01, 2023 4:58 pm

Rerun focus when initial focus does not fail but cannot find best focus

#1

Post by yomamma »

I run my C11 at f10 on my CEM120 and get good results.

I have used Sharpcap for years now and my scripts will usually always run to the end so I get a good nights sleep.

My only problem is with focusing the C11 when seeing is about average or a little less. The seeing will jump around a bit and I will generally get a focus curve that works, but occasionally I will get an outlier or two on the curve created by a spate of bad seeing that will preclude the routine from finding the best focal point. When I get around to focusing again, in most cases, I never recover from the previous missed new focal point.

I have tried the sequence command ---Retry up to <Maximum Retry Count>--- but it looks as though not finding the focus does not raise an error.

What I have found is that I can usually get the focus to work on the second or third try even though I may get outliers they are not consistently severe enough to impact the final score.

Is it possible to have something like the ---Retry up to --- when the focus routine fails to find a new focal point? This would allow for at least a few more tries at it which in my case might allow the script to continue with good focus.

Thanks for considering
Gfischer
Posts: 320
Joined: Thu Jun 22, 2023 4:20 pm

Re: Rerun focus when initial focus does not fail but cannot find best focus

#2

Post by Gfischer »

I had the same issue. I changed to averaging 2 or 3 frames to help with poor seeing.
User avatar
admin
Site Admin
Posts: 17526
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Rerun focus when initial focus does not fail but cannot find best focus

#3

Post by admin »

Hi,

any chance you can find the SharpCap log from a run that failed in that way and didn't trigger the retry? Looking at the code, I would expect a failure to find the best focus point to fail that refocus step with an error and that to cause the retry. I see the retry happening when I test too, so I suspect that there may be some subtlety in the way it fails that is causing the issue.

cheers,

Robin

PS. Is your version of SharpCap up-to-date?
yomamma
Posts: 105
Joined: Wed Mar 01, 2023 4:58 pm

Re: Rerun focus when initial focus does not fail but cannot find best focus

#4

Post by yomamma »

Hey Robin,

I will go back and see if I can find a log with the failure . This happened just the other night and I looked to see if it retried and I could not find where it did but I only gave it a cursory look. I will get back.

Thanks
User avatar
admin
Site Admin
Posts: 17526
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Rerun focus when initial focus does not fail but cannot find best focus

#5

Post by admin »

Hi,

just to make it easier to check, if the retry is happening you will find lines like this in the log

Code: Select all

Debug  	14:54:47.892159	#1 	Sequencer : Info      : 'Ignoring error (about to retry) : SharpCap did not find a best focus position in the range 24400 to 25600' while running step Refocus using the same settings as the most recently used autofocus run					in void SharpCap.Sequencer.SequencerContext.Info(string message)
Debug  	14:54:47.893864	#1 	Sequencer : Info      : 'Retry #1 of 1' while running step Refocus using the same settings as the most recently used autofocus run					in void SharpCap.Sequencer.SequencerContext.Info(string message)
those will appear between the first failuer and the retry, and then again between subsequent retries if you allowed more than one.

cheers,

Robin
Post Reply