Notes on Celestial Navigation

Programs

Structure of Programs

The programs are designed to be as simple as possible in order to illustrate the algorithms and formulae used in the text. There is no error checking on inputs. Outputs are rounded to \(0.1'\), which is similar accuracy to the Nautical Almanac. Variable names correspond closely to the notation used in the text. The programs have been tested in the IDLE environment on Windows 11, the Pydroid 3 app on Android, and on the Texas Instruments TI-84 Plus CE-T Python Edition and Numworks N0120 calculators.

Python has no direct input in degrees and minutes. Angles are entered as d,m or just d where d is the degrees and m is the (optional) minutes. For example \(51^\circ\;4.7'\) is entered as 51,4.7. The decimal degree format 51.078 also works (often used in the Nautical almanac). Times are entered as hh:mm:ss, where hh is the hours and mm ss the (optional) minutes and seconds.

Coordinates follow GPS standards, so latitudes are entered as negative for southern hemisphere, and longitudes are positive east, and negative west.

Python trigonometrical functions operate on radian values, whereas celestial navigation uses degrees, minutes and decimal fractions of minutes as standard. So functions Sin, Cos, Tan, aSin, aCos etc are defined which separate out the conversion to and from radians and allow the main formulae to read as naturally as possible. These are in the Python file CN_LIB.py which is imported at the start of every program.

Additional I/O functions and support routines are also defined in the CN_LIB file.

List of Programs

CNAP.py - Calculate the Assumed Position (AP) for use with sight reduction tables and Saint-Hilaire's method.

CNARCT.py - Convert an angle in degrees to an hour angle.

CNAZALT.py - Calculate the Azimuth and Altitude of a Celestial Object.

CNDEC.py - Estimate the declination of the Sun on a given day of the year.

CNDEWIT.py - Calculate the observer's position using DeWit's weighted least squares method for multiple sights.

CNDIST.py - Calculate the linear distance in nautical miles between two points.

CNEOT.py - Estimate the Equation of Time (EoT) on a given day of the year.

CNGARIES.py - Calculate the GHA of the first point of Aries at a given time and day of the year.

CNGHASUN.py - Estimate the Sun's GHA at a given time and day of the year.

CNLAT.py - Calculate the observer's latitude from a transit.

CNLC.py - Calculate the observer's longitude.

CNLDIFF.py - Estimate the observer's longitude and the UT time using lunar differentials.

CNLHA.py - Calculate the LHA of a celestial object.

CNLUNAR.py - Calculate longitude using the Lunar Method.

CNPOLE.py - Calculate latitude using Polaris.

CNREF.py - Calculate the refraction of a celestial object from its apparent height.

CNRUN.py - Calculate the new latitude and longitude from a course and distance made good.

CNSG.py - Calculate the observer's position from two sights using Stanley Gery's method.

CNSH.py - Calculate latitude and longitude using Saint-Hilaire's Method.

CNSUMNER.py - Calculate latitude and longitude using Sumner's Method.

CNTARC.py - Convert an hour angle to an angle in degrees.

CNVA.py - Calculate the observer's position from two sights using Van Allen's method.

CNWJ.py - Calculate the observer's position using Watkins & Janiczek's least squares method for multiple sights.