2

I use WUnderground API to retrieve hourly forecast. Here is a part of the json, returned by WUndergound API:

"qpf":{
    "english":"0.02",
    "metric":"1"
},
"snow":{
    "english":"0.0",
    "metric":"0"
}

And I don't know how to understand english/metric fields for snow and qpf. Are they in inches/millimeters or inches/centimeters or something else? Precipitation is usually specified in cm/mm for the metric system and in inches for imperial. But:

1 cm != 0.02 inches && 1 mm != 0.02 inches.

I have no guesses.

popov895
  • 61
  • 8

2 Answers2

0

I think it might be an inconsistency in the API

http://www.wunderground.com/weather/api/d/docs?d=data/forecast&MR=1 and then over at "Examples" http://api.wunderground.com/api/Your_Key/forecast/q/CA/San_Francisco.json

gives:

[...]
"qpf_allday": {
   "in": 0.00,
   "mm": 0.0
},
"qpf_day": {
   "in": 0.00,
   "mm": 0.0
},
"qpf_night": {
   "in": 0.00,
   "mm": 0.0
},
[...]

So it indicates the unit as well.

Also, qpf is

The Quantitative Precipitation Forecast (abbreviated QPF) is the expected amount of melted precipitation accumulated over a specified time period over a specified area.

Source: https://en.wikipedia.org/wiki/Quantitative_precipitation_forecast

Update:
According to (i'd like to say "Docs", but no) this link:
https://apicommunity.wunderground.com/weatherapi/topics/where_can_i_find_a_small_description_of_the_response_fields#reply-9602171-author

qpf - quantitative precipitation forecast. How much rain will fall in the 3 hour period

Alex Tartan
  • 6,736
  • 10
  • 34
  • 45
0

I believe, it must be the same, as for daily forecast:

  • snow.english in inches
  • snow.metric in centimeters
  • qpf.english in inches
  • qpf.metric in millimeters

But, here are more examples:

"qpf":{
    "english":"0.02",
    "metric":"1"
},
"snow":{
    "english":"0.2",
    "metric":"5"
}

"qpf":{
    "english":"0.01",
    "metric":"0"
},
"snow":{
    "english":"0.1",
    "metric":"3"
}

"qpf":{
    "english":"0.02",
    "metric":"1"
},
"snow":{
    "english":"0.0",
    "metric":"0"
}

If we assume that snow.english and qpf.english are in inches, then:
0.2 in = 5 mm and 0.1 in = 2.5 (3) mm
but
0.02 in != 1 mm and 0.01 in != 0 mm
I guess, that snow.metric is in millimeters and qpf.metric is in...I don't know. It seems, that WUnerground API returns wrong data for snow and qpf in hourly forecast.

To note:

  • 1 mm of rain = 1 liter per square meter;
  • 1 in of rain = 27.154 gallons per acre.
popov895
  • 61
  • 8
  • @popov985 `snow.metric` and `qpf.metric` are both in mm. When it snows there is both a `qpf.metric` value (melted snow) and a `snow.metric` value, which is the amount if (unmelted) snow. – sweet potato Jan 18 '16 at 20:47
  • @sweetpotato, I'm not sure of the correctness of your assumption, because the depth of snow is normally measured in centimetres. Anyway, I don't understand why `qpf.metric` does not meet `qpf.english`. – popov895 Jan 21 '16 at 18:31