Skip to content

Commit fc207de

Browse files
committed
Automatically increase the collimation detection window
1 parent c4cc4ad commit fc207de

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/pu_main.pas

+12-2
Original file line numberDiff line numberDiff line change
@@ -10424,7 +10424,7 @@ procedure Tf_main.cmdAutofocus(var ok: boolean);
1042410424
end;
1042510425

1042610426
Procedure Tf_main.DoAutoFocus;
10427-
var c,dx,dy,vmax: double;
10427+
var c,dx,dy,vmax,dm: double;
1042810428
sx,sy,sw: integer;
1042910429
begin
1043010430
if (fits.HeaderInfo.valid)and(Preview or Capture) then begin // not on control exposure
@@ -10441,8 +10441,18 @@ procedure Tf_main.cmdAutofocus(var ok: boolean);
1044110441
// try to re-acquire star in full window
1044210442
sw:=starwindow div (2*fits.HeaderInfo.BinX);
1044310443
fits.FindBrightestPixel(round(c),round(c),round(2*c)-sw,sw,sx,sy,vmax);
10444-
if vmax>0 then
10444+
if vmax>0 then begin
1044510445
f_starprofile.showprofile(fits,sx,sy,Starwindow div fits.HeaderInfo.BinX,fits.HeaderInfo.focallen,fits.HeaderInfo.pixsz1);
10446+
if Collimation and (not f_starprofile.FindStar) then begin
10447+
// for collimation, automatically increase the detection window
10448+
dm:=((Focuswindow/2)-Starwindow)/3;
10449+
sw:=round(Starwindow+dm);
10450+
repeat
10451+
f_starprofile.showprofile(fits,sx,sy,sw div fits.HeaderInfo.BinX,fits.HeaderInfo.focallen,fits.HeaderInfo.pixsz1);
10452+
sw:=round(sw+dm);
10453+
until f_starprofile.FindStar or (sw>(Focuswindow/2));
10454+
end;
10455+
end;
1044610456
end;
1044710457
// recenter star
1044810458
sx:=StrToIntDef(f_frame.FX.Text,-1);

0 commit comments

Comments
 (0)