Weather Underground - PWS, Data Ingestion and APIs

37
Hello Sensor 1

Transcript of Weather Underground - PWS, Data Ingestion and APIs

Page 1: Weather Underground - PWS, Data Ingestion and APIs

Hello Sensor

1

Page 2: Weather Underground - PWS, Data Ingestion and APIs

Agenda1. Weather Underground Introduction 2. Making Your Own PWS 3. Data Ingestion & QC 4. API

2

Page 3: Weather Underground - PWS, Data Ingestion and APIs

Weather Underground Intro

3

Page 4: Weather Underground - PWS, Data Ingestion and APIs

What is Weather Underground?● Web● Flagship app● Storm● WunderStation● PWS Network● API

4

Page 5: Weather Underground - PWS, Data Ingestion and APIs

Web

● Powered by 200k+weather stations

● Visually engaging● Provides low-level

weather data

5

Page 6: Weather Underground - PWS, Data Ingestion and APIs

Flagship App

● The most hyperlocal forecasts● Data presented in a stunningly

simple interface

6

Page 7: Weather Underground - PWS, Data Ingestion and APIs

Storm

● The best app for the worstweather

● Highest resolution radar● Severe weather alerts

7

Page 8: Weather Underground - PWS, Data Ingestion and APIs

WunderStation

● Personalized weather dashboard

● Features your own PWS data

8

Page 9: Weather Underground - PWS, Data Ingestion and APIs

PWS Network● There are about 12k

government provided weather stations

● We fill in the gaps withover 200k PersonalWeather Stations

9

Page 10: Weather Underground - PWS, Data Ingestion and APIs

Making Your Own PWS

10

Page 11: Weather Underground - PWS, Data Ingestion and APIs

What is a Weather StationTraditional stationsQualitative reporting (crowd reports)Image recognitionPhone SensorsCar sensorsMaker Station

11

Page 12: Weather Underground - PWS, Data Ingestion and APIs

Weather hungry data monstersTo serve globally we need more data-Engage with local met offices (if they exist)-Engage with education/maker community

More data, better data = better forecasts.

12

Page 13: Weather Underground - PWS, Data Ingestion and APIs

Roll your ownOpen source weather stations make IoT and weather more available/flexible for local needs

Can be part of an education program

13

Page 14: Weather Underground - PWS, Data Ingestion and APIs

What does it take1.Sensor (Temp, precip, humidity, uv, etc)2.Controller (arduino, particle, etc) 3.Memory and/or Transmitter (flash,wifi, cellular)4.Power (solar, battery, mains)

14

Page 15: Weather Underground - PWS, Data Ingestion and APIs

Station challengesHardware:1:power (limits everything)2:transmit (expensive power budget item)3:durability (usually moving parts)

4:sensors (minor technical issues)5:controller (very low requirements)

15

Page 16: Weather Underground - PWS, Data Ingestion and APIs

Station challengesBiggest contributor to data variation: Enclosure design

The Effectiveness of the ASOS, MMTS, Gill, and CRS Air Temperature Radiation Shields: K. G. Hubbard, X. Lin, and E. A. Walter-Shea 16

Page 17: Weather Underground - PWS, Data Ingestion and APIs

Tiny wifiTiny wifi connected station

limited battery life

Used to monitor terrarium

17

Page 18: Weather Underground - PWS, Data Ingestion and APIs

Ol faithfulGood reliability, online over a yearSolar and battery powered

Enclosure made from ~$6 garden supplies

Particle Photon (WiFi)

Spark Fun Weather Shield -HTU21D humidity sensor-MPL3115A2 pressure sensor

18

Page 19: Weather Underground - PWS, Data Ingestion and APIs

Cell-o thereParticle Electron: cell radio + microcontroller BMP280: temp, humidity, pressure sensorEnclosure made from a painted soda cup

Data is good if kept in shade however: no venting = heat buildupok proof of concept, needs refinement

19

Page 20: Weather Underground - PWS, Data Ingestion and APIs

Data Ingestion & QC

20

Page 21: Weather Underground - PWS, Data Ingestion and APIs

Ingestion

Rapidfire● Ingests and stores data reported at rates as fast as one observation

every 2 seconds● Stores data in current condition file, records history data at as high

resolution as once every 5 seconds

21

Page 22: Weather Underground - PWS, Data Ingestion and APIs

Quality Control (QC)Before QC

22

Page 23: Weather Underground - PWS, Data Ingestion and APIs

Quality Control (QC)After QC

23

Page 24: Weather Underground - PWS, Data Ingestion and APIs

Quality Control (QC)

24

Page 25: Weather Underground - PWS, Data Ingestion and APIs

The QC Checks

● Range Check● Stuck Sensor Check● Neighbor Check

25

Page 26: Weather Underground - PWS, Data Ingestion and APIs

Range CheckHave these readings ever happened on Earth?

Temperature < -130º F or > 135º F.Dew Point < -90º F or > 90º F.

Wind Speed < 0 mph or > 279 mph. Wind Direction < 0º or > 360º.

Pressure < 846 inHg or > 1100 inHg.

26

Page 27: Weather Underground - PWS, Data Ingestion and APIs

Stuck Sensor CheckHas the temperature changed in the past 6 hours?

● by at least 0.1°F● lack of change is often an indication of

other stuck sensors as well

27

Page 28: Weather Underground - PWS, Data Ingestion and APIs

Neighbor CheckIs the temperature of this station similar to the majority of stations nearby?

● collect sensors in 15 km of current sensor● find clusters divided by 3° F● determine majority cluster(s)● throw out statistical outliers

Most essential customer-facing check

28

Page 29: Weather Underground - PWS, Data Ingestion and APIs

Neighbor Check

29

Page 30: Weather Underground - PWS, Data Ingestion and APIs

The Next Step - QC on Ingest● Current QC

○ cycle is 15 minutes, allowing bad observations to linger on the site and apps during that time

○ written in difficult to maintain and extend multi-threaded C++ code

● IBM Streams + QC○ clean obs all the time○ written in single threaded Python with better performance, stability,

extensibility, third-party libraries like Spark, and support for modern technologies like JSON and REST

30

Page 31: Weather Underground - PWS, Data Ingestion and APIs

API

31

Page 32: Weather Underground - PWS, Data Ingestion and APIs

200,000+ Personal Weather Stations

2.2 Billion forecast locations | 180 M consumers / month 32

Page 33: Weather Underground - PWS, Data Ingestion and APIs

33

Page 34: Weather Underground - PWS, Data Ingestion and APIs

Uptime: 99.95 % Latency ~25 ms

Autoscale to 20B requests per day

Scalability Average 10s of Billions requests per day

Global Coverage (US East, US West, EU, Asia)

Partial DeploymentsVersioned artifacts and rollbacks

Faster code to prod: Less dependency b/w teams

Your favorite tech / language here

34

Page 35: Weather Underground - PWS, Data Ingestion and APIs

Architecture: Storage Polyglot

Real time data and caching

Historical weather data Data Migration

Gateway Data Analytics

ArchivesImagesVideos

AnalyticsInformatica

Drupal

35

Page 36: Weather Underground - PWS, Data Ingestion and APIs

Thank you!

36

Page 37: Weather Underground - PWS, Data Ingestion and APIs

Questions?

37