An astronomical library
Hello - thank you for all the work that has gone into this library. I wonder if you could help me understand an example of calculating the horizontal alt/az of the moon given a geographic position. Or: "Where is the moon?" I can't get the output to match an Ephemeris from NASA : https://ssd.jpl.nasa.gov/horizons.cgi thought this is very definitely my implementation error. Would you be able to help me out? Assuming I import various things: ``` import Moonposition from "astronomia/src/moonposition"; import {Coord} from "astronomia/src/globe"; import {Ecliptic} from "astronomia/src/coord"; import Julian from "astronomia/src/julian"; import Sidereal from "astronomia/src/sidereal"; import {nutation} from "astronomia/src/nutation"; ``` Define my coordinates as such: ``` // get the device's geographicCoordinates - or a fallback: let geographicCoordinates = new Coord( this.deviceCoordinates.latitude / 180 * Math.PI, this.deviceCoordinates.longitude / 180 * Math.PI ); ``` I think I then: 1. Get the ecliptic Moon position 2. Convert this to Equatorial, by knowledge of the obliquity 3. Convert this to Horizontal by knowledge of siderealTime + my location ``` let calendar = new Julian.Calendar().fromDate(date) let jd = calendar.toJD() let jde = calendar.toJDE() let siderealTime = Sidereal.apparent0UT(jd); let eclipticMoonPosition = Moonposition.position(jde); let obliquity = nutation(jde)[1]; let equatorialMoonPosition = new Ecliptic( eclipticMoonPosition.lat, eclipticMoonPosition.lon ).toEquatorial(obliquity); let horizontalMoonPosition = equatorialMoonPosition.toHorizontal( geographicCoordinates, siderealTime ); return horizontalMoonPosition; ```
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be still under discussion. The issue was opened by covidnineteen and has received 2 comments.