david-rc-dayton / pious-squid

Orbital mechanics and satellite mission analysis library, for NodeJS and the browser.
MIT License
14 stars 5 forks source link

Other celestial objects? #1

Open meyercm opened 5 years ago

meyercm commented 5 years ago

First, this is a fantastic library - thank you for sharing it. I'm especially pleased with the API you've put together, which is really intuitive to use.

Is it possible to use what is already here to calculate an observer's look-angles to other celestial objects - planets and stars in particular?

david-rc-dayton commented 5 years ago

Thanks! Unfortunately, the library is currently focused on modelling Earth-orbiting satellites, and doesn't support celestial bodies other than the Earth, Moon, and Sun for perturbations. If you have a position vector for a planet in one of the library's supported frames, you should be able to calculate the look angles using the library. I believe some polynomials exist for the approximate position of the planets in Vallado's Fundamentals of Astrodynamics text, and information on JPL's higher fidelity ephemerides can be found at: https://www.cv.nrao.edu/~rfisher/Ephemerides/ephem_use.html

The polynomials would probably be better for sending over the web, since the JPL files are pretty large in size.

Similar to the planets, star positions are posted in catalogs containing the right ascension (RA) and declination (DEC) in an inertial frame. The RA and DEC can be transformed into a unit vector and linearly scaled by some big number to approximate the position, which could be used with the existing code as long as the coordinate frame is supported (i.e. J2000). There's probably a better way do do this, but I'd need to do some further reading on the topic.

I'm not super confident I'll have time to add this to the library any time soon, but hopefully the information above helps.