NavList:
A Community Devoted to the Preservation and Practice of Celestial Navigation and Other Methods of Traditional Wayfinding
From: Frank Reed
Date: 2023 Jul 9, 21:43 -0700
Go here https://svs.gsfc.nasa.gov/5048. This is a nice idea for a tool from the NASA SVS (Scientific Visualization Studio). It displays the appearance of the Moon with its phase, its apparent (geocentric) diameter, its orientation (or position angle), and its "librations". The views are based on Lunar "DEM" (digital elevation model data), and they should show high-fidelity views of the crater and mountains illumination along the lunar terminator specific to this date and the librations for this date.
Nice idea, but problematic implementation. The RA (right ascension, equivalent to 360-SHA in celestial navigation terms) and the Declination don't make sense. As it turns out, there are two problems.
If you visit the link above, you can check the Moon's appearance from any date in 2023. Let's make things easy and look at 1 January 2023 at 00:00 UT. On the daily webpage for this date and time, you'll find the Dec of the Moon listed as 12°57'40". And that's just wrong. There are two other Decs available from this SVS website for this time and date. There is a video which is intended to be an hour-by-hour summary of the Moon's data, essentially a compilation of the daily webpage data. But right away, there's a problem. For this hour and time, the video shows a Dec of 11°56'40". That differs by 1°01' from the daily webpage data. That's bad! In addition there is a text data file available, mooninfo_2023.txt (json also available with no apparent differences). You can grab that file here: https://svs.gsfc.nasa.gov/vis/a000000/a005000/a005048/mooninfo_2023.txt. This file lists the Dec of the Moon on 1 jan 2023 at 0h UT as 11.9445°.
The first problem is poor code for converting decimal degrees to degrees, minutes, and seconds. It's hard to believe that things like this still happen in the year 2023, but yes, the NASA SVS team has made a trivial error in one of their tools. You can view this code "behind" the webpage above. It includes a javascript function:
function convert_to_deg(deg) {
/** * Converts a number of degrees to the format `XX° XX' XX"`" */
let prefix = deg < 0 ? "-" : "";
let seconds = Math.round(Math.abs(deg) * 3600.0);
let degrees = Math.round(seconds / 3600);
let minutes = Math.round((seconds / 60) % 60);
seconds %= 60;
return `${prefix}${degrees}° ${minutes}' ${seconds}"`;
This does not work. Even if you don't know javascript, you can see what's going wrong here. They're using a "round" function to display a decimal angle as degrees, minutes, and second of arc. They should be using a "truncate" function (that's Math.trunc) or if the sign is peeled off first, then a "floor" function (Math.floor) is also fine. As it stands, this function will incorrectly bump up the number of degrees by one when the minutes of the angle are greater than 30, and it will bump up the minutes by one when the seconds are greater than 30. That's exactly the source of the first error. Strangely, in the code behind this webpage, just above this flawed code, there is a function to convert a decimal time (or RA) to display as hours, minutes, and seconds. Fundamentally, these are identical conversions. The code should be identical, too (with the single exception that Declination can be negative, but that's easily managed). It seems as if this "soup" of javascript was created by "too many cooks". But OK, in principle this is a "problem solved".
There remains a more puzzling problem The RA and Dec even after factoring out the display problem (above) is still wrong by a significant amount. The Moon position is approximately correct for half an hour earlier than the nominal time (not exactly half an hour, but close). How could that have happened? The RA and Dec should be correct for the UT on that date as displayed. The error here amounts to about a quarter of a degree. That's a lot for the Moon!
The NASA SVS team has been producing these Moon visualizations since 2011. There have been occasional references to them in NavList messages. They look good. They look useful. But how can it be that they have carried multiple errors for over a decade?? They are attractive "visualizations", yes, and for many users accuracy is irrelevant; it's all about putting on a good show. Is that "good enough" for a NASA-branded product?
Or do I have it wrong? If anyone sees things differently, please let me know.
Frank Reed
Clockwork Mapping / ReedNavigation.com
Conanicut Island USA