Author Topic: Correct Forecast Icon Display  (Read 10407 times)

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Correct Forecast Icon Display
« on: July 29, 2012, 10:08:45 AM »
Hi,

Since we talked about the different choices in Forecast Icons, I like to bring up a different question in regards to those displayed.

Everyday I sit behind my computer after 9:00pm (current time of sunset, but it chances rapidly) I'm surprised to see a bright sunny forecast image while it is pitch dark outside.......Kind of annoying........It does not reflect reality (and that's what weather is all about isn't it?? :lol: ).
Looking at the "tools" we have in the form of webtags and forecast numbers, is there a way we combine those so the forecast image matches the actual weather (and 24 hour) status.....?
What we have is:
<#sunrise> / <#sunset> / <#isdaylight> (Returns 1 if currently within daylight hours (i.e. between dawn and dusk), 0 if not) / <#daylightlength>
In other words, IS there a combination to be found, so that the following forecast string shows correctly (according weather and time of day). I'm not a programmer, just thinking "logically"  :D  :lol:
At 2:00PM: "Fine, becoming less settled" IF <#isdaylight> = 1 (daylight) -> show forecast # 4 (sun and clouds)
At 11:00PM: "Fine, becoming less settled" IF <#isdaylight> = 0 (dark) -> show forecast # 18 (moon and clouds)

Just an idea.........

Cheers,

Arthur
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: Correct Forecast Icon Display
« Reply #1 on: July 29, 2012, 10:21:40 AM »
Is the forecast projecting ahead 12 hours, as indicated on the template? If so, you'd have your moon templates all day and your sunshine templates all night.

Not sure what the answer is...
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Correct Forecast Icon Display
« Reply #2 on: July 29, 2012, 10:51:17 AM »
Hi Guys,

Yes, we have to status on that! If forecast are "now + 12h", we have to
display a moon (near) all day long... and so on, like you said Tom.

I've posted question on Cumulus forum... waiting for answer  :roll:

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Correct Forecast Icon Display
« Reply #3 on: July 29, 2012, 11:21:07 AM »
To me, it all comes down to "trustable" information on the website.....
Showing a bright sunny image for the next 12 hours while it's 9:00PM doesn't make sense....(same as when I see amateur weather sites in Toronto, showing a record wind of 398km/h or an hourly rainfall record of 325mm  :D  :D ).......

There'll be a way to "link" forecast image to actual time of day...??? (display moon image after sunset..???) qlthough with the 12 hours ahead it seems a bit tricky.... :roll:

Cheers,

Arthur
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Correct Forecast Icon Display
« Reply #4 on: July 29, 2012, 12:20:44 PM »
Hi Arthur,

I've see your "jump" to "other side"... and is temptated to wait their answer!! :lol:

For html version, it goes by javascript as we need a "switch" depends on a condition (night/day)
or replace "0" by "night" word (as example). the solution is pretty simple!

insert that code just before </head>

Code: [Select]
<script type="text/javascript">
function ChangeIt(expr,a,b) {
var i=0
while (i!=-1) {
i=expr.indexOf(a,i);
if (i>=0) {
expr=expr.substring(0,i)+b+expr.substring(i+a.length);
i+=b.length;
}
}
return expr
}
</script>
Cut your image line in 2 parts and insert js, like this

Code: [Select]
<img src="images/meteo/
<script type="text/javascript">
document.write(ChangeIt('<#isdaylight>','0','night'));
</script>.
<#forecastnumber>.png"....
That way on night hours, you'll have night0.png to night26.png
Days hours, you'll have regular 0.png to 26.png

That solution is not best, we could do much better, but I propose that one
as it coulb be a "swiss knife" as it replace in phrase(expr)  "Something(a)", "by other thing(b)"

Now, you just have to build (find) an entire weather icon set for nights!

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Correct Forecast Icon Display
« Reply #5 on: July 29, 2012, 12:48:57 PM »
HI Jacques,

Great!!!!!!Awesome!!!
I'll do this after modifying the current [tabs] issue (addition)!! (And that all before 9:00pm tonight when my 8 yr old son comes here to stay with daddy for the next 2 weeks (time for website will be limited then, when pools and beaches might have priority... :D  :D )

Check it out by the end of today.......

Cheers,

Arthur
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Correct Forecast Icon Display
« Reply #6 on: July 29, 2012, 02:04:52 PM »
Hi,

Answer from Steve :
Quote
I think it's supposed to be a forecast for the next 12 hours, but I don't know for certain

