diff --git a/ISS-Location-Now/index.markdown b/ISS-Location-Now/index.markdown index 79ec755..35b270a 100644 --- a/ISS-Location-Now/index.markdown +++ b/ISS-Location-Now/index.markdown @@ -10,30 +10,28 @@ The [International Space Station](http://en.wikipedia.org/wiki/International_Spa is moving at close to 28,000 km/h so its location changes really fast! Where is it right now? - ## Overview This is a simple api to return the current location of the ISS. It returns the current latitude and longitude of the space station with a unix timestamp for the time the location was valid. This API takes no inputs. - ## Output ### JSON -{% highlight javascript %} +```json { - "message": "success", - "timestamp": UNIX_TIME_STAMP, - "iss_position": { - "latitude": CURRENT_LATITUDE, - "longitude": CURRENT_LONGITUDE - } + "message": "success", + "timestamp": UNIX_TIME_STAMP, + "iss_position": { + "latitude": CURRENT_LATITUDE, + "longitude": CURRENT_LONGITUDE + } } -{% endhighlight %} +``` The `data` payload has a `timestamp` and an `iss_position` object with the latitude and longitude. @@ -44,33 +42,31 @@ Appending a callback request to the query string will return JSONP: -{% highlight javascript %} +```javascript CALLBACK({ - "message": "success", - "timestamp": UNIX_TIME_STAMP, - "iss_position": { - "latitude": CURRENT_LATITUDE, - "longitude": CURRENT_LONGITUDE - } -}) -{% endhighlight %} - + message: "success", + timestamp: UNIX_TIME_STAMP, + iss_position: { + latitude: CURRENT_LATITUDE, + longitude: CURRENT_LONGITUDE, + }, +}); +``` ## Poll Rate Please note that there is an inherent uncertainty in the ISS position models that is usually larger than one second. In addition the position is only calculated once per second (the maximum resolution of an integer unix time stamp). So polling -more than 1 Hz would be useless except to add unnessisary strain to the servers. +more than 1 Hz would be useless except to add unnecessary strain to the servers. A single client should try and keep polling to about once every 5 seconds. - ## Examples Here is an example reading the API in python: -{% highlight python %} +```python import urllib2 import json @@ -85,8 +81,7 @@ print obj['iss_position']['latitude'], obj['data']['iss_position']['latitude'] # Example prints: # 1364795862 # -47.36999493 151.738540034 -{% endhighlight %} - +``` ## Data Source @@ -94,12 +89,12 @@ The ISS is tracked by several agencys. Both [NORAD](http://www.norad.mil/) and NASA periodically publish data about the station. I scrape this page for this API: - - +- Another popular site for tacking data is celstrak which published NORAD TLE's: - - +- In both cases a "[Two Line Element](http://en.wikipedia.org/wiki/Two-line_element_set)" is used, which contains enough diff --git a/ISS-Pass-Times/index.markdown b/ISS-Pass-Times/index.markdown index 055821f..a3e0e78 100644 --- a/ISS-Pass-Times/index.markdown +++ b/ISS-Pass-Times/index.markdown @@ -6,7 +6,6 @@ title: Open Notify -- API Doc | ISS Pass Times # International Space Station Pass Times - The international space station (ISS) is an orbital outpost circling high above out heads. Sometimes it’s overhead, but when? It depends on your location. Given a location on Earth (latitude, longitude, and altitude) this API will compute @@ -22,7 +21,6 @@ This is because the orbit of the ISS decays unpredictably over time and because station controllers periodically move the station to higher and lower orbits for docking, re-boost, and debris avoidance. - ## Overview The API returns a list of upcoming ISS passes for a particular location @@ -40,13 +38,12 @@ pass has a duration in seconds and a rise time as a unix time stamp. This API has 2 required input values and 2 optional ones. {: .table .table-hover} - Inptut | Description | Query string | Valid Range | Units | Required? - ---------- | -------------------------------------------- | ------------ | ----------- | ------- | --------- -_Latitude_ | The latitude of the place to predict passes | `lat` | `-80..80` | degrees | YES -_Longitude_ | The longitude of the place to predict passes | `lon` | `-180..180` | degrees | YES -_Altitude_ | The altitude of the place to predict passes | `alt` | `0..10,000` | meters | No -_Number_ | The number of passes to return | `n` | `1..100` | – | No - +Inptut | Description | Query string | Valid Range | Units | Required? +---------- | -------------------------------------------- | ------------ | ----------- | ------- | --------- +_Latitude_ | The latitude of the place to predict passes | `lat` | `-80..80` | degrees | YES +_Longitude_ | The longitude of the place to predict passes | `lon` | `-180..180` | degrees | YES +_Altitude_ | The altitude of the place to predict passes | `alt` | `0..10,000` | meters | No +_Number_ | The number of passes to return | `n` | `1..100` | – | No ## Output @@ -54,12 +51,12 @@ _Number_ | The number of passes to return | `n` | `1.. -{% highlight javascript %} +```json { "message": "success", "request": { - "latitude": LATITUE, - "longitude": LONGITUDE, + "latitude": LATITUDE, + "longitude": LONGITUDE, "altitude": ALTITUDE, "passes": NUMBER_OF_PASSES, "datetime": REQUEST_TIMESTAMP @@ -69,7 +66,7 @@ _Number_ | The number of passes to return | `n` | `1.. ... ] } -{% endhighlight %} +``` ### JSONP @@ -77,12 +74,12 @@ Appending a callback request to the query string will return JSONP: -{% highlight javascript %} +```javascript CALLBACK({ "message": "success", "request": { - "latitude": LATITUE, - "longitude": LONGITUDE, + "latitude": LATITUDE, + "longitude": LONGITUDE, "altitude": ALTITUDE, "passes": NUMBER_OF_PASSES, "datetime": REQUEST_TIMESTAMP @@ -92,12 +89,8 @@ CALLBACK({ ... ] }) -{% endhighlight %} - +``` The values used to calculate the upcoming passes are returned in the `request` object. The `response` is a list of the timestamp or each pass along with the `duration` in seconds. - - -