Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
KStars
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
29
Issues
29
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Education
KStars
Commits
88b8c408
Commit
88b8c408
authored
May 29, 2017
by
Jasem Mutlaq
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Possible solution to polynomial fitting getting stuck at a particular exposure.
parent
2497d032
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
kstars/ekos/capture/capture.cpp
kstars/ekos/capture/capture.cpp
+13
-2
No files found.
kstars/ekos/capture/capture.cpp
View file @
88b8c408
...
...
@@ -1607,7 +1607,7 @@ void Capture::setExposureProgress(ISD::CCDChip * tChip, double value, IPState st
return
;
}
qDebug
()
<<
"Exposure with value "
<<
value
;
//
qDebug() << "Exposure with value " << value;
if
(
state
==
IPS_OK
)
{
...
...
@@ -3577,6 +3577,7 @@ double Capture::setCurrentADU(double value)
if
(
ExpRaw
.
count
()
>=
2
)
{
double
chisq
=
0
;
if
(
ExpRaw
.
count
()
>=
4
)
{
coeff
=
gsl_polynomial_fit
(
ADURaw
.
data
(),
ExpRaw
.
data
(),
ExpRaw
.
count
(),
2
,
chisq
);
...
...
@@ -3588,10 +3589,20 @@ double Capture::setCurrentADU(double value)
}
}
bool
looping
=
false
;
if
(
ExpRaw
.
count
()
>=
10
)
{
int
size
=
ExpRaw
.
count
();
looping
=
(
ExpRaw
[
size
-
1
]
==
ExpRaw
[
size
-
2
])
&&
(
ExpRaw
[
size
-
2
]
==
ExpRaw
[
size
-
3
]);
if
(
looping
)
qDebug
()
<<
"Capture: Detected looping in polynomial results. Falling back to llsqr."
;
}
// If we get invalid data, let's fall back to llsq
// Since polyfit can be unreliable at low counts, let's only use it at the 4th exposure
// if we don't have results already.
if
(
ExpRaw
.
count
()
<
4
||
std
::
isnan
(
coeff
[
0
])
||
std
::
isinf
(
coeff
[
0
]))
if
(
looping
||
ExpRaw
.
count
()
<
4
||
std
::
isnan
(
coeff
[
0
])
||
std
::
isinf
(
coeff
[
0
]))
{
double
a
=
0
,
b
=
0
;
llsq
(
ExpRaw
,
ADURaw
,
a
,
b
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment