Visualizing Asteroids in Python with Bokeh and NASA APIs

Visualizing Asteroids in Python with Bokeh and NASA APIs

In this article, we'll dig into an API that, like the one above, returns NASA data in JSON format. We’ll explore a small portion of all the available information provided through NASA Open APIs. We'll visualize that data with a Python library called Bokeh to help contextualize it for the viewer.

A GET request to the Astronomy Picture of the Day (APOD) web service on September 18, 2020, returned the above photo of the spiral galaxy Arp 78. APOD is one of many APIs available through NASA Open APIs. Like APOD, some include imagery, such as the Earth Polychromatic Imaging Camera (EPIC) API, which returns images like this:

Others include data. The Coronal Mass Ejection Analysis API, which is part of the DONKI suite of space weather forecasting tools, returns data that looks like this:

[
   {
      "time21_5":"2016-09-06T14:18Z",
      "latitude":-20.0,
      "longitude":120.0,
      "halfAngle":31.0,
      "speed":674.0,
      "type":"C",
      "isMostAccurate":true,
      "associatedCMEID":"2016-09-06T08:54:00-CME-001",
      "note":"",
      "catalog":"SWRC_CATALOG",
      "link":"https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CMEAnalysis/11233/-1"
   },
   {
      "time21_5":"2016-09-15T04:24Z",
      "latitude":-18.0,
      "longitude":-122.0,
      "halfAngle":43.0,
      "speed":722.0,
      "type":"C",
      "isMostAccurate":true,
      "associatedCMEID":"2016-09-14T23:36:00-CME-001",
      "note":"Measured with swpc_cat using C3 and STA Cor2 imagery.",
      "catalog":"SWRC_CATALOG",
      "link":"https://kauai.ccmc.gsfc.nasa.gov/DONKI/view/CMEAnalysis/11256/-1"
   }
]

In this article, we'll dig into an API that, like the one above, returns NASA data in JSON format. We’ll explore a small portion of all the available information provided through NASA Open APIs. We'll visualize that data with a Python library called Bokeh to help contextualize it for the viewer.

Check out the [interactive visualization_](http://acw-bucket.s3-website-us-west-1.amazonaws.com/?ref=hackernoon.com) created in this tutorial or [see the code_](https://github.com/OnTheATeam/NASA_NeoW?ref=hackernoon.com)_ on GitHub._

python astronomy programming nasa visualization coding space hackernoon-top-story

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Python Programming: A Beginner’s Guide

Python is an interpreted, high-level, powerful general-purpose programming language. You may ask, Python’s a snake right? and Why is this programming language named after it?

What Are The New Features in Python 3.9?

It’s that time again, a new version of Python is imminent. Now in beta (3.9.0b3), we will soon be seeing the full release of Python 3.9.

How To Avoid n00b Programming Mistakes?

To become a Senior Java Developer, I’ve been learning Java for many years and still I’m not gonna stop learning as actual coding never stops teaching. I’ve also been teaching it for over seven years now. Just fancy how many mistakes I’ve already made myself and how many I’ve watched my students doing. I am pretty sure now I know a hundred wrong ways of learning to code (as well as dozens of the right ones).

Guide to Python Programming Language

Guide to Python Programming Language

Generate QR Code using Python — Python Programming — PyShark

This article will explore how to generate QR code in Python and some useful creation features from pyqrcode library. QR codes recently became more popular than ever before, yet few people know that the first iterations of QR codes were created back in 1990s in Japan for the automotive industry.