Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct typo, adjust markdown for js/python #35

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 22 additions & 27 deletions ISS-Location-Now/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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

<http://api.open-notify.org/iss-now.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.
Expand All @@ -44,33 +42,31 @@ Appending a callback request to the query string will return JSONP:

<http://api.open-notify.org/iss-now.json?callback=CALLBACK>

{% 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

Expand All @@ -85,21 +81,20 @@ print obj['iss_position']['latitude'], obj['data']['iss_position']['latitude']
# Example prints:
# 1364795862
# -47.36999493 151.738540034
{% endhighlight %}

```

## Data Source

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:

- <http://spaceflight.nasa.gov/realdata/sightings/SSapplications/Post/JavaSSOP/orbit/ISS/SVPOST.html>
- <http://spaceflight.nasa.gov/realdata/sightings/SSapplications/Post/JavaSSOP/orbit/ISS/SVPOST.html>

Another popular site for tacking data is celstrak which published NORAD
TLE's:

- <http://www.celestrak.com/NORAD/elements/stations.txt>
- <http://www.celestrak.com/NORAD/elements/stations.txt>

In both cases a "[Two Line Element](http://en.wikipedia.org/wiki/Two-line_element_set)"
is used, which contains enough
Expand Down
35 changes: 14 additions & 21 deletions ISS-Pass-Times/index.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -40,26 +38,25 @@ 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 | <span class="label label-important">YES</span>
_Longitude_ | The longitude of the place to predict passes | `lon` | `-180..180` | degrees | <span class="label label-important">YES</span>
_Altitude_ | The altitude of the place to predict passes | `alt` | `0..10,000` | meters | <span class="label">No</span>
_Number_ | The number of passes to return | `n` | `1..100` | &ndash; | <span class="label">No</span>

Inptut | Description | Query string | Valid Range | Units | Required?
---------- | -------------------------------------------- | ------------ | ----------- | ------- | ---------
_Latitude_ | The latitude of the place to predict passes | `lat` | `-80..80` | degrees | <span class="label label-important">YES</span>
_Longitude_ | The longitude of the place to predict passes | `lon` | `-180..180` | degrees | <span class="label label-important">YES</span>
_Altitude_ | The altitude of the place to predict passes | `alt` | `0..10,000` | meters | <span class="label">No</span>
_Number_ | The number of passes to return | `n` | `1..100` | &ndash; | <span class="label">No</span>

## Output

### JSON

<http://api.open-notify.org/iss-pass.json?lat=LAT&lon=LON>

{% highlight javascript %}
```json
{
"message": "success",
"request": {
"latitude": LATITUE,
"longitude": LONGITUDE,
"latitude": LATITUDE,
"longitude": LONGITUDE,
"altitude": ALTITUDE,
"passes": NUMBER_OF_PASSES,
"datetime": REQUEST_TIMESTAMP
Expand All @@ -69,20 +66,20 @@ _Number_ | The number of passes to return | `n` | `1..
...
]
}
{% endhighlight %}
```

### JSONP

Appending a callback request to the query string will return JSONP:

<http://api.open-notify.org/iss-pass.json?lat=LAT&lon=LON&callback=CALLBACK>

{% highlight javascript %}
```javascript
CALLBACK({
"message": "success",
"request": {
"latitude": LATITUE,
"longitude": LONGITUDE,
"latitude": LATITUDE,
"longitude": LONGITUDE,
"altitude": ALTITUDE,
"passes": NUMBER_OF_PASSES,
"datetime": REQUEST_TIMESTAMP
Expand All @@ -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.