BookmarkSubscribeRSS Feed
bryan_boone

Staff

Joined:

Aug 20, 2015

International Space Station Current Location

This script is a slightly different script posted by Craige:

https://community.jmp.com/t5/Uncharted/Space-Station-Video/ba-p/21322

This script uses the built in HTTP Request JSL object and the Parse JSON method to visualize the current location of the International Space Station using the RestAPI posted here: 

http://open-notify.org/Open-Notify-API/ISS-Location-Now

The Rest endpoint is: http://api.open-notify.org/iss-now.json

and its JSON result looks like:

{
  "message": "success", 
  "timestamp": UNIX_TIME_STAMP, 
  "iss_position": {
    "latitude": CURRENT_LATITUDE, 
    "longitude": CURRENT_LONGITUDE
  }
}

I extract relevant pieces of JSON to populate a JMP Data Table using Parse JSON:

json_jsl = ParseJSON(json);
date = json_jsl["timestamp"];
date = AsDate(Date MDY(1, 1, 1970) + date); //turn into a JMP Date
dt:timestamp[row] = date;
dt:longitude[row] = Num(json_jsl["iss_position"]["longitude"]);
dt:latitude[row] = Num(json_jsl["iss_position"]["latitude"]);

I'm not quite done because I really am interested in knowing the distance travelled between the latitude and longitude lines so I used this algorithm (converted to JSL) http://www.ridgesolutions.ie/index.php/2013/11/14/algorithm-to-calculate-speed-from-two-gps-latitude...

and I calculated the speed in miles per hour (since that's how I think).

 

I set up the JSL Scheduler to query the Rest endpoint every 5 seconds (that's what the site recommends) and create a graph to track the location of the space station.

 

And finally, I decided to have some fun and use images for markers on the graph.

It was a fun experiment.

Enjoy

 

-Bryan

 

Article Labels
Article Tags
Contributors