Calculate correct FWHM statistic and draw circles at 1/20 of max

This commit is contained in:
2019-10-11 21:00:14 +02:00
parent 9dacf62226
commit 485697a0b2
3 changed files with 52 additions and 1 deletions
+7 -1
View File
@@ -49,7 +49,7 @@ void drawStars(QImage &img, const std::vector<Star> &stars)
painter.setPen(Qt::red);
for(auto star : stars)
{
painter.drawEllipse(QPointF(star.m_x, star.m_y), star.m_sx, star.m_sy);
painter.drawEllipse(QPointF(star.m_x, star.m_y), star.hw20X(), star.hw20Y());
}
img = pix.toImage();
}
@@ -319,6 +319,8 @@ void LoadRunable::run()
if(m_analyzeLevel>= Stars)
{
double fwhmX = 0;
double fwhmY = 0;
const int radius = 13;
StarFit starFit(radius);
std::vector<Star> stars;
@@ -335,10 +337,14 @@ void LoadRunable::run()
//printStarModel(radius, r, star);
star.m_x += x;
star.m_y += y;
fwhmX += star.fwhmX();
fwhmY += star.fwhmY();
stars.push_back(star);
}
}
drawStars(img, stars);
info.append(StringPair(QObject::tr("FWHM X"), QString::number(fwhmX/stars.size())));
info.append(StringPair(QObject::tr("FWHM Y"), QString::number(fwhmY/stars.size())));
}
qDebug() << "Star fit" << timer.restart();
}