How does it work?

PeepWeather shows the upcoming week's forecast in a familiar "traffic light" color coding of each hour, formatted as a calendar-like table. A green square means the weather looks Great, yellow is Okay, orange is Fair, and red is just plain Poor. By simply looking at the colors you can tell at a glance how the week is shaping up.

In addition, PeepWeather augments the colors by showing icons in each square that indicate concerns, including increased probability of precipitation, low or high temperatures, windiness, and cloud cover. These give you some additional detail if you want it. Think of the icons as hints about what made an hour not green. (Note that icons can be disabled in settings.)

Details are below about how those weather parameters - probability of precipitation, temperature, and windiness - get combined into one color, but in a nutshell the parameters "add up" - the more bad ones there are, the worse the color is.

(Cloud cover is treated specially and does not influence color. Instead it's a secondary consideration for you and is shown as adjunct information in the form of an icon. That's why some green days will have a cloud icon. This way you can factor in sky cover given your preferences.)

Overall operation

When you enter a location, PeepWeather converts it to a latitude and longitude and then passes that to a query of the U.S. Government's National Digital Forecast Database REST Web Service. It processes the result to find hourly data, filling in gaps for missing hours. (Some weather information is only available on a three-hour or 12-hour schedule, for example.) Finally it builds a hourly calendar-like table for display on the page, coloring in each hour using the below algorithm.

Color calculation details

Each hour's color is chosen in three steps:

  1. First, each weather parameter (percent of precipitation, temperature, and wind speed - but not cloud cover) is assessed individually to get one of three desirability ratings - Low, Medium, and High - based on a simple formula.
  2. Second, those three ratings are combined to get one of four overall desirability ratings for the hour - Poor, Fair, Okay, and Great.
  3. Finally, the overall desirability rating is mapped to a color: Great = green, Okay = yellow, Fair = Orange, and Poor = red.

Put another way, there are two types of functions involved: One to convert each of the three parameter values into a Low, Medium, and High rating, and a second one to combine these into a Poor, Fair, Okay, and Great rating for the hour. We call these the Parameter Function and the Hourly Function. To learn more, keep reading!

Parameter Function

On this site, the Parameter Function breaks the parameter (percent of precipitation, temperature, wind speed, or cloud cover) into ranges that determine the rating. An example might be that if wind is between 0 MPH and 8 MPH then consider that desirability High. If it is between 8 MPH and 12 MPH consider it Medium desirable, and if it's higher than 12 MPH then its desirability is Low. Percent of precipitation would work similarly, for example: 0% to 10% might be High desirability, 10% to 30% Medium, and Low for anything higher than 30%. Both of these can be visualized as essentially three "steps", graphically shown as:

H +--+
  |  |
M |  +---+
  |      |
L +      +--->

     v1  v2

This makes clear that all it takes is two parameter values (called v1 and v2 above) to identify the range. When viewed from left to right, v1 is the High-to-Medium transition, and v2 is the Medium-to-Low transition. In the wind example, v1 = 8 MPH and v2 = 12 MPH. And the precipitation example had 10% and 30% for v1 and v2, respectively. In other words, these two numbers identify the 'breaks' where the steps go down from left to right. We call this first type of Parameter Function "H-M-L". Here are the default functions for the three "H-M-L" parameters (percent of precipitation, wind speed, and cloud cover):

But what about temperature? Well, temperature is different because it has a low range too - it can't be too cold OR too warm, but between those two Low-desirability extremes there are Medium and High values. Our Parameter Function for temperature has a "hat" shape:

H         +---+
          |   |
M     +---+   +---+
      |           |
L <- -+           +--->

      v1  v2  v3  v4

We call this Parameter Function "L-M-H-M-L", and it is characterized by four values, from left to right: v1 (the L-to-M transition), v2 (Medium-to-High), v3 (High-to-Medium), and v4 (Medium-to-Low). For example, the four values 35, 59, 89, and 100 (all °F) say that anything colder than 35°F or warmer than 100°F are considered Low desirability, Medium is between 35 and 59, and between 89 and 100, and the 59 to 89 sweet spot is High desirability. Simple! Here is the default function for our only "L-M-H-M-L" parameter - temperature:

That describes the two kinds of Parameter Functions. Now let's look at how those are combined by the Hourly Function.

Hourly Function

For each hour, once the program uses the Parameter Functions to get Low, Medium, and High values for the weather parameters, it runs them through an Hourly Function to get the Poor, Fair, Okay, or Great hour rating. Currently this is determined by non-editable rules:

The weather parameters are treated equally and are not weighted in any way.

Changing the defaults

To change the default values shown above, use the settings page: