summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-17 10:41:53 (GMT)
committerJasem Mutlaq <mutlaqja@ikarustech.com>2016-08-17 10:41:53 (GMT)
commit9842e1be25d22e6f654b27fa49f66657f0bccd6f (patch)
tree9df09d7a07728049a4154e018774319b20aa34c1
parentfe67b8e5c265aa2a4eec4a8a85fee58d219fed35 (diff)
HFR calculation more stable now and works OK under simulation, need to test it today under real conditions
-rw-r--r--kstars/fitsviewer/fitsdata.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/kstars/fitsviewer/fitsdata.cpp b/kstars/fitsviewer/fitsdata.cpp
index 1ab2f97..84bd5d1 100644
--- a/kstars/fitsviewer/fitsdata.cpp
+++ b/kstars/fitsviewer/fitsdata.cpp
@@ -563,7 +563,7 @@ int FITSData::findOneStar(const QRectF &boundary)
float massX=0, massY=0, totalMass=0;
- double threshold = stats.median[0] + stats.stddev[0];
+ double threshold = stats.mean[0] * 1.40;
for (int y=subY; y < subH; y++)
{
@@ -572,6 +572,7 @@ int FITSData::findOneStar(const QRectF &boundary)
float pixel = image_buffer[x+y*stats.width];
if (pixel > threshold)
{
+ //pixel *= pow(1000, pixel/stats.max[0]);
totalMass += pixel;
massX += x * pixel;
massY += y * pixel;
@@ -616,7 +617,7 @@ int FITSData::findOneStar(const QRectF &boundary)
}
qDebug() << "Testing for radius " << r << " passes # " << pass << " @ threshold " << running_threshold;
- if (pass >= 9)
+ if (pass >= 6)
{
center->width = r*2;
break;
@@ -634,8 +635,8 @@ int FITSData::findOneStar(const QRectF &boundary)
if (center->width == -1)
return 0;
- // 10% fuzzy
- //center->width += center->width*0.1 * (running_threshold / threshold);
+ // 30% fuzzy
+ //center->width += center->width*0.3 * (running_threshold / threshold);
starCenters.append(center);
@@ -805,8 +806,8 @@ void FITSData::findCentroid(const QRectF &boundary, int initStdDev, int minEdgeW
else
{
// Only find a single star within the boundary
- //findOneStar(boundary);
- //return;
+ findOneStar(boundary);
+ return;
subX = boundary.x();
subY = boundary.y();