CNLUNAR - Calculate Longitude using the Lunar Method
Description: The first part of the program clears the lunar distance using Young's formula. The second part calculates the expected lunar distance at two times bracketing the observer's best guess at the UT time, and derives longitude by interpolating the actual cleared distance between the two times.
Clearing the distance
Inputs:
| hm Moon | The apparent height of the Moon plus semidiameter correction |
| hs 2nd object | The apparent height of the second object plus semidiameter correction |
| Hm Moon | The actual height of the Moon including refraction and parallax |
| Hs 2nd object | The actual height of the second object including refraction and parallax |
| Observed lunar distance | The observed (uncleared) lunar distance |
Outputs:
| Cleared lunar distance D | The lunar distance after clearing |
Interpolating
Inputs:
| GHA Moon at T1 | The GHA of the Moon at time T1 |
| Dec Moon at T1 | The declination of the Moon at time T1 |
| GHA 2nd object at T1 | The GHA of the second object at time T1 |
| Dec 2nd object at T1 | The declination of the second object at time T1 |
| GHA Moon at T2 | The GHA of the Moon at time T2 |
| Dec Moon at T2 | The declination of the Moon at time T2 |
| GHA 2nd object at T2 | The GHA of the second object at time T2 |
| Dec 2nd object at T2 | The declination of the second object at time T2 |
| Est. UT | The observer's best guess at current UT |
Outputs:
| D1 | The calculated lunar distance at T1 |
| D2 | The calculated lunar distance at T2 |
| T | The UT calculated by interpolating D between D1 and D2 |
Sample execution:
hm Moon? 47,58.1 hs 2nd object? 26,41.7 Hm Moon? 48,33.9 Hs 2nd object? 26,40 Observed lunar distance? 92,47.6 Cleared distance D = 92° 23.1' Est. UT? 17:30 T1: 15h 00m 00s T2: 18h 00m 00s GHA Moon at T1? 308,29.9 Dec Moon at T1? 16,14.2 GHA 2nd object at T1? 45,54.5 Dec 2nd object at T1? 19,04.8 D1 = 91° 28.1' GHA Moon at T2? 352,11.9 Dec Moon at T2? 15,37.8 GHA 2nd object at T2? 90,54.4 Dec 2nd object at T2? 19,06.5 D2 = 92° 50.5' T = 17h 00m 06s
(For explanation of notation, conventions etc, see python-programs).
Copyright (C) 2024 Ian Staniforth
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
https://www.gnu.org/licenses/.
# CNLUNAR - Calculate Longitude by Lunar Method
from math import *
from CN_LIB import *
# Clear the Lunar distance using Young's method
hm = stod("hm Moon? ")
hs = stod("hs 2nd object? ")
Hm = stod("Hm Moon? ")
Hs = stod("Hs 2nd object? ")
d = stod("Observed lunar distance? ")
D = aCos((Cos(d)+Cos(hm+hs))*(Cos(Hm)*Cos(Hs))/(Cos(hm)*Cos(hs)) - Cos(Hm+Hs))
print("")
print("Cleared distance D = "+dtos(D))
print("")
# Calculate T1 and T2
ET = stot("Est. UT? ")
T1 = ET-(ET%3)
T2 = T1+3
print("T1: "+ttos(T1))
print("T2: "+ttos(T2))
print("")
# Calculate Dc at T1 and T2
gham1 = stod("GHA Moon at T1? ")
decm1 = stod("Dec Moon at T1? ")
ghas1 = stod("GHA 2nd object at T1? ")
decs1 = stod("Dec 2nd object at T1? ")
D1 = aCos((Sin(decm1)*Sin(decs1)+Cos(decm1)*Cos(decs1)*Cos(gham1-ghas1)))
print("D1 = "+dtos(D1))
gham2 = stod("GHA Moon at T2? ")
decm2 = stod("Dec Moon at T2? ")
ghas2 = stod("GHA 2nd object at T2? ")
decs2 = stod("Dec 2nd object at T2? ")
D2 = aCos((Sin(decm2)*Sin(decs2)+Cos(decm2)*Cos(decs2)*Cos(gham2-ghas2)))
print("D2 = "+dtos(D2))
# Calculate T from T1, T2 and D
T = T1+(D-D1)/(D2-D1)*(T2-T1)
print("")
print("T = "+ttos(T))