Kstars

kscomet.h
1/*
2 SPDX-FileCopyrightText: 2001 Jason Harris <jharris@30doradus.org>
3
4 SPDX-License-Identifier: GPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "ksplanetbase.h"
10
11/**
12 * @class KSComet
13 * @short A subclass of KSPlanetBase that implements comets.
14 *
15 * The orbital elements are stored as private member variables, and
16 * it provides methods to compute the ecliptic coordinates for any
17 * time from the orbital elements.
18 *
19 * All elements are in the heliocentric ecliptic J2000 reference frame.
20 *
21 * Check here for full description: https://ssd.jpl.nasa.gov/?sb_elem#legend
22 *
23 * The orbital elements are:
24 * @li JD Epoch of element values
25 * @li q perihelion distance (AU)
26 * @li e eccentricity of orbit
27 * @li i inclination angle (with respect to J2000.0 ecliptic plane)
28 * @li w argument of perihelion (w.r.t. J2000.0 ecliptic plane)
29 * @li N longitude of ascending node (J2000.0 ecliptic)
30 * @li Tp time of perihelion passage (YYYYMMDD.DDD)
31 * @li M1 comet total magnitude parameter
32 * @li M2 comet nuclear magnitude parameter
33 * @li K1 total magnitude slope parameter
34 * @li K2 nuclear magnitude slope parameter
35 *
36 * @author Jason Harris
37 * @version 1.1
38 */
39
40class KSNumbers;
41class dms;
42
43class KSComet : public KSPlanetBase
44{
45 public:
46 /**
47 * Constructor.
48 * @param s the name of the comet
49 * @param image_file the filename for an image of the comet
50 * @param q the perihelion distance of the comet's orbit (AU)
51 * @param e the eccentricity of the comet's orbit
52 * @param i the inclination angle of the comet's orbit
53 * @param w the argument of the orbit's perihelion
54 * @param N the longitude of the orbit's ascending node
55 * @param Tp The date of the most proximate perihelion passage (YYYYMMDD.DDD)
56 * @param M1 the comet total magnitude parameter
57 * @param M2 the comet nuclear magnitude parameter
58 * @param K1 the comet total magnitude slope parameter
59 * @param K2 the comet nuclear magnitude slope parameter
60 */
61 KSComet(const QString &s, const QString &image_file, double q, double e, dms i, dms w, dms N,
62 double Tp, float M1, float M2, float K1, float K2);
63
64 KSComet *clone() const override;
65 SkyObject::UID getUID() const override;
66
67 /** Destructor (empty)*/
68 ~KSComet() override = default;
69
70 /**
71 * Unused virtual function inherited from KSPlanetBase thus it's simply empty here.
72 */
73 bool loadData() override;
74
75 /**
76 * @short Returns the Julian Day of Perihelion passage
77 * @return Julian Day of Perihelion Passage
78 */
79 inline long double getPerihelionJD() { return JDp; }
80
81 /**
82 * @short Returns Perihelion distance
83 * @return Perihelion distance
84 */
85 inline double getPerihelion() { return q; }
86
87 /** @return the comet total magnitude parameter */
88 inline float getTotalMagnitudeParameter() { return M1; }
89
90 /** @return the comet nuclear magnitude parameter */
91 inline float getNuclearMagnitudeParameter() { return M2; }
92
93 /** @return the total magnitude slope parameter */
94 inline float getTotalSlopeParameter() { return K1; }
95
96 /** @return the nuclear magnitude slope parameter */
97 inline float getNuclearSlopeParameter() { return K2; }
98
99 /** @short Sets the comet's tail length in km */
100 void setTailSize(double tailsize) { TailSize = tailsize; }
101
102 /** @return the estimated tail length in km */
103 inline float getTailSize() { return TailSize; }
104
105 /** @short Sets the comet's apparent tail length in degrees */
106 void setComaAngSize(double comaAngSize) { ComaAngSize = comaAngSize; }
107
108 /** @return the estimated angular size of the tail as a dms */
109 inline dms getComaAngSize() { return dms(ComaAngSize); }
110
111 /** @return the estimated diameter of the nucleus in km */
112 inline float getNuclearSize() { return NuclearSize; }
113
114 /** @short Sets the comet's earth minimum orbit intersection distance */
115 void setEarthMOID(double earth_moid);
116
117 /** @return the comet's earth minimum orbit intersection distance in km */
118 inline double getEarthMOID() { return EarthMOID; }
119
120 /** @short Sets the comet's orbit solution ID */
121 void setOrbitID(QString orbit_id);
122
123 /** @return the comet's orbit solution ID */
124 inline QString getOrbitID() { return OrbitID; }
125
126 /** @short Sets the comet's orbit class */
127 void setOrbitClass(QString orbit_class);
128
129 /** @return the comet's orbit class */
130 inline QString getOrbitClass() { return OrbitClass; }
131
132 /** @short Sets if the comet is a near earth object */
133 void setNEO(bool neo);
134
135 /** @return true if the comet is a near earth object */
136 inline bool isNEO() { return NEO; }
137
138 /** @short Sets the comet's albedo */
139 void setAlbedo(float albedo);
140
141 /** @return the comet's albedo */
142 inline float getAlbedo() { return Albedo; }
143
144 /** @short Sets the comet's diameter */
145 void setDiameter(float diam);
146
147 /** @return the comet's diameter */
148 inline float getDiameter() { return Diameter; }
149
150 /** @short Sets the comet's dimensions */
151 void setDimensions(QString dim);
152
153 /** @return the comet's dimensions */
154 inline QString getDimensions() { return Dimensions; }
155
156 /** @short Sets the comet's rotation period */
157 void setRotationPeriod(float rot_per);
158
159 /** @return the comet's rotation period */
160 inline float getRotationPeriod() { return RotationPeriod; }
161
162 /** @short Sets the comet's period */
163 void setPeriod(float per);
164
165 /** @return the comet's period */
166 inline float getPeriod() { return Period; }
167
168 protected:
169 /**
170 * Calculate the geocentric RA, Dec coordinates of the Comet.
171 * @note reimplemented from KSPlanetBase
172 * @param num time-dependent values for the desired date
173 * @param Earth planet Earth (needed to calculate geocentric coords)
174 * @return true if position was successfully calculated.
175 */
176 bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth = nullptr) override;
177
178 /**
179 * @short Estimate physical parameters of the comet such as coma size, tail length and size of the nucleus
180 * @note invoked from findGeocentricPosition in order
181 */
183
184 private:
185 void findMagnitude(const KSNumbers *) override;
186
187 long double JDp { 0 };
188 double q { 0 };
189 double e { 0 };
190 double a { 0 };
191 double P { 0 };
192 double EarthMOID { 0 };
193 double TailSize { 0 };
194 double ComaAngSize { 0 };
195 double ComaSize { 0 };
196 double NuclearSize { 0 };
197 float M1 { 0 };
198 float M2 { 0 };
199 float K1 { 0 };
200 float K2 { 0 };
201 float Albedo { 0 };
202 float Diameter { 0 };
203 float RotationPeriod { 0 };
204 float Period { 0 };
205 dms i, w, N;
206 QString OrbitID, OrbitClass, Dimensions;
207 bool NEO { false };
208 /// Part of UID
209 qint64 uidPart { 0 };
210};
A subclass of KSPlanetBase that implements comets.
Definition kscomet.h:44
void setPeriod(float per)
Sets the comet's period.
Definition kscomet.cpp:338
double getEarthMOID()
Definition kscomet.h:118
void setDimensions(QString dim)
Sets the comet's dimensions.
Definition kscomet.cpp:318
void setComaAngSize(double comaAngSize)
Sets the comet's apparent tail length in degrees.
Definition kscomet.h:106
void setAlbedo(float albedo)
Sets the comet's albedo.
Definition kscomet.cpp:308
float getAlbedo()
Definition kscomet.h:142
float getRotationPeriod()
Definition kscomet.h:160
SkyObject::UID getUID() const override
Return UID for object.
Definition kscomet.cpp:354
float getTotalSlopeParameter()
Definition kscomet.h:94
bool isNEO()
Definition kscomet.h:136
bool loadData() override
Unused virtual function inherited from KSPlanetBase thus it's simply empty here.
Definition kscomet.cpp:349
void setTailSize(double tailsize)
Sets the comet's tail length in km.
Definition kscomet.h:100
double getPerihelion()
Returns Perihelion distance.
Definition kscomet.h:85
QString getOrbitClass()
Definition kscomet.h:130
void setOrbitID(QString orbit_id)
Sets the comet's orbit solution ID.
Definition kscomet.cpp:333
float getNuclearMagnitudeParameter()
Definition kscomet.h:91
KSComet * clone() const override
Create copy of object.
Definition kscomet.cpp:132
QString getDimensions()
Definition kscomet.h:154
float getNuclearSize()
Definition kscomet.h:112
float getNuclearSlopeParameter()
Definition kscomet.h:97
void setDiameter(float diam)
Sets the comet's diameter.
Definition kscomet.cpp:313
void setEarthMOID(double earth_moid)
Sets the comet's earth minimum orbit intersection distance.
Definition kscomet.cpp:303
void setRotationPeriod(float rot_per)
Sets the comet's rotation period.
Definition kscomet.cpp:343
void setOrbitClass(QString orbit_class)
Sets the comet's orbit class.
Definition kscomet.cpp:328
~KSComet() override=default
Destructor (empty)
bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth=nullptr) override
Calculate the geocentric RA, Dec coordinates of the Comet.
Definition kscomet.cpp:156
float getTailSize()
Definition kscomet.h:103
float getDiameter()
Definition kscomet.h:148
KSComet(const QString &s, const QString &image_file, double q, double e, dms i, dms w, dms N, double Tp, float M1, float M2, float K1, float K2)
Constructor.
Definition kscomet.cpp:42
float getPeriod()
Definition kscomet.h:166
float getTotalMagnitudeParameter()
Definition kscomet.h:88
void findPhysicalParameters()
Estimate physical parameters of the comet such as coma size, tail length and size of the nucleus.
Definition kscomet.cpp:138
dms getComaAngSize()
Definition kscomet.h:109
QString getOrbitID()
Definition kscomet.h:124
void setNEO(bool neo)
Sets if the comet is a near earth object.
Definition kscomet.cpp:323
long double getPerihelionJD()
Returns the Julian Day of Perihelion passage.
Definition kscomet.h:79
There are several time-dependent values used in position calculations, that are not specific to an ob...
Definition ksnumbers.h:43
A subclass of TrailObject that provides additional information needed for most solar system objects.
qint64 UID
Type for Unique object IDenticator.
Definition skyobject.h:49
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:53:00 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.