[education/kstars] /: Correct nomenclature for Linear1 focus algorithm with "R2" -> "R²", and add a default and minimum value for R² limit

Jasem Mutlaq null at kde.org
Mon Jul 25 05:19:15 BST 2022


Git commit e34a731041d8beb013f71787ee3430736311157d by Jasem Mutlaq, on behalf of Sophie Taylor.
Committed on 25/07/2022 at 04:19.
Pushed by mutlaqja into branch 'master'.

Correct nomenclature for Linear1 focus algorithm with "R2" -> "R²", and add a default and minimum value for R² limit

M  +13   -13   doc/ekos-focus.docbook
M  +8    -2    kstars/ekos/focus/focus.ui
M  +1    -1    kstars/ekos/focus/focusalgorithms.cpp

https://invent.kde.org/education/kstars/commit/e34a731041d8beb013f71787ee3430736311157d

diff --git a/doc/ekos-focus.docbook b/doc/ekos-focus.docbook
index 6e0ba2c2b..a93ed92ba 100644
--- a/doc/ekos-focus.docbook
+++ b/doc/ekos-focus.docbook
@@ -490,16 +490,16 @@
       </listitem>
 
       <listitem>
-        <para> <guilabel>R2 Limit</guilabel>: This is an experimental option
+        <para> <guilabel>R² Limit</guilabel>: This is an experimental option
         only available with the Linear 1 Pass focus algorithm and Curve Types
         of Hyperbola and Parabola. As part of the Linear 1 Pass algorithm, the
         degree to which the curve fits the datapoints, or <link
         linkend="Coefficient_of_Determination">Coefficient of Determination,
-        R2</link>, is calculated. This option allows a minimum acceptable value
-        of R2 to be defined that is compared to the value obtained from the
+        R²</link>, is calculated. This option allows a minimum acceptable value
+        of R² to be defined that is compared to the value obtained from the
         curve fitting process. If the minimum value has not been achieved then
         Autofocus will rerun. Only one rerun will be performed and even if the
-        minimum R2 has not been met the second time, the Autofocus run will
+        minimum R² has not been met the second time, the Autofocus run will
         still be deemed successful.</para>
 
         <para> Experiment to find an appropriate value but a good starting
@@ -1151,34 +1151,34 @@
   </sect3>
 
   <sect3 id="Coefficient_of_Determination">
-    <title>Coefficient of Determination, R2</title>
+    <title>Coefficient of Determination, R²</title>
 
-    <para> The Coefficient of Determination, or R2, is calculated in order to
+    <para> The Coefficient of Determination, or R², is calculated in order to
     give a measure of how well the fitted curve matches the datapoints. More
     information is available <ulink
     url="https://en.wikipedia.org/wiki/Coefficient_of_determination">here</ulink>.
     This is an experimental feature that is available for the Linear 1 Pass
-    focus algorithm. In essence, R2 gives a value between 0 and 1, with 1
+    focus algorithm. In essence, R² gives a value between 0 and 1, with 1
     meaning a perfect fit where all datapoints sit on the curve, and 0 meaning
     that there is no correlation between the datapoints and the curve. The
     user should experiment with their equipment to see what values they can
     obtain, but as a guide, a value above, say 0.8 would be a good fit.</para>
 
-    <para> There is an option to set an “R2 Limit” in the Settings tab of the
-    Focus window that is compared to the calculated R2 after the auto focu run
+    <para> There is an option to set an “R² Limit” in the Settings tab of the
+    Focus window that is compared to the calculated R² after the auto focu run
     has completed. If the limit value has not been achieved, then the auto
     focus is rerun.</para>
 
-    <para> Setting an R2 Limit could be useful for unattended observation if
+    <para> Setting an R² Limit could be useful for unattended observation if
     the focus run produces a bad result for a 1-off reason. Obviously if the
     reason is not transitory then rerunning will not improve anything.</para>
 
-    <para> If the R2 Limit is not achieved and the focus process is rerun, and
-    again fails to achieve the R2 Limit, then the focus run is marked as
+    <para> If the R² Limit is not achieved and the focus process is rerun, and
+    again fails to achieve the R² Limit, then the focus run is marked as
     successful to avoid the process getting stuck rerunning auto focus
     forever.</para>
 
-    <para> This feature is turned off by setting the R2 Limit to 0.</para>
+    <para> This feature is turned off by setting the R² Limit to 0.</para>
   </sect3>
 
   <sect3 id="Levenberg-Marquardt">
diff --git a/kstars/ekos/focus/focus.ui b/kstars/ekos/focus/focus.ui
index 48f417495..d72e3ee5c 100644
--- a/kstars/ekos/focus/focus.ui
+++ b/kstars/ekos/focus/focus.ui
@@ -1136,7 +1136,7 @@
              <item row="4" column="1">
               <widget class="QLabel" name="label_32">
                <property name="text">
-                <string>R2 Limit:</string>
+                <string>R² Limit:</string>
                </property>
                <property name="alignment">
                 <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
@@ -1152,11 +1152,17 @@
                 </sizepolicy>
                </property>
                <property name="toolTip">
-                <string><html><head/><body><p>Set a minimum for the acceptable R2 when performing an Auto Focus run. If the minimum is not met, Auto Focus will rerun once to try to improve the R2. Currently only available for the Linear 1 Pass algorithm when using a Curve Fit of Hyperbola or Parabola. This feature is experimental.</p></body></html></string>
+                <string><html><head/><body><p>Set a minimum for the acceptable R² when performing an Auto Focus run. If the minimum is not met, Auto Focus will rerun once to try to improve the R². Currently only available for the Linear 1 Pass algorithm when using a Curve Fit of Hyperbola or Parabola. This feature is experimental.</p></body></html></string>
+               </property>
+               <property name="minimum">
+                <double>0.000000000000000</double>
                </property>
                <property name="maximum">
                 <double>1.000000000000000</double>
                </property>
+              <property name="value">
+                <number>0.9</number>
+               </property>
                <property name="singleStep">
                 <double>0.010000000000000</double>
                </property>
diff --git a/kstars/ekos/focus/focusalgorithms.cpp b/kstars/ekos/focus/focusalgorithms.cpp
index 6f63a518b..bb8ccb2e5 100644
--- a/kstars/ekos/focus/focusalgorithms.cpp
+++ b/kstars/ekos/focus/focusalgorithms.cpp
@@ -243,7 +243,7 @@ QString LinearFocusAlgorithm::getTextStatus(double R2) const
                     return text.append(" Solution: %1").arg(focusSolution);
                 else
                     // Add R2 to 2 decimal places. Round down to be conservative
-                    return text.append(" Solution: %1, R2=%2").arg(focusSolution).arg(trunc(R2 * 100.0) / 100.0, 0, 'f', 2);
+                    return text.append(" Solution: %1, R²=%2").arg(focusSolution).arg(trunc(R2 * 100.0) / 100.0, 0, 'f', 2);
             }
             else
                 return text.append(" Failed");


More information about the kde-doc-english mailing list