Closed MalcolmCurrie closed 3 years ago
Was there a line-ending difference between the two files? The diff is showing the entire file even though there are clearly lines that are the same before and after.
Compared with the old sla_test.f, I did add a line feed after the END statement. Might there be a Microsoft vs. Linux difference of line feeds throughout, and dos2unix needs to be applied? I should check to see if there an option in meld (used via git diff) to show LF changes. All imeld showed me were the individual lines changed and the new (non-Starlink) subroutines.
If that's the issue, I can redo this it in a fresh branch.
It won't need a new branch. You can force push when you've updated the commit (since this is all on a branch). I haven't got a local check out of the repo at the moment so can't quickly do it myself.
Indeed. I meant a local branch so that I could redo the selection of revised
lines from sla_test.f
to be sure I was using the correct file version, but it would
seem that doing the picking and copying in meld fixed the LFs. Thus only the
converted eqeqx.f needed to be added to the second forced push.
The changes were merged into the main branch.
The bug causes observed places (the direction of the incoming radiation from a celestial source) to be wrong by an amount that was zero at J2000.0 but grows steadily and at the present time has reached almost 0.1 arcseconds.
The story is as follows.
Using the classical pre IAU 2000 equinox based methods, hour angles are obtained by subtracting apparent right ascension from the local apparent sidereal time.
The local apparent sidereal time involves the quantity "equation of the equinoxes", which is the difference between mean and apparent sidereal time.
Most of the equation of the equinoxes comes from the nutation in longitude.
The previous, incorrect, sla_EQEQX obtained the nutation components by calling the routine sla_NUTC.
sla_NUTC implements the nutation model of Shirai & Fukushima (2001).
Shirai & Fukushima included in their nutation model a secular term that compensated for the imperfect precession model in use at that time. Thus the combination of IAU 1976 precession and the Shirai & Fukushima delivered milliarcsecond accuracy apparent places, which is good.
However, this secular term has no place in the computation of the nutation per se, and has been polluting SLALIB's computation of sidereal time.
The cure is simply to fall back on the nutation model that predates Shirai & Fukushima (2001), namely the IAU 1980 model.
The fix to sla_EQEQX has been simply to call sla_NUTC80 instead of sla_NUTC.
The corrected sla_EQEQX delivers equation of the equinoxes values that agree to better than 1 mas with more recent algorithms.
I doubt there are any applications out there where this bug has had any practical effect. The pollution has been smooth and gradual, and is at least an order of magnitude below the level important for telescope pointing; in any case, pointing models have probably been fudging it out. The most critical would probably be interferometer delays, and such applications really ought to be using modern post IAU 2000 CIO based algorithms.