[Kstars-devel] [kstars/bleeding-edge] kstars/skyobjects: + Adding a bunch of fields for Deep-Sky and generic objects.

Akarsh Simha akarsh.simha at kdemail.net
Sun Mar 17 07:32:27 UTC 2013


Git commit 1774d14cc4fc0c9f6db887aba43bfb4c243f5ed0 by Akarsh Simha.
Committed on 17/03/2013 at 08:26.
Pushed by asimha into branch 'bleeding-edge'.

+ Adding a bunch of fields for Deep-Sky and generic objects.

+ Changing the way magnitudes are interpreted. The old "Magnitude"
  field is now the sortingMagnitude, which is used for determining
  whether the object is visible or not, etc. It need not be scientific
  / accurate / reliable data. We could, in principle, use some
  "handwavy" guesses for this field. (eg: if the blue magnitude is
  available, we may "guess" the visual sorting magnitude by guessing
  an appropriate B-V color index. See, eg DeepStarComponent)

  The real Magnitudes are now stored in a Hash. Those are the values
  that are fit for real display.

The question of StarObject:

StarObject already has support for B and V magnitudes separately. The
question is, should we migrate that to the hash? We have many stars --
not sure if it is optimal to migrate the star magnitudes into the
magnitude hash. Besides, stars are replicated using the placement new
operator, so I'm unsure whether that would lead to any additional
complications.

Any ideas from the list?

We could just override mag( band ) in StarObject if necessary.

CCMAIL: kstars-devel at kde.org

M  +1    -0    kstars/skyobjects/auxinfo.h
M  +8    -0    kstars/skyobjects/deepskyobject.h
M  +14   -1    kstars/skyobjects/skyobject.h

http://commits.kde.org/kstars/1774d14cc4fc0c9f6db887aba43bfb4c243f5ed0

diff --git a/kstars/skyobjects/auxinfo.h b/kstars/skyobjects/auxinfo.h
index e71c9b4..b46840e 100644
--- a/kstars/skyobjects/auxinfo.h
+++ b/kstars/skyobjects/auxinfo.h
@@ -40,6 +40,7 @@ public:
     QStringList InfoTitle;
     QString userLog;
     QString notes;
+    QHash<QString, QVariant> otherData;
 };
 
 #endif
diff --git a/kstars/skyobjects/deepskyobject.h b/kstars/skyobjects/deepskyobject.h
index bb664d8..a095ac1 100644
--- a/kstars/skyobjects/deepskyobject.h
+++ b/kstars/skyobjects/deepskyobject.h
@@ -199,6 +199,14 @@ private:
     int UGC, PGC;
     float MajorAxis, MinorAxis, Flux;
     QImage m_image;
+    QList<const SkyObject *> m_Parents; // Q: Should we use KStars UUIDs, DB UUIDs, or SkyObject * pointers? Q: Should we extend this to stars? -- asimha
+    QList<const SkyObject *> m_Children; // Q: Should we use KStars UUIDs, DB UUIDs, or SkyObject * pointers? Q: Should we extend this to stars? -- asimha
+    QStringList m_AlternateDesignations; // Alternate names. FIXME: These should be superseded by designation UIDs in the database
+    double RedshiftZ; // Redsfhit 'z' value
+    QString Description; // Dreyer or other description
+    QString Classification; // Object class. eg: SBb for galaxies
+    double pmRA, pmDec; // Proper motions in mas/yr
+
     CatalogComponent *customCat;
 };
 
diff --git a/kstars/skyobjects/skyobject.h b/kstars/skyobjects/skyobject.h
index a1019c6..a9a79e1 100644
--- a/kstars/skyobjects/skyobject.h
+++ b/kstars/skyobjects/skyobject.h
@@ -182,6 +182,12 @@ public:
     inline float mag( void ) const { return sortMagnitude; }
 
     /**
+     *@return object's magnitude in given band. NaN if magnitude unavailable.
+     *@param band a string specifying which spectral band to look for
+     */
+    inline float mag( const QString &band ) const { return m_Magnitudes.value( band, NaN::f ); }
+
+    /**
      *@return the object's position angle.  This is overridden in KSPlanetBase
      *and DeepSkyObject; for all other SkyObjects, this returns 0.0.
      */
@@ -395,12 +401,19 @@ private:
 
     unsigned char Type;
     float sortMagnitude; // This magnitude is used for sorting / making decisions about the visibility of an object. Should not be NaN.
+    QHash<QString, float> m_Magnitudes; // Magnitudes vs. band
 
 protected:
-    /**Set the object's magnitude.
+    /**Set the object's sorting magnitude.
      * @param m the object's magnitude. */
     inline void setMag( float m ) { sortMagnitude = m < 36.0 ? m : NaN::f; } // Updating faintest sane magnitude to 36.0 (faintest visual magnitude visible with E-ELT, acc. to Wikipedia on Apparent Magnitude.)
 
+    /** Set the object's magnitude in a particular band.
+     * @param band the band (U, B, V, R, I, J, K etc.)
+     * @param mag the object's (apparent) magnitude.
+     */
+    void setMag( const QString &band, const double mag );
+
     /**Set the object's primary name.
      * @param name the object's primary name */
     inline void setName( const QString &name ) { Name = name; }


More information about the Kstars-devel mailing list