Kstars

kscomet.h
1 /*
2  SPDX-FileCopyrightText: 2001 Jason Harris <[email protected]>
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 
40 class KSNumbers;
41 class dms;
42 
43 class 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  */
182  void findPhysicalParameters();
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 };
QString getOrbitClass()
Definition: kscomet.h:130
float getTailSize()
Definition: kscomet.h:103
long double getPerihelionJD()
Returns the Julian Day of Perihelion passage.
Definition: kscomet.h:79
void setComaAngSize(double comaAngSize)
Sets the comet's apparent tail length in degrees.
Definition: kscomet.h:106
void setDimensions(QString dim)
Sets the comet's dimensions.
Definition: kscomet.cpp:316
bool findGeocentricPosition(const KSNumbers *num, const KSPlanetBase *Earth=nullptr) override
Calculate the geocentric RA, Dec coordinates of the Comet.
Definition: kscomet.cpp:154
float getNuclearSlopeParameter()
Definition: kscomet.h:97
A subclass of KSPlanetBase that implements comets.
Definition: kscomet.h:43
bool isNEO()
Definition: kscomet.h:136
float getDiameter()
Definition: kscomet.h:148
void setTailSize(double tailsize)
Sets the comet's tail length in km.
Definition: kscomet.h:100
void setDiameter(float diam)
Sets the comet's diameter.
Definition: kscomet.cpp:311
~KSComet() override=default
Destructor (empty)
float getTotalSlopeParameter()
Definition: kscomet.h:94
float getRotationPeriod()
Definition: kscomet.h:160
qint64 UID
Type for Unique object IDenticator.
Definition: skyobject.h:49
double getPerihelion()
Returns Perihelion distance.
Definition: kscomet.h:85
bool loadData() override
Unused virtual function inherited from KSPlanetBase thus it's simply empty here.
Definition: kscomet.cpp:347
QString getOrbitID()
Definition: kscomet.h:124
float getNuclearSize()
Definition: kscomet.h:112
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
void setPeriod(float per)
Sets the comet's period.
Definition: kscomet.cpp:336
Store several time-dependent astronomical quantities.
Definition: ksnumbers.h:42
SkyObject::UID getUID() const override
Return UID for object.
Definition: kscomet.cpp:352
QString getDimensions()
Definition: kscomet.h:154
void setEarthMOID(double earth_moid)
Sets the comet's earth minimum orbit intersection distance.
Definition: kscomet.cpp:301
float getPeriod()
Definition: kscomet.h:166
double getEarthMOID()
Definition: kscomet.h:118
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:37
void findPhysicalParameters()
Estimate physical parameters of the comet such as coma size, tail length and size of the nucleus.
Definition: kscomet.cpp:136
void setOrbitClass(QString orbit_class)
Sets the comet's orbit class.
Definition: kscomet.cpp:326
float getAlbedo()
Definition: kscomet.h:142
float getNuclearMagnitudeParameter()
Definition: kscomet.h:91
void setOrbitID(QString orbit_id)
Sets the comet's orbit solution ID.
Definition: kscomet.cpp:331
void setNEO(bool neo)
Sets if the comet is a near earth object.
Definition: kscomet.cpp:321
KSComet * clone() const override
Create copy of object.
Definition: kscomet.cpp:130
void setRotationPeriod(float rot_per)
Sets the comet's rotation period.
Definition: kscomet.cpp:341
float getTotalMagnitudeParameter()
Definition: kscomet.h:88
dms getComaAngSize()
Definition: kscomet.h:109
void setAlbedo(float albedo)
Sets the comet's albedo.
Definition: kscomet.cpp:306
Provides necessary information about objects in the solar system.
Definition: ksplanetbase.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Dec 3 2023 04:06:17 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.