Updates to SkyPoint to improve positions
ClosedPublic

Authored by chrisrowland on May 9 2020, 8:59 AM.

Details

Summary

Many places in Kstars abd EKOS us precession only to change J2000 catalogue
coordinates to the observed position, omitting nutuation and aberration.
Also the conversion from an observed position to a J2000 catalogue
position was implemented incorrectly, aberration and nutauion were not being removed.

This updates SkyPoint to correct these and adds unit tests to check them.
I also found that the SkyPoint aberration and nutation corrections gave
incorrect results and these have been replaced by the libnova corrections
which testing show are better. I am using SOFA to generate test positions.

The changes to SkyPoint have been used to implement coordinate conversions
correctly in KStars and EKOS, by replacing precession conversion with
apparentCoord() and CatalogueCoord() as appropriate.

Test Plan

Run the test_skypoint test. At present two tests fail by a small amount for
declinations close to 90.

Review the changes. I don't think I've made a change which isn't required but
may have missed some.

Build and test. For example the details dialog should now give a J2000
position that matches the J2000 positionin the image header. Make sure that
you have an up to date version if INDI. I had to update that as well.

Diff Detail

Repository
R321 KStars
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
chrisrowland created this revision.May 9 2020, 8:59 AM
Restricted Application added a project: KDE Edu. · View Herald TranscriptMay 9 2020, 8:59 AM
Restricted Application added a subscriber: kde-edu. · View Herald Transcript
chrisrowland requested review of this revision.May 9 2020, 8:59 AM

Thank you Chris, this is a much needed fix! The SkyPointTest was crashing though due to checkBendLight function which then tries to get the SkyMapComposite pointer which is null. So I disabled useRelativistic option that would lead to this. Furthermore, two tests fail:

FAIL! : TestSkyPoint::compareSkyPointLibNova(near S Pole) 'fabs(ra1 - ra2) < err' returned FALSE. (Ra 226.738, 226.739 error -2.0)

Loc: [/home/jasem/Projects/kstars/Tests/skyobjects/test_skypoint.cpp(510)]

QDEBUG : TestSkyPoint::compareSkyPointLibNova(near S Pole) ln expected pos1 226.738, -85.1112 pos2 226.739, -85.1112 errors -2.2, -0.0 secs
FAIL! : TestSkyPoint::compareSkyPointLibNova(near S Pole) 'fabs(ra1 - ra2) < err' returned FALSE. (Ra 226.738, 226.739 error -2.2)

Loc: [/home/jasem/Projects/kstars/Tests/skyobjects/test_skypoint.cpp(510)]
mutlaqja accepted this revision.May 9 2020, 9:58 PM
This revision is now accepted and ready to land.May 9 2020, 9:58 PM

Fix problem with test failures at high declinations

I've fixed the test problem, I wasn't calculating the expected error in Ra correctly at high declinations.

mutlaqja updated this revision to Diff 82405.May 10 2020, 9:42 AM
  • Set Use Relativistic to false to prevent crash during testing
This revision was automatically updated to reflect the committed changes.

This is excellent. Sorry to arrive late to the party, two comments from me, one about the test mode of QtTest, and the other about build failures with versions older than Qt 5.9.

Tests/skyobjects/test_skypoint.cpp
32

If you use Options, you may need to use QStandardPaths::setTestModeEnabled to prevent your changes from (1) depending on existing data and (2) modifying existing user data? Check the constructor of TestKSUserDB at https://github.com/KDE/kstars/blob/master/Tests/auxiliary/testksuserdb.cpp.

37

This will not be executed if the test crashes, hence modifying local user data.

247

You need to #ifdef this against Qt 5.9, see the example at TestEkosSimulator::testMountSlew_data at https://github.com/KDE/kstars/blob/master/Tests/kstars_ui/test_ekos_simulator.cpp.

262

You need to #ifdef this against Qt 5.9, see the example at TestEkosSimulator::testMountSlew_data at https://github.com/KDE/kstars/blob/master/Tests/kstars_ui/test_ekos_simulator.cpp.

293

Qt 5.9

324

Qt 5.9.

367

Qt 5.9.

393

Qt 5.9.

412

Qt 5.9.