3-Day forcast inconsistencies and strange behavior

  • 1
  • Problem
  • Updated 3 years ago
I have been using the 3-day forecast (in xml) to update a screen with icons and textual forecast for "today" and "tomorrow". These forecasts are combined with current conditions and a bunch of weather parameters from a local weatherstation.

I've noticed a couple a weird problems:

1) There seems to be 2 textual forcasts per day (with corresponding icons): one for "day" and one for "night" (although they are only the first and second forecasts, the icons are without and with the "nt_" prefix). So in my naivety, I decided to combine the "day" forecast and "night" forecast together with an "Evening:" between them.  This almost works, since the "day" forecast talks about "high" temps and the night forecast talks about "low" temps -- in the morning.

Unfortunately, some time mid-afternoon the "day" forecast starts talking about "low" temps and "overnight" conditions while the "night" forecast continues to be the same type of information (low temps, etc) as it has been all day. Is there some well-defined thing I can use to recognize that this is happening, or do I just need to look for the word "overnight" to trigger discarding on of the two forecasts?  (Note that the word "overnight" does not seem to appear in the metric version of the textual forcast, BTW!).

2) The Fahrenheit and Celsius values for "high" and "low" temps don't seem to match up.  My system takes in one unit and converts (on demand) to the desired unit.  However, this always results in the computed value not matching what is given in the textual forecast!  It appears that the Celsius values are low by 1 degree -- no matter how I convert and/or round.  Has anyone else noticed this problem?  (It is a problem, since the I don't do any mathematical conversions on the textual forecast, but I want to be able to treat that actual high/low temps just like all the other parameters I receive from my local weatherstation...!
Photo of John Kubiatowicz

John Kubiatowicz

  • 5 Posts
  • 0 Reply Likes

Posted 3 years ago

  • 1
Photo of John Kubiatowicz

John Kubiatowicz

  • 5 Posts
  • 0 Reply Likes
Note also, that the English and Metric textual forecasts are almost never equal!  They are different in lots of little ways.  Seems a bit weird to me...
Photo of John Kubiatowicz

John Kubiatowicz

  • 5 Posts
  • 0 Reply Likes
Ping. Anyone else noticed these issues?
Photo of Tim Roche

Tim Roche, Official Rep

  • 297 Posts
  • 22 Reply Likes
please provide URLs and examples so we can diagnose the problem
Photo of John Kubiatowicz

John Kubiatowicz

  • 5 Posts
  • 0 Reply Likes
Here you go:

URL: http://api.wunderground.com/api/{your key here}/forecast/q/CA/Lafayette.xml

It seems to be somewhat better as if someone worked to fix the consistency a bit.  However, you can still see the problem if you look at period 3 of the <txt_forecast>, where the low is 64F, but 17C.  64F=>17.7 deg C and 17C=> 62.6 deg C.  No direction of conversion is consistent.  Further, the corresponding <simpleforecast> shows a low of 64F, 18C.  -- which is self consistent but not consistent with the textual forecast. 

