Git Product home page Git Product logo

horizons's Introduction

Horizons

Heroku Build Status standard-readme compliant Contributor Covenant

A RESTful-style API for NASA's HORIZONS system, written in Clojure. See more at https://git.io/horizons-docs.

Background

The HORIZONS system provides a model for the solar system. Through it, queries can be made to find the positions of planets, asteroids, comets, and other astronomical bodies. This kind of data base is sometimes called an ephemeredes (singular ephemeris).

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 ( 728955 asteroids, 3451 comets, 178 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.

โ€” NASA's documentation for the HORIZONS system

The only ways to access HORIZONS are through telnet, email, and a CGI web interface intended for end-user access. I want to provide a modern REST-style JSON interface to this system.

Install

Clone this repository via Git

git clone https://github.com/Cantido/horizons.git

Usage

This application contains its own Jetty web server. To start in Production mode, use the provided start-server.sh script.

./start-server.sh

You can also run this app in development mode with lein run

lein run -m horizons.main

Maintainers

This project is maintained by Rosa Richter. You can get in touch with her on Keybase.io.

Contributing

Questions and pull requests are more than welcome. I believe bad documentation is a bug, so if anything is unclear, please file an issue! Ideally, my answer to your question will be in an update to the docs.

Please see CONTRIBUTING.md for all the details you could ever want about helping me with this project.

Note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

MIT License

Copyright 2020 Rosa Richter.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

horizons's People

Contributors

cantido avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

horizons's Issues

Responses from telnet are occasionally mangled

Mangled meaning characters are transposed all over the place. It's probably a threading issue. Or maybe bytes are getting dropped somehow? A band-aid would be fetching the data once again if parsing failed, since it doesn't seem to happen often.

Support min/max values

The schema for QuantitativeValue has fields for minValue and maxValue. Since the telnet responses sometimes contain an error estimate, like +-0.01, we can calculate this min and max as well. Currently, these error estimations are totally ignored.

Note that some measurements have decimal-place-dependent error measurements, like 1.123+-4, which really means 1.123+-0.004.

List body IDs

HORIZONS has a help menu that shows a bunch of bodies and their IDs, it would be helpful to grab this and display it for an index page or something.

Support Pluto

Pluto's response is kinda different from the 8 major planets. It will need some specific parsing rules.

Duration parser incorrectly reads tenths of seconds

The duration parsing rule defines the seconds and milliseconds portion as

(seconds <"."> milliseconds <"s">)

Most duration values are given as something like 2.123 for two seconds and one-hundred and twenty-three milliseconds. However, this also means that a value like 2.4 would be parsed into two seconds and four milliseconds, not two seconds and four-hundred milliseconds as is intended.

Return ephemeris data for all 8 planets in the default time-frame

An example of ephemeris data is in the Mars ephemeredes results file.

I would expect the data to be found at /body/{id}/ephemeredes or something similar.

This is what I've decided are the "default" settings:

  • Vectors output (enter "v")
  • Earth center (hit enter without typing anything)
  • "eclip" reference plane
  • current system time for start date (hit enter without typing anything)
  • now + 14 days ending TDB (hit enter without typing anything)
  • Sixty-minute output interval (hit enter without typing anything)
  • Accept default output (hit enter without typing anything)

Add HTTP caching info based on revision dates

HTTP responses from the API return cache-control and last-modified headers based on the revision dates provided in the Telnet responses. Example:

Revised: Jul 31, 2013 Earth 399

For an ephemeris request submitted without options, caching must be disabled, or restricted to whatever amount of time the request is still valid. I think the system starts its two-week window at the beginning of the current UTC day, so the response could at least be cached until the end of the day.

Search for bodies

You can enter a partial name and search for bodies, it would be nice to expose that functionality.

Grammar ignores order-of-magnitude signifiers

Some rules just ignore a stated order-of-magnitude token, so values are usually between one and ten, with an implied order of magnitude. The order of magnitudes for certain fields are different between planets, as well.

This will require the rules to not hide the magnitudes they are parsing, and then have a transformation rule on those fields to convert them to a BigDecimal or something else that can hold one of those big numbers.

Make sure that numbers are put into the correct order-of-magnitude.

Search bodies by IAU name

The telnet client provides the feature of accessing a planet by IAU name, for example Mars instead of 499. Create a /bodies/search endpoint to pass in a search query. Example:

/bodies/search?q=mars

I am not sure if the telnet application is case-sensitive. I need to do more research on the app's searching functionality.

Grammar ignores units

Units are ignored, at present. Most fields state them, either in the label or after the value, but they are ignored.

Make sure that units get exposed, and end up in the same object with the value, as per the QuantitativeValue schema.

Access all major bodies provided by HORIZONS

If you connect to HORIZONS, and view the major bodies database with MB, you are given a list of all major bodies the system has information on. I want to make all of these available, at their given IDs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.