Then, if I see Wikipedia link, it said that Zambretti is a Short Term forecast
(next 4 hours) http://www.meteormetrics.com/zambretti.htm

But, that link said 12h device: http://www.shipwreck2000.freeserve.co.uk/

Then do we have to correct phrase: Forecast... for next 12 hours??

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Correct Forecast Icon Display
« Reply #7 on: July 29, 2012, 02:22:03 PM »
That's fine to me!!!!
Easy job  :D  :D  :D

Cheers,

Arthur
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »

Offline avoorpool

  • Sr. Member
  • ****
  • Posts: 372
    • http://pickeringweather.ca
Re: Correct Forecast Icon Display
« Reply #8 on: July 30, 2012, 01:10:46 AM »
Hi Jacques,

After a productive day (my tabs and new pages area ll in place!!), I tried the modification for the day/night forecast image, but it's 2:00AM and I still see a sunny forecast  :D  :D
I followed your instructions, but I guess there is something missing since I only see text in the forecast box.
When I look at it, how can the image text be cut in 2, with a direct <script> after "images/meteo/........?
<img src="images/meteo/
<script type="text/javascript">
   document.write(ChangeIt('<#isdaylight>','0','night'));
</script>.
<#forecastnumber>.png"....

Tomorrow I'll find some time to modify the recordT files as well.

Cheers,

Arthur
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »

Offline virusdunil

  • Jr. Member
  • **
  • Posts: 24
    • http://www.meteohebertville.com
Re: Correct Forecast Icon Display
« Reply #9 on: July 30, 2012, 09:11:15 AM »
I'm so damned lost in here :shock:   :lol:  :lol:  :lol:  (when it comes to scripts i mean )
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Station Meteo:National Geographic Fine Offset)
Logiciel:Cumulus et Weather Display
Mon site: http://http://www.meteohebertville.com

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Correct Forecast Icon Display
« Reply #10 on: July 30, 2012, 03:57:22 PM »
Ahhhhhh Too complicated!!!  :twisted:  Forget it!!!

I've searched easier way to do it and found it! Really simple!  :lol:
 
See it there: http://weatherbyyou.com/forum/index.php ... 197#msg197

Regards,
Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: Correct Forecast Icon Display
« Reply #11 on: July 30, 2012, 07:06:58 PM »
I'm going to put an enhancement request in for a new web tag: <#isfreezing>. Should be simple enough.

This way, not only can we customize the icons for day or night, but we can further customize to show if the precipitation is frozen or not.

I'm curious if setting an alarm state will serve the same purpose. If I set a low temp alarm for 32 degrees F, will the use of the web tag <#lowtempalarm> do the same thing as <#isfreezing>? I haven't used the alarms yet and am not clear if it works like the error or new record light, which stops lighting once you've acknowledged it by clicking it. I would want the low temp alarm state to stay engaged as long as the temp is below 32F.

-Tom
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Correct Forecast Icon Display
« Reply #12 on: July 30, 2012, 07:46:41 PM »
Hi Tom,

Effectively, your "edit" is a pretty good idea!  :D

As you wrote, it have to react ok. If low alarm is viewed on Cumulus screen
it need to stay on... and as opposed, if low temp ended, tag need to turn to 0.

could stack them in same line as that:

forecast_0_0_25.png

But, 28 icons x 2 (night/day) x 2 (freeze or not) = 112 icons!  Ohhhhhh boy! :shock:

Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site 

Offline krmidas

  • Full Member
  • ***
  • Posts: 91
    • The Tom Keramidas Climatological Experience
Re: Correct Forecast Icon Display
« Reply #13 on: July 30, 2012, 08:21:31 PM »
Isn't it 104 icons?

26 x 4?

html would be something like ...<#isdaylight>_<#isfreezing>_<#forecastnumber>.png

I'll ask the question on the Cumulus board about adding the new webtag.
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Tom Keramidas, Lake Zurich, IL, USA

Offline Mr.Meteo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1120
    • http://www.meteostours.ca
Re: Correct Forecast Icon Display
« Reply #14 on: July 30, 2012, 08:34:59 PM »
Hi Tom,

You know that sometime, Cumulus send negative values?

-1 = Exceptionally fine
-26 = Exceptionally Bad

Then, 28 x 4 = 112 ;)

You keep us informed about Steve Answer?

Thanks,
Jacques
« Last Edit: December 31, 1969, 06:00:00 PM by Guest »
Please, consider supporting this site