This doesn't happen all the time, but it happens enough to be annoying. It would be nice if (1) one unit was considered primary (say English units) and the second (say metric) was computable from the first. (2) It would be nice if <txt_forecast> and <simpleforcast> were consistent.
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <version>0.1</version>
  <termsofService>http://www.wunderground.com/weather/api/d/terms.html</termsofService>
  <features>
    <feature>forecast</feature>
  </features>
  <forecast>
    <txt_forecast>
      <date>11:33 AM PDT</date>
      <forecastdays>
        <forecastday>
          <period>0</period>
          <icon>clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/clear.gif</icon_url>
          <title>Tuesday</title>
          <fcttext><![CDATA[Plentiful sunshine. High 101F. Winds NW at 10 to 15 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Abundant sunshine. High 38C. Winds NW at 15 to 25 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>1</period>
          <icon>nt_clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/nt_clear.gif</icon_url>
          <title>Tuesday Night</title>
          <fcttext><![CDATA[A clear sky. Low 62F. Winds WSW at 5 to 10 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Clear skies. Low 17C. Winds W at 10 to 15 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>2</period>
          <icon>clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/clear.gif</icon_url>
          <title>Wednesday</title>
          <fcttext><![CDATA[Mainly sunny. High 104F. Winds NNW at 10 to 15 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Mainly sunny. High near 40C. Winds NNW at 15 to 25 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>3</period>
          <icon>nt_clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/nt_clear.gif</icon_url>
          <title>Wednesday Night</title>
          <fcttext><![CDATA[Clear skies. Low 64F. Winds WSW at 5 to 10 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Clear skies. Low 17C. Winds WSW at 10 to 15 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>4</period>
          <icon>partlycloudy</icon>
          <icon_url>http://icons.wxug.com/i/c/k/partlycloudy.gif</icon_url>
          <title>Thursday</title>
          <fcttext><![CDATA[Some clouds in the morning will give way to mainly sunny skies for the afternoon. High 103F. Winds NW at 10 to 15 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Some clouds in the morning will give way to mainly sunny skies for the afternoon. High 39C. Winds NW at 15 to 25 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>5</period>
          <icon>nt_clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/nt_clear.gif</icon_url>
          <title>Thursday Night</title>
          <fcttext><![CDATA[Clear skies. Low 66F. Winds WSW at 5 to 10 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Clear. Low 19C. Winds W at 10 to 15 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>6</period>
          <icon>clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/clear.gif</icon_url>
          <title>Friday</title>
          <fcttext><![CDATA[A mainly sunny sky. High 101F. Winds W at 10 to 15 mph.]]></fcttext>
          <fcttext_metric><![CDATA[Sunny. High 38C. Winds W at 15 to 25 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
        <forecastday>
          <period>7</period>
          <icon>nt_clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/nt_clear.gif</icon_url>
          <title>Friday Night</title>
          <fcttext><![CDATA[A mostly clear sky. Low 64F. Winds WSW at 10 to 15 mph.]]></fcttext>
          <fcttext_metric><![CDATA[A mostly clear sky. Low 18C. Winds WSW at 15 to 25 km/h.]]></fcttext_metric>
          <pop>0</pop>
        </forecastday>
      </forecastdays>
    </txt_forecast>
    <simpleforecast>
      <forecastdays>
        <forecastday>
          <date>
            <epoch>1441764000</epoch>
            <pretty_short>7:00 PM PDT</pretty_short>
            <pretty>7:00 PM PDT on September 08, 2015</pretty>
            <day>8</day>
            <month>9</month>
            <year>2015</year>
            <yday>250</yday>
            <hour>19</hour>
            <min>00</min>
            <sec>0</sec>
            <isdst>1</isdst>
            <monthname>September</monthname>
            <monthname_short>Sep</monthname_short>
            <weekday_short>Tue</weekday_short>
            <weekday>Tuesday</weekday>
            <ampm>PM</ampm>
            <tz_short>PDT</tz_short>
            <tz_long>America/Los_Angeles</tz_long>
          </date>
          <period>1</period>
          <high>
            <fahrenheit>101</fahrenheit>
            <celsius>38</celsius>
          </high>
          <low>
            <fahrenheit>62</fahrenheit>
            <celsius>17</celsius>
          </low>
          <conditions>Clear</conditions>
          <icon>clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/clear.gif</icon_url>
          <skyicon />
          <pop>0</pop>
          <qpf_allday>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_allday>
          <qpf_day>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_day>
          <qpf_night>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_night>
          <snow_allday>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_allday>
          <snow_day>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_day>
          <snow_night>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_night>
          <maxwind>
            <mph>15</mph>
            <kph>24</kph>
            <dir>NW</dir>
            <degrees>316</degrees>
          </maxwind>
          <avewind>
            <mph>10</mph>
            <kph>16</kph>
            <dir>NW</dir>
            <degrees>316</degrees>
          </avewind>
          <avehumidity>12</avehumidity>
          <maxhumidity>0</maxhumidity>
          <minhumidity>0</minhumidity>
        </forecastday>
        <forecastday>
          <date>
            <epoch>1441850400</epoch>
            <pretty_short>7:00 PM PDT</pretty_short>
            <pretty>7:00 PM PDT on September 09, 2015</pretty>
            <day>9</day>
            <month>9</month>
            <year>2015</year>
            <yday>251</yday>
            <hour>19</hour>
            <min>00</min>
            <sec>0</sec>
            <isdst>1</isdst>
            <monthname>September</monthname>
            <monthname_short>Sep</monthname_short>
            <weekday_short>Wed</weekday_short>
            <weekday>Wednesday</weekday>
            <ampm>PM</ampm>
            <tz_short>PDT</tz_short>
            <tz_long>America/Los_Angeles</tz_long>
          </date>
          <period>2</period>
          <high>
            <fahrenheit>104</fahrenheit>
            <celsius>40</celsius>
          </high>
          <low>
            <fahrenheit>64</fahrenheit>
            <celsius>18</celsius>
          </low>
          <conditions>Clear</conditions>
          <icon>clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/clear.gif</icon_url>
          <skyicon />
          <pop>0</pop>
          <qpf_allday>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_allday>
          <qpf_day>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_day>
          <qpf_night>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_night>
          <snow_allday>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_allday>
          <snow_day>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_day>
          <snow_night>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_night>
          <maxwind>
            <mph>15</mph>
            <kph>24</kph>
            <dir>NNW</dir>
            <degrees>337</degrees>
          </maxwind>
          <avewind>
            <mph>10</mph>
            <kph>16</kph>
            <dir>NNW</dir>
            <degrees>337</degrees>
          </avewind>
          <avehumidity>18</avehumidity>
          <maxhumidity>0</maxhumidity>
          <minhumidity>0</minhumidity>
        </forecastday>
        <forecastday>
          <date>
            <epoch>1441936800</epoch>
            <pretty_short>7:00 PM PDT</pretty_short>
            <pretty>7:00 PM PDT on September 10, 2015</pretty>
            <day>10</day>
            <month>9</month>
            <year>2015</year>
            <yday>252</yday>
            <hour>19</hour>
            <min>00</min>
            <sec>0</sec>
            <isdst>1</isdst>
            <monthname>September</monthname>
            <monthname_short>Sep</monthname_short>
            <weekday_short>Thu</weekday_short>
            <weekday>Thursday</weekday>
            <ampm>PM</ampm>
            <tz_short>PDT</tz_short>
            <tz_long>America/Los_Angeles</tz_long>
          </date>
          <period>3</period>
          <high>
            <fahrenheit>103</fahrenheit>
            <celsius>39</celsius>
          </high>
          <low>
            <fahrenheit>66</fahrenheit>
            <celsius>19</celsius>
          </low>
          <conditions>Partly Cloudy</conditions>
          <icon>partlycloudy</icon>
          <icon_url>http://icons.wxug.com/i/c/k/partlycloudy.gif</icon_url>
          <skyicon />
          <pop>0</pop>
          <qpf_allday>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_allday>
          <qpf_day>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_day>
          <qpf_night>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_night>
          <snow_allday>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_allday>
          <snow_day>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_day>
          <snow_night>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_night>
          <maxwind>
            <mph>15</mph>
            <kph>24</kph>
            <dir>NW</dir>
            <degrees>304</degrees>
          </maxwind>
          <avewind>
            <mph>11</mph>
            <kph>18</kph>
            <dir>NW</dir>
            <degrees>304</degrees>
          </avewind>
          <avehumidity>24</avehumidity>
          <maxhumidity>0</maxhumidity>
          <minhumidity>0</minhumidity>
        </forecastday>
        <forecastday>
          <date>
            <epoch>1442023200</epoch>
            <pretty_short>7:00 PM PDT</pretty_short>
            <pretty>7:00 PM PDT on September 11, 2015</pretty>
            <day>11</day>
            <month>9</month>
            <year>2015</year>
            <yday>253</yday>
            <hour>19</hour>
            <min>00</min>
            <sec>0</sec>
            <isdst>1</isdst>
            <monthname>September</monthname>
            <monthname_short>Sep</monthname_short>
            <weekday_short>Fri</weekday_short>
            <weekday>Friday</weekday>
            <ampm>PM</ampm>
            <tz_short>PDT</tz_short>
            <tz_long>America/Los_Angeles</tz_long>
          </date>
          <period>4</period>
          <high>
            <fahrenheit>101</fahrenheit>
            <celsius>38</celsius>
          </high>
          <low>
            <fahrenheit>64</fahrenheit>
            <celsius>18</celsius>
          </low>
          <conditions>Clear</conditions>
          <icon>clear</icon>
          <icon_url>http://icons.wxug.com/i/c/k/clear.gif</icon_url>
          <skyicon />
          <pop>0</pop>
          <qpf_allday>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_allday>
          <qpf_day>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_day>
          <qpf_night>
            <in>0.00</in>
            <mm>0</mm>
          </qpf_night>
          <snow_allday>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_allday>
          <snow_day>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_day>
          <snow_night>
            <in>0.0</in>
            <cm>0.0</cm>
          </snow_night>
          <maxwind>
            <mph>15</mph>
            <kph>24</kph>
            <dir>W</dir>
            <degrees>279</degrees>
          </maxwind>
          <avewind>
            <mph>12</mph>
            <kph>19</kph>
            <dir>W</dir>
            <degrees>279</degrees>
          </avewind>
          <avehumidity>21</avehumidity>
          <maxhumidity>0</maxhumidity>
          <minhumidity>0</minhumidity>
        </forecastday>
      </forecastdays>
    </simpleforecast>
  </forecast>
</response>

Photo of John Kubiatowicz

John Kubiatowicz

  • 5 Posts
  • 0 Reply Likes
p.s. The issue of english and metric textual forecasts being different is clearly shown in the above XML as well!