Kstars

structuredefinitions.h
1/* Structure Definitions for KStars and StellarSolver Internal Library, developed by Robert Lancaster, 2020
2
3 SPDX-License-Identifier: GPL-2.0-or-later
4*/
5#ifndef STRUCTUREDEFINITIONS_H
6#define STRUCTUREDEFINITIONS_H
7
8//system includes
9#include <stdint.h>
10#include <math.h>
11#include <QString>
12
13namespace FITSImage
14{
15
16typedef enum
17{
18 POSITIVE,
19 NEGATIVE,
20 BOTH
21} Parity;
22
23static const QString getParityText(Parity parity){
24 return parity == FITSImage::NEGATIVE ? "negative" : "positive";
25}
26
27static const QString getShortParityText(Parity parity){
28 return parity == FITSImage::NEGATIVE ? "neg" : "pos";
29}
30
31// Stats struct to hold statisical data about the FITS data
32typedef struct Statistic
33{
34 double min[3] = {0}, max[3] = {0}; // Minimum and Maximum R, G, B pixel values in the image
35 double mean[3] = {0}; // Average R, G, B value of the pixels in the image
36 double stddev[3] = {0}; // Standard Deviation of the R, G, B pixel values in the image
37 double median[3] = {0}; // Median R, G, B pixel value in the image
38 double SNR { 0 }; // Signal to noise ratio
39 uint32_t dataType { 0 }; // FITS image data type (TBYTE, TUSHORT, TULONG, TFLOAT, TLONGLONG, TDOUBLE)
40 int bytesPerPixel { 1 }; // Number of bytes used for each pixel, size of datatype above
41 int ndim { 2 }; // Number of dimensions in a fits image
42 int64_t size { 0 }; // Filesize in bytes
43 uint32_t samples_per_channel { 0 }; // area of the image in pixels
44 uint16_t width { 0 }; // width of the image in pixels
45 uint16_t height { 0 }; // height of the image in pixels
46 uint8_t channels { 1 }; // Mono Images have 1 channel, RGB has 3 channels
47} Statistic;
48
49// This structure holds data about sources that are found within
50// an image. It is returned by Source Extraction
51typedef struct Star
52{
53 float x; // The x position of the star in Pixels
54 float y; // The y position of the star in Pixels
55 float mag; // The magnitude of the star, note that this is a relative magnitude based on the star extraction options.
56 float flux; // The calculated total flux
57 float peak; // The peak value of the star
58 float HFR; // The half flux radius of the star
59 float a; // The semi-major axis of the star
60 float b; // The semi-minor axis of the star
61 float theta; // The angle of orientation of the star
62 float ra; // The right ascension of the star
63 float dec; // The declination of the star
64 int numPixels; // The number of pixels occupied by the star in the image.
65} Star;
66
67// This struct holds data about the background in an image
68// It is returned by source extraction
69typedef struct Background
70{
71 int bw, bh; // single tile width, height
72 float global; // global mean
73 float globalrms; // global sigma
74 int num_stars_detected; // Number of stars detected before any reduction.
75} Background;
76
77// This struct contains information about the astrometric solution
78// for an image.
79typedef struct Solution
80{
81 double fieldWidth; // The calculated width of the field in arcminutes
82 double fieldHeight; // The calculated height of the field in arcminutes
83 double ra; // The Right Ascension of the center of the field in degrees
84 double dec; // The Declination of the center of the field in degrees
85 double orientation; // The orientation angle of the image from North in degrees
86 double pixscale; // The pixel scale of the image in arcseconds per pixel
87 Parity parity; // The parity of the solved image. (Whether it has been flipped) JPEG images tend to have negative parity while FITS files tend to have positive parity.
88 double raError; // The error between the search_ra position and the solution ra position in arcseconds
89 double decError; // The error between the search_dec position and the solution dec position in arcseconds
90} Solution;
91
92// This is point in the World Coordinate System with both RA and DEC.
93typedef struct wcs_point
94{
95 float ra; // The Right Ascension in degrees
96 float dec; // The Declination in degrees
97} wcs_point;
98
99} // FITSImage
100
101#endif // STRUCTUREDEFINITIONS_H
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:49:22 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.