Add support for WCS
This commit is contained in:
+30
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user