Tengai
Tengai is a Gem for using the NASA JPL HORIZONS System. It produces emepherides–tables plotting the course of a celestial body over time.
The JPL HORIZONS on-line solar system data and ephemeris computation service provides access to key solar system data and flexible production of highly accurate ephemerides for solar system objects (603428 asteroids, 3184 comets, 176 planetary satellites, 8 planets, the Sun, L1, L2, select spacecraft, and system barycenters ). HORIZONS is provided by the Solar System Dynamics Group of the Jet Propulsion Laboratory.
Usage
The API is currently very limited. The data from the telnet system is very irregularly structured, and as such parsing it is a big deal.
client = Tengai::Client.new # Connect a client to the telnet server
body = Tengai::Body.find(client, 499) # Get Mars
ephemeris = Tengai::Ephemeris.fetch(client, body,
start_time: Date.today, stop_time: Date.today + 1, interval: 720) # Get ephemeris data for mars
Contributing
The project uses Ragel State Machine Compiler to generate the parser code. If
you will be working on that, you'll need to install Ragel (brew install ragel
).
- Fork
- Create a feature branch
- Add your feature and test it
- Commit
- Push your branch
- Create a pull request
Testing đź‘Ś
Tengai is tested with Test::Unit. Tests are split unto units and integration.
Run them with rake test:units
and rake test:integration
respectively or
just rake
to run them all.