jonroberts / nasa2014

nasa2014
2 stars 5 forks source link

Space Rocks!

Space Rocks!

This is the repository for Space Rocks!, an entry to the Space Apps Challenge 2014. A live version of the project can be seen at http://www.spacerocksgame.org

The code for the game is in ./game_v1/

The code for the API is in ./astro_api/

Description of the API

The Space Rocks! API allows user to query for asteroids in a subset of the JPL Small Bodies Database (SBDB). The asteroids made available through the API are all those that have a known spectral type. In addition to the properties provided by the SBDB, we also add the total value and value per kg calculated by the Asterank library, and the calculated distance and delta-v from Earth on a given day.

The distance calculation is provided in ./astro_api/orbitcalc.py. You can run the API locally by installing Flask (pip install flask) and running

python app.py

The endpoint of the API is http://server.spacerocksgame.org/get_asteroids_by_type and takes the following query parameters:

An example query: http://server.spacerocksgame.org/get_asteroids_by_type?limit=10&day=0&min_dist=0.5&max_dist=3.0&none=0.09&water=0.3&metals=0.3&hydrogen=0.3&platinum=0.01

Forking

This code is available under the GPL. If you'd like to use this code, or build a different version of the game using the codebase, please do!

Libraries

API

The asteroid API has the following dependencies:

Game

The game would not have been possible in a weekend without some amazing javascript libraries:

Thanks

Thanks to our significant others for giving up weekends to drawid space ships, to NY Space Apps for hosting, to Jason Kessler and Rob Landis for asteroid advice, and to NASA for being wonderful enough to go chasing after asteroids in the first place.