WxSim Temperature Forecast Comparison Script

Jack,

I’m not sure, I’ll have to take a look. I’m having some different problems which may be what is happening to Stuntman that I have to figure out too. I tried to add two more forecasts, and am now having trouble getting any other than the very first to display. I suspect all of this may be related. Might need a little sleep first, but we’ll get it.

Thanks. - Jim

Hi Jim

Im not sure the script is working correct - it seems that WXSIM (SL) and Wunderground (WU) MAX and MIN are in the wrong place.

MAX should be MIN and vice versa.

Would you take a look here and see if you agree with me:

http://www.silkeborg-vejret.dk/english/sammenlign.php

Thanks

Best regards,

Henrik

Henrik mine is the correct way round, however mine are all positive numbers so I wonder if the script is not correc tly checking the negative values?

On a slightly different thought, I have asked Brian (in suggestions) for a new %mintempovernight% tag which is from 6pm to 6am (the current one if for folks with 9am reset which runs from 9pm to 9am) so we can use it in the compare script. The reason for this is that I do have overall min temps which happen in daytime especially in winter and that’s not a fair comparison with a forecast which is predicting an overnight low…

Stuart

Henrik,

I just looked at your data for today and it appears that the WU highs/lows are correct, but the WxSim ones are backwards. Is that what you’re seeing? Is it possible that you’re running this script before the new plaintext.txt has been uploaded to the server? If that were the case, the first item found from plaintext-parser would be a low and things would be out of sync. The differences from actual seem to be calculated correctly with the negative temps, so that is good.

That makes me realize something though, right now this is a “daytime forecast only” script.

Thanks. - Jim

Hi Jim

Thanks for your reply.

You are right - its my WXSIM that are backwards.

I upload plaintext.txt 6 times a day - and I have setup a cronjob to run the compare script every night at 23.11 (1 hour after last upload of plaintext.txt)

I upload plaintext.txt at 04,07,10,13,16,19 and 22 hour.

Am I doing something wrong?

Best regards,

Henrik

Jack,

I figured out what this problem is, we can’t use the selectors more than once on a page, so you’ll have to turn them off in one of your configs. That’s ok because both of the scripts will react to the selector values anyway. Another possibility might be to put each of them in a different iframe. I haven’t tried that, but then they should be discreet I would think. The fixed size of the iframe might be a problem though unless you want scroll bars to show up.

  • Jim

Hi Jim,

Ok, I might use my “other” solution which is to rename the forecast compare include and then I just changed the id on the selectors. I’ll have to try your solution too. Thanks.

Jack

Henrik,

That won’t work because this script will only look at the current forecasts that the two systems are showing at that partucular time. You should set this logging to happen shortly after one of your plaintext.txt files has been uploaded. You can, however, set up to track more than one of these forecasts and we’re getting the bugs worked out of that. I hope to have an update out soon after I review the changes that I’ve made which are mostly documentation.

  • Jim

Hi Henrik,
May I say, it is not correct to do so.
First thing you have to know is: When is the forecast made for your location by WU.
Then you know at what time you have to run WXSIM and after that make the log.
Otherwise you are comparing a forecast made at say 01:00 with one made at 13:00
You have to make sure the two are made around the same time, else your comparison is not correct.

Hi Jim and Josef

Thanks for your replies - I will find a time that WU is updated and adjust my WXSIM to that time and then shortly after -I will run the cronjob.

In that way if should work - right?

Best regards,

Henrik

in my opinion, yes
BTW I’m trying to find the correct time to do so myself.

I set up a second logfile that logs everything every hour, so I can see when WU changes, then I will run WXSIM at that time and make the logfile

And you can also see that if I pick the right time, I can easily cheat 8O

When I enter the URL I use in the script for WU and display the page in a browser it shows at the top of the forecast the last updated time so it should be easy to sort out. In my case right now at 17:15 GMT it says last updated at 12:00 PM GMT.

Stuart

New version 1.2 has been posted to the .zip. It mostly clarifies the documentation and examples, and gets rid of the “vanilla” forecast.log example which was confusing to us all. That log is still supported in the script however. It won’t hurt to update your forecast-compare-include.php so we’re sure we’re all on the same sheet of music. I don’t think I made any changes to it other than a couple comments though.

Stuntman, can you give this a try when you get a chance? You’re really helping me debug the hardest part, the documentation. The documentation didn’t transition very well when I added the capability for multiple forecasts.

Two questions for those interested:

With multiple forecasts on a page, one selector set that changes all the forecasts on the page the same way (as it is now), or just change that particular forecast and leave the rest stay as they were? I think I can code it so they each use unique id’s so only that one would change, and also send a unique value so the page could return to a named anchor on the calling page if that were desired.

Is anyone going to want to track night forecasts? If so, I could swap the High and Low headings at a certain time if we know when the various forecasts transition.

  • Jim

Thanks for the extra work! Your extra notes and comments helped a LOT!!! I believe I have it working now (Will run @ 10:55 and 14:55) today… I’ll need to consider what are the best times for “Morning” and “Afternoon”… I’ll let you know how it goes!

Thanks again!

Jim,

I would go/stay with the one selector for all. I’m not sure the average visitor will mess with that too much anyway, would think the page owner will be doing most of the digging so to speak. I think I am going to make an unpublished page that will show the entire chart any way. It seems most that use the templates will have issues with showing huge charts too! Just my opinion its such a cool script that I look forward to filling the charts and looking at the data myself. BTW I would think the author of wxsim (Tom) would be interested in this script and the sites using it too!

Regards,

Jack

I agree with Jack over public pages, I dont intend to have one. I’ll be the one using the script to check on how my WXSim forecasts measure up, especially as I do have some WXSim forecast problems because of my location. I agree that this is something we should bring to Tom’s attention and maybe those of us who dont have publicly linked pages could let him have details if he wishes to access it.

Stuart

mine says 01:00pm CET, but it is only at 07:00pm I can log something from the new forecast on my site, so it takes 6 hours #-o
~~>run wxsim at 01:00pm and wait for 6 hours to make a log ?
And same thing for the morning forecast------

I’m thinking to much, I’m confused now.

Yes well I’ve not yet checked this for my location against when I run WXSim, I need to monitor it for a while to see…

Stuart

That would be interesting to him, I’d imagine… I wonder if there is any way to database this rather than use log files? I know this would add a whole new level of complication… but it could also add flexibility in that the data could be retrieved in numerous ways and for numerous different projects related to this… perhaps a graph or something where we could see deviations visually…

Just thinkin’

I know… I just got it working and only have a single a.m. logged, and here I am thinking ‘what else’…
#-o

Based on all your remarks, I just sent Tom an EMail with a link to this thread so he can catch up when he gets a chance.

As for other uses of the data, you can set how many days it is kept and it’s in a comma delimited format that can easily be used elsewhere. I imagine someone sharp might be able to come up with a jpgraph or something.

  • Jim