36 CurveFitting *curveFitting;
44 int minPositionAllowed;
46 int maxPositionAllowed;
50 double focusTolerance;
56 double initialOutwardSteps;
60 Focus::Algorithm focusAlgorithm;
65 CurveFitting::CurveFit curveFit;
69 Focus::StarMeasure starMeasure;
71 Focus::StarPSF starPSF;
75 Focus::FocusWalk focusWalk;
79 double outlierRejection;
81 CurveFitting::OptimisationDirection optimisationDirection;
83 Mathematics::RobustStatistics::ScaleCalculation scaleCalculation;
85 FocusParams(CurveFitting *_curveFitting,
int _maxTravel,
int _initialStepSize,
int _startPosition,
86 int _minPositionAllowed,
int _maxPositionAllowed,
int _maxIterations,
87 double _focusTolerance,
const QString &filterName_,
double _temperature,
88 double _initialOutwardSteps,
int _numSteps, Focus::Algorithm _focusAlgorithm,
int _backlash,
89 CurveFitting::CurveFit _curveFit,
bool _useWeights, Focus::StarMeasure _starMeasure,
90 Focus::StarPSF _starPSF,
bool _refineCurveFit, Focus::FocusWalk _focusWalk,
bool _donutBuster,
91 double _outlierRejection, CurveFitting::OptimisationDirection _optimisationDirection,
92 Mathematics::RobustStatistics::ScaleCalculation _scaleCalculation) :
93 curveFitting(_curveFitting), maxTravel(_maxTravel), initialStepSize(_initialStepSize),
94 startPosition(_startPosition), minPositionAllowed(_minPositionAllowed),
95 maxPositionAllowed(_maxPositionAllowed), maxIterations(_maxIterations),
96 focusTolerance(_focusTolerance), filterName(filterName_),
97 temperature(_temperature), initialOutwardSteps(_initialOutwardSteps), numSteps(_numSteps),
98 focusAlgorithm(_focusAlgorithm), backlash(_backlash), curveFit(_curveFit),
99 useWeights(_useWeights), starMeasure(_starMeasure), starPSF(_starPSF),
100 refineCurveFit(_refineCurveFit), focusWalk(_focusWalk), donutBuster(_donutBuster),
101 outlierRejection(_outlierRejection), optimisationDirection(_optimisationDirection),
102 scaleCalculation(_scaleCalculation) {}
109 if (params.curveFitting ==
nullptr)
110 params.curveFitting =
new CurveFitting();
117 virtual int initialPosition() = 0;
122 virtual int newMeasurement(
int position,
double value,
const double starWeight,
const QList<Edge*> *stars =
nullptr) = 0;
134 return focusSolution;
139 double solutionValue()
const
146 double solutionWeight()
const
158 AutofocusFailReason getFailCode()
const
164 const FocusParams &getParams()
const
169 virtual double latestValue()
const = 0;
175 virtual QString getTextStatus(
double R2 = 0)
const = 0;
178 virtual bool isInFirstPass()
const = 0;
181 virtual int currentStep()
const = 0;
189 int focusSolution = -1;
190 double focusValue = -1;
191 double focusWeight = -1;
193 AutofocusFailReason failCode = Ekos::FOCUS_FAIL_NONE;