CNLC - Calculate Longitude by Chronometer
Description: Determine the observer's longitude from the celestial object's GHA, declination, and height, together with the DR latitude.
Inputs:
| DR Lat | DR Latitude of the observer |
| Observation | East (E) or West (W) of the observer's meridian - case insensitive |
| GHA | GHA of the celestial object |
| Dec | Declination of the celestial object |
| H | Height/altitude of the celestial object |
Outputs:
| Lon | Longitude of the observer's position |
Sample execution:
DR Lat? 12,20 Observation E or W? w GHA? 41,16.2 Dec? -19,01 H? 56,21.1 Lon: -28° 52.1'
(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/.
# CNLC - Calculate Longitude by Chronometer
from math import *
from CN_LIB import *
lat = stod("DR Lat? ")
ew = input("Observation E or W? ")
gha = stod("GHA? ")
dec = stod("Dec? ")
h = stod("H? ")
p = aCos((Sin(h)-Sin(lat)*Sin(dec))/(Cos(lat)*Cos(dec)))
lha = p
if ew.lower().startswith("e"): lha = 360-p
lon = lha-gha
if lon > 180: lon-= 360
if lon < -180: lon+= 360
print("")
print("Lon: "+dtos(lon))