Kstars

focusstars.h
1/*
2 SPDX-FileCopyrightText: 2021 Hy Murveit <hy-1@murveit.com>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include <QList>
10#include "../fitsviewer/fitsstardetector.h"
11
12namespace Ekos
13{
14
15// This class helps compare HFRs computed from two images. The issue is that the two images
16// may have different stars detected, and thus when comparing HFRs one may have smaller
17// stars than the other, and be at an advantage wrt HFR computation.
18// If we only use stars that the two star lists have in common, then comparisons are more fair.
19
20// FocusStars is a object with a set of stars: star x,y positions and the computed HFRs for each star.
21// getHFR() computes an overall HFR value using all stars in the FocusStars object.
22// FocusStars.commonHFR(focusStars2, hfr1, hfr2) computes HFRs only using stars in common
23// with focusStars2.
24// FocusStars.relativeHFR(focusStars2, givenHFRValue) returns an hfr which is a scaled
25// version of givenHFRValue, scaled by the ratio of the commonHFR
26// between the two focusStars lists.
27
28class FocusStars
29{
30 public:
31 // The list of stars is not modified after the constructor.
32 // Stars whose positions are further apart than maxDistance (after
33 // overall image translation) cannot be considered the same stars.
34 FocusStars(const QList<Edge *> edges, double maDistance = 10.0);
35 FocusStars(const QList<Edge> edges, double maxDistance = 10.0);
36 FocusStars() {}
37
38 // Returns the median HFR for all the stars in this object.
39 // Uses all the stars in the object.
40 double getHFR() const;
41
42 // Computes the HFRs of this list of stars and focusStars2's list.
43 // It just uses the common stars in both lists.
44 bool commonHFR(const FocusStars &focusStars2, double *hfr, double *hfr2) const;
45
46 // Given an HFR value for focusStars2, come up with an HFR value for this
47 // object. The number it computes will be relatively correct (e.g. if this
48 // FocusStars is more in focus than FocusStars2, then it will return a
49 // lower HFR value than hfrForList2, and if it is worse, the hfr will be higher.
50 // It will return something proportionally correct, however the number
51 // returned likely won't be the standard HFR value computed for all stars.
52 double relativeHFR(const FocusStars &focusStars2, double hfrForStars2) const;
53
54 // Returns a reference to all the stars.
55 const QList<Edge> &getStars() const
56 {
57 return stars;
58 };
59
60 // debug
61 void printStars(const QString &label) const;
62
63 private:
64
65 QList<Edge> stars;
66
67 // Cached HFR computed on all the stars.
68 mutable double computedHFR = -1;
69
70 // Default max distance to consider two star positions the same star.
71 double maxDistance = 5;
72 bool initialized = false;
73};
74}
Ekos is an advanced Astrophotography tool for Linux.
Definition align.cpp:83
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:43 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.