Author Topic: Having trouble with Forecast Compare script...  (Read 2820 times)

0 Members and 1 Guest are viewing this topic.

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Having trouble with Forecast Compare script...
« on: November 16, 2010, 04:47:06 PM »
Hello everyone,

I just can't seem to get data in the right spot with this script.  See http://barrowcountyweather.com/wxforecast_compare.php

The highs and lows seem to be reversed.
The updated time for the first set of data should be around 07:30 when the script update runs.

Any help is greatly appreciated!

Thanks!

Al

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #1 on: November 17, 2010, 06:49:18 AM »
Al,

It looks to me like a problem with when you're running the the script in logging mode.  Are you doing that shortly after the new plaintext.txt is available on the server?  Another thing to check are the times in the config that say what is day and what is night i.e. when WxSim and the NWS switch from "the rest of today" to "tonight" for example.  Things are definitely backward there.

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #2 on: November 17, 2010, 05:29:06 PM »
Jim,

FC-CONFIG :

// Day/Night
$nightstart = "16:00";                   // The times that WxSim switches day/night for first temperature
$nightend   = "04:00";

Plaintext available at 07:35 and 21:35

The lfc-log is ruin at 07:40 and 21:40

Thanks!

Al

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #3 on: November 18, 2010, 05:29:53 AM »
Al,

That all looks like it should work ok.  The good news is that your logging is working, it's just that when it comes time to display the script is getting it backward for some reason.  I'll have to dig back into the code to see if I can figure out what's going on ... it's been awhile since I've looked at it.  Give me a day or two, I'm sure it's something simple.

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #4 on: November 18, 2010, 12:52:29 PM »
Thanks Jim,

Let me know what you find.

Al

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #5 on: November 18, 2010, 05:34:09 PM »
Al,

I don't have the full answer to why that is happening, but when we store the time in the log we're getting it wrong.  Something in the way it's interpreting the time from plaintext.txt.  What's strange is that yours is in the exact same format as mine.

Let's try changing to $useWxSimTime = false; in the config and we'll see if it gets things straight next run.  That will cause it to use the actual system time when the script is run in logging mode.

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #6 on: November 19, 2010, 06:07:22 PM »
Hi Jim,

I made the config change and this mornings run put things in the right spot.  I will check the run tonight at 21:00

Many thanks!

Al

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #7 on: November 20, 2010, 05:32:13 AM »
Al,

Great, that much better and should continue to work fine.  Something was going wrong with the scripts interpretation of the time in plaintext.txt and I don't know why since it's just like mine.  The script has handled several different formats used in different countries so why the difference here?  Maybe a PHP version issue?  I don't think I'll spend a lot of time trying to track it down since it's fixed so easily.

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #8 on: November 20, 2010, 04:41:06 PM »
Thanks for your help Jim!

Question,  are there optimal times for running the forecast compare for lows and highs?

Thanks!

Al...

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #9 on: November 21, 2010, 06:12:27 AM »
Al,

My thoughts are that we want to compare what WxSim thinks with what the NWS thinks at the same time, so the comparison should be made shortly after your WxSim forecast.  Optimal times of day for the WxSim forecast are shortly after new data becomes available for WxSimate to gather.  There's a thread on this on the Weather Watch forum somewhere where Tom explains that.

Is that what you're asking?

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #10 on: November 23, 2010, 06:54:45 AM »
The latest wrinkle in this issue ):

Please see http://barrowcountyweather.com/wxforecast_compare.php

The NWS ans WS values are in the correct spot but the Actuals are now reversed???

Thanks!

Al

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #11 on: November 24, 2010, 05:24:28 AM »
Al,

That's strange and happening only on your night forecast.  I see you're using fc-LogTemps to capture the highs & lows.  Are you just running it twice each day?  I'm running mine at 9:00 am & pm to capture the overnight low and the day's high.

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #12 on: November 24, 2010, 07:10:11 AM »
Jim,

I am running the log temp at 07:40 and 21:40.

Thanks!

Al

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 528
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: Having trouble with Forecast Compare script...
« Reply #13 on: November 24, 2010, 05:01:44 PM »
Al,

The reason I asked is that it seems to be capturing temps at other times.  For instance right now (4:00 pm) fc-temps.txt reads

54.8°F,58.9°F,11/24/2010 12:39 pm

which says it was run last at 12:39.  The way fc-LogTemps is written is that anytime it's run prior to noon it replaces the overnight low which is in the second position.  Anytime > 12 it assumes it's capturing the day's high and replaces the first position.  This was run at 12:39 so it did just that.  So, it appears everything is functioning correctly except for when fc-LogTemps is doing it's job.

If you wish, you can do away with fc-LogTemps and the comparison will use values from testtags.php.  If you decide to try this, fc-temps.txt must be removed from the server or else the comparison script will find it and use those values.

- Jim

Forum Search and Google Can be Your Best Friends

Offline ADM

  • Contributor
  • ***
  • Posts: 135
    • Barrow County Weather - Barrow County, Georgia
Re: Having trouble with Forecast Compare script...
« Reply #14 on: November 25, 2010, 09:12:19 AM »
Hi Jim,

I think I may have found the problem! 

I had the "time zone" set as "America/NewYork" when it should be "America/New_York" with an underscore. :)

// Date & Time
date_default_timezone_set("America/New_York");   // Zones available at http://us2.php.net/manual/en/timezones.php

Once I updated that and ran the log script it recorded the current time.  We will see how it goes.

Thanks and have a great Thanksgiving!!

Al