summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkarsh Simha <akarsh@kde.org>2016-10-01 22:52:33 (GMT)
committerAkarsh Simha <akarsh@kde.org>2016-10-01 22:53:17 (GMT)
commit64ff47cec51687a8916b2b8c5a47754c22411aac (patch)
tree16708a387b253042374bff8f53723f305446cc85
parentb1adcc89190e7dae6e9e697b2a6a493c323588c6 (diff)
Change behavior of deprecess to update RA0, Dec0 only if they are J2000
-rw-r--r--kstars/skyobjects/skypoint.cpp10
-rw-r--r--kstars/skyobjects/skypoint.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/kstars/skyobjects/skypoint.cpp b/kstars/skyobjects/skypoint.cpp
index f20f984..16f9927 100644
--- a/kstars/skyobjects/skypoint.cpp
+++ b/kstars/skyobjects/skypoint.cpp
@@ -227,10 +227,12 @@ SkyPoint SkyPoint::deprecess( const KSNumbers *num, long double epoch ) {
long double now = num->julianDay();
p1.precessFromAnyEpoch( now, epoch );
if( ( std::isnan( RA0.Degrees() ) || std::isnan( Dec0.Degrees() ) ) ||
- ( !std::isnan( Dec0.Degrees() ) && fabs( Dec0.Degrees() ) > 90.0 ) ) {
- // We have invalid RA0 and Dec0, so set them.
- RA0 = p1.ra();
- Dec0 = p1.dec();
+ ( !std::isnan( Dec0.Degrees() ) && fabs( Dec0.Degrees() ) > 90.0 ) ) {
+ // We have invalid RA0 and Dec0, so set them if epoch = J2000. Otherwise, do not touch.
+ if ( epoch == J2000 ) {
+ RA0 = p1.ra();
+ Dec0 = p1.dec();
+ }
}
return p1;
}
diff --git a/kstars/skyobjects/skypoint.h b/kstars/skyobjects/skypoint.h
index acd9d8b..4a83318 100644
--- a/kstars/skyobjects/skypoint.h
+++ b/kstars/skyobjects/skypoint.h
@@ -317,7 +317,7 @@ public:
/**
*@short Obtain a Skypoint with RA0 and Dec0 set from the RA, Dec
* of this skypoint. Also set the RA0, Dec0 of this SkyPoint if not
- * set already.
+ * set already and the target epoch is J2000.
*/
SkyPoint deprecess( const KSNumbers *num, long double epoch=J2000 );