Author Topic: Jpeg question on advforecast2  (Read 293 times)

0 Members and 1 Guest are viewing this topic.

Offline daybreak

  • Senior Member
  • **
  • Posts: 96
    • Alma Weather
Jpeg question on advforecast2
« on: May 22, 2020, 04:43:31 PM »
I've noticed that sometimes the forecast description % of rain doesn't match the jpeg icon.  For example forecast on Sunday the icon says 30% and the description says 50%.  Is there something I did wrong?  Most of them match but not all.  www.daybreakimagery.com/weather or http://www.daybreakimagery.com/weather/forecast.php
Have a good weekend!

Thanks,
Richard

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9279
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Jpeg question on advforecast2
« Reply #1 on: May 22, 2020, 04:55:19 PM »
I think the issue is because you don't have the DualImage.php capability installed.
Some of the forecasts are for 6hr periods and have different PoP for each time which would be displayed on the icon if DualImage.php were installed.  If not available, then the first period forecast PoP is used for the static icon display.

For example, in your current JSON forecast ./forecast-ILZ070-0-json.txt it shows
Quote
        {
            "number": 2,
            "name": "Tonight",
            "startTime": "2020-05-22T18:00:00-05:00",
            "endTime": "2020-05-23T06:00:00-05:00",
            "isDaytime": false,
            "temperature": 64,
            "temperatureUnit": "F",
            "temperatureTrend": null,
            "windSpeed": "7 mph",
            "windDirection": "SE",
            "icon": "https://api.weather.gov/icons/land/night/tsra,20/tsra,60?size=medium",
            "shortForecast": "Chance Showers And Thunderstorms",
            "detailedForecast": "A chance of showers and thunderstorms before 3am, then showers and thunderstorms likely. Mostly cloudy, with a low around 64. Southeast wind around 7 mph. Chance of precipitation is 60%."
        },
but on your page, it shows as a 20% chance icon (reflecting the tsra,20 in the icon spec.

If you install DualImage.php (and the forecast/icon-templates/*, then the script will display the full range of NWS dual-image icons.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline daybreak

  • Senior Member
  • **
  • Posts: 96
    • Alma Weather
Re: Jpeg question on advforecast2
« Reply #2 on: May 22, 2020, 08:04:35 PM »
Thank you so much Ken.  I am amateur when it comes to web pages!

Have a good weekend.

Richard