Nasa Weather Events

I was 🚢🛳⛴ through twitter & saw that @shannon_crabill posted about nasa having an Application Programming Interface. I wanted to see what was there.

import pandas, geoviews.feature, hvplot.pandas, bs4 as soup, requests; __import__('requests_cache').install_cache('nasa'); __import__('holoviews').extension('matplotlib')
</img> </img>

nasa provides services for the information in the table below.

pandas.read_json('https://api.nasa.gov/assets/json/apis.json').set_index('name')['summary'.split()]
summary
name
APOD Astronomy Picture of the Day
Asteroids NeoWs Near Earth Object Web Service
DONKI Space Weather Database Of Notifications, Knowl...
Earth Unlock the significant public investment in ea...
EONET The Earth Observatory Natural Event Tracker
EPIC Earth Polychromatic Imaging Camera
Exoplanet Programmatic access to NASA's Exoplanet Archiv...
GeneLab Search Programmatic interface for GeneLab's public da...
Insight Mars Weather Service API
Mars Rover Photos Image data gathered by NASA's Curiosity, Oppor...
NASA Image and Video Library API to access the NASA Image and Video Library...
Patents Structured, searchable developer access to NAS...
Satellite Situation Center System to cast geocentric spacecraft location ...
SSD/CNEOS Solar System Dynamics and Center for Near-Eart...
Techport API to make NASA technology project data avail...
TLE API Two line element data for earth-orbiting objec...
Vesta/Moon/Mars Trek WMTS A Web Map Tile Service for the Vesta, Moon, an...

The cell below explores "EONET" - The Earth Observatory Natural Event Tracker using pandas & hvplot.

df = pandas.read_json("https://eonet.sci.gsfc.nasa.gov/api/v2.1/events?limit=10000")['events'].apply(pandas.Series).set_index('id')
df = df.categories.apply(pandas.Series).stack().apply(pandas.Series).reset_index(1, drop=True).title.rename('event').pipe(df.join); del df['categories']
df = df.geometries.apply(pandas.Series).stack().apply(pandas.Series).join(df).reset_index(-1, drop=True); del df['geometries']
df = df.coordinates.apply(pandas.Series).rename(columns=dict(zip((0,1), "xy"))).join(df); del df['coordinates']
df.date = pandas.to_datetime(df.date)
df = df[df.x.apply(lambda x: not isinstance(x, list))]
(geoviews.feature.ocean * geoviews.feature.borders * df.hvplot.scatter('x', 'y', geo=True, color='event', alpha=.4, size=300)).opts(fig_inches=20)
Written on September 25, 2019