Add support for WCS

This commit is contained in:
2022-06-13 18:02:58 +02:00
parent 701a425cc7
commit 6b9ea5e4b9
7 changed files with 162 additions and 13 deletions
+30
View File
@@ -2,6 +2,8 @@
#define IMAGEINFO_H
#include <QTreeWidget>
#include <wcslib/wcs.h>
#include <cmath>
struct FITSRecord
{
@@ -11,10 +13,38 @@ struct FITSRecord
bool editable() const;
};
class SkyPoint
{
double ra = NAN;
double dec = NAN;
public:
SkyPoint();
SkyPoint(double ra, double dec);
void set(double ra, double dec);
double RA() const { return ra; }
double DEC() const { return dec; }
QString toString() const;
};
class WCSData
{
int nwcs = 0;
struct wcsprm *wcs = nullptr;
void freeWCS();
public:
WCSData();
WCSData(char *header, int nrec);
~WCSData();
SkyPoint pixelToWorld(QPointF pixel) const;
QPointF worldToPixel(SkyPoint point) const;
void calculateBounds(double &minRa, double &maxRa, double &minDec, double &maxDec);
};
struct ImageInfoData
{
QVector<FITSRecord> fitsHeader;
QVector<QPair<QString, QString>> info;
std::shared_ptr<WCSData> wcs;
};
Q_DECLARE_METATYPE(ImageInfoData);