Skip to content

Map display of real-time lightning strike data from Earth Networks using Python and TCP Socket

Notifications You must be signed in to change notification settings

engelsjk/python-lightning-earthnetworks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 

Repository files navigation

python-lightning-earthnetworks

This script maps real-time lightning strike locations in the continental United States using a TCP socket datafeed of lightning data from Earth Networks.

Animated-Lightning

WHAT

Earth Networks is a provider of global weather data and operates the Earth Networks Total Lightning Network (ENTLN), one of three lightning networks in the United States that provides real-time information about lightning strikes.

Earth Networks provides access to real-time lightning data from the ENTLN via a TCP socket connection, referred to as the ENTLN Data Feed. Note that access to this datafeed is restricted to paying subscribers.

In this script, it is shown how to (i) connect to the ENTLN Data Feed using Python, (ii) parse out lightning data from the JSON payloads received from the TCP socket, and (iii) plot lightning strike locations on a map of the continental United States.

HOW

The Python socket library is used to establish a TCP socket connection to the ENLTN data feed. First, a valid authentication message is sent to the connection. This authentication message includes a ParterID (UUID) provided by Earth Networks either on a trial or subscription basis. Additional data is included to properly configure the datafeed.

Next a while True: loop starts grabbing messages from the socket connection and parsing JSON data payloads. The data payloads include information about each lightning strike, including timestamp, latitude/longitude coordinates, peak current, etc, as shown in an example payload below.

Animated-Lightning

WHY

Once parsed from the socket connection, these data payloads can be used to upload datapoints to a database, trigger other actions, or plot lightning strike locations as in this script.

For example, this script could be used as a simple alerting tool to identify lightning strikes that occur near valuable assets (shown as blue dots in the map below).

Animated-Lightning

About

Map display of real-time lightning strike data from Earth Networks using Python and TCP Socket

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages