cloudy

Author Topic: PHP Extraction of WD Avg/Ext HTM Files  (Read 43057 times)

0 Members and 1 Guest are viewing this topic.

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #150 on: April 10, 2008, 03:54:04 AM »
Hi

I have notised that my:

Day, Sunshine hours, ET, max solar, max uv

are presented 2 times a day like this:

01 05.0hrs  ET :1.4 mm  694.0 W/M² 
01 05.0hrs  ET :1.4 mm  694.0 W/M² 
02 00.6hrs  ET :0.9 mm  700.0 W/M² 
02 00.6hrs  ET :0.9 mm  700.0 W/M² 
03 02.3hrs  ET :1.2 mm  711.0 W/M² 
03 02.3hrs  ET :1.2 mm  711.0 W/M² 
04 00.2hrs  ET :0.9 mm  316.1 W/M² 
04 00.2hrs  ET :0.9 mm  316.1 W/M² 
05 08.0hrs  ET :2.5 mm  727.0 W/M² 
05 08.0hrs  ET :2.5 mm  727.0 W/M² 
06 04.6hrs  ET :2.0 mm  735.0 W/M² 
06 04.6hrs  ET :2.0 mm  735.0 W/M² 
07 06.6hrs  ET :1.8 mm  742.0 W/M² 
07 06.6hrs  ET :1.8 mm  742.0 W/M² 
08 00.1hrs  ET :1.5 mm  545.2 W/M² 
08 00.1hrs  ET :1.5 mm  545.2 W/M² 
09 05.4hrs  ET :1.9 mm  758.0 W/M² 
09 05.4hrs  ET :1.9 mm  758.0 W/M²

See example here:
http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200804&size=1

The original April2008.htm file from WD shows the values correct. (www.buskelundtoften.dk/vejret/vejrdata/April2008.htm)

What can be the problem?

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #151 on: April 10, 2008, 04:26:15 AM »
Hi

I have noticed that my:

Day, Sunshine hours, ET, max solar, max uv

are presented 2 times a day like this:

01 05.0hrs  ET :1.4 mm  694.0 W/M² 
01 05.0hrs  ET :1.4 mm  694.0 W/M² 


What can be the problem?

Best regards,

Henrik


Please attach your AvgExtract.php.txt and I will take a look in the morning.

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #152 on: April 10, 2008, 04:38:47 AM »
Hi Mike

Thanks - avgextract.php.txt attached.

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #153 on: April 10, 2008, 02:58:17 PM »
Hi Mike

Thanks - avgextract.php.txt attached.

Best regards,

Henrik

Change:
Code: [Select]
$level2 = array(
            array(",ET", 2),
            array("Sunshine hours month to date",6),
            array("Sunshine hours year to date",6),
            array(" mm ",0),
            );

To:
Code: [Select]
$level2 = array(
            array(",ET", 2),
            array("Sunshine hours month to date",6),
            array("Sunshine hours year to date",6),
            array('mm on day',0),   # mchallis added 04/08/08 support for rain in mm
            array('mm  on day',0),  # mchallis added 04/08/08 support for rain in mm (WD 10.37j + fix)
            );

The array(" mm ",0), must be something you added, it was interfering with the rain total "mm"

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #154 on: April 10, 2008, 03:19:48 PM »
Hi Mike

Thanks for your help (again)

Its working but now my rain totals are missing  :(

http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200804&size=1

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #155 on: April 10, 2008, 03:27:52 PM »
Hi Mike

Thanks for your help (again)

Its working but now my rain totals are missing  :(

http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200804&size=1

Best regards,

Henrik

Try this then

Code: [Select]
$level2 = array(
            array(",ET", 2),
            array("Sunshine hours month to date",6),
            array("Sunshine hours year to date",6),
            array('mm 1',0),
            array('mm 2',0),
            array('mm 3',0),
            array('mm 4',0),
            array('mm 5',0),
            array('mm 6',0),
            array('mm 7',0),
            array('mm 8',0),
            array('mm 9',0),
            );


Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #156 on: April 10, 2008, 03:54:22 PM »
Hi again Mike

Wow you are fast!

One more problem now (I think the problem have been there before the changes) - when I choose another month its always April 2008 which is presented.

What might be the problem?

Best regards,

Henrik

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #157 on: April 10, 2008, 04:05:57 PM »
Here is my forms page attached - could the problem be there?

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #158 on: April 10, 2008, 04:15:42 PM »
Hi again Mike

Wow you are fast!

One more problem now (I think the problem have been there before the changes) - when I choose another month its always April 2008 which is presented.

What might be the problem?

Best regards,

Henrik

Try this diagnostic version, it will print the date it gets from your form input so I can see if the problem comes from there or not.

I added this, you can take it out or comment it out later.
Code: [Select]
    # test print diagnostic info
    echo "<p>date_to_process: $date_to_process<br />";
    echo 'Month File: ' . $mnthname[$monthnum -1 ] . $yearnum . '.htm</p>';

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #159 on: April 10, 2008, 04:32:18 PM »
Hi again

Ok - seems that April2008.htm always is presented:

http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200801&size=1

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #160 on: April 10, 2008, 04:34:53 PM »
Hi again

Ok - seems that April2008.htm always is presented:

http://www.buskelundtoften.dk/vejret/english/rapporter.php?report=200801&size=1

Best regards,

Henrik

The problem is somewhere in your rapporter.php form date selection code

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #161 on: April 10, 2008, 04:47:03 PM »
you have

Code: [Select]
$breport = "scripts/rapporter/dagligrapporter.php?date=$date&lt;";

try this:
Code: [Select]
$breport = "scripts/rapporter/dagligrapporter.php?date=$date";

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #162 on: April 10, 2008, 04:50:25 PM »
Hi Mike

Its working now - thank you very much - amazing you can point out the errors so fast.

Have a nice day

Best regards,

Henrik

Offline jwwd

  • Posts: 3,545
  • Silkeborg, Denmark (56:10:58 N-09:30:26 E) - Elevation 75,35 meters
    • Weather at Silkeborg, Denmark
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #163 on: April 10, 2008, 07:56:22 PM »
Hi Mike

Thanks for your PM

Hi Mike

Its working - but unfortunately my "Månedsrapport:" and "Årsrapport: " dont work anymore - please see this link:

www.buskelundtoften.dk/vejret/rapporter.php

I have attached rapporter.php.txt - hope you might figure out what is wrong.

Thank you very much

Best regards,

Henrik

Offline MCHALLIS

  • Posts: 2,102
  • Long Beach, WA USA
    • Weather for Long Beach, WA USA
Re: PHP Extraction of WD Avg/Ext HTM Files
« Reply #164 on: April 10, 2008, 08:08:23 PM »
Hi Mike

Thanks for your PM

Hi Mike

Its working - but unfortunately my "Månedsrapport:" and "Årsrapport: " dont work anymore - please see this link:

www.buskelundtoften.dk/vejret/rapporter.php

I have attached rapporter.php.txt - hope you might figure out what is wrong.

Thank you very much

Best regards,

Henrik

when I click on "Årsrapport:" it tries to load this page in the iframe:
http://www.buskelundtoften.dk/vejrdata/200804.html

What is it supposed to do? I am not sure what is wrong with the url because I do not know the data structure

 

cumulus