Author Topic: FWI Calculator  (Read 36274 times)

0 Members and 1 Guest are viewing this topic.

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: FWI Calculator
« Reply #25 on: March 23, 2012, 04:36:54 PM »
Started running FWI Calc just a couple days after CapeWeather ...
He talked me into it!! LOL ...
It IS very cool. Once you get the little burps and hickups for the data format/parsing figured out...

http://www.charlottecountyweather.com/fire-graphs.php

Nice setup.  =D>
Lars Magnusson
Axelvold / Sweden
55 57' 41" N / 13 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline ccweather

  • Member
  • *
  • Posts: 49
    • Charlotte County Weather
Re: FWI Calculator
« Reply #26 on: March 23, 2012, 04:54:14 PM »
On a side note - but also in regards to FWI Calc ...
I want to share the code I put together to get the proper data, in the required format from the testtags.php file that Weather Display creates...

I setup a php file and loaded it to my web server.  This php file executes via a cron job at 10 minutes before midnight...
then just before I parse the data, I use a wget function to pull down text file for the computations...

I miss about 10 minutes worth of wind/rain data from the entire day... But, no big deal... LOL

<?php
//load up the data file!!
include("testtags.php");
############################################################################
?>

<?php
// remove trailing information (ie: mph or in or F)
function strip_units ($data) {
  preg_match('/([\d\,\.\+\-]+)/',$data,$t);
  return $t[1];}

//grab current minutes and convert to decimal portion of an hour ie: 12:45 - the 45min will be 0.75)
(float)$current_minutes = $time_minute / 60;
//add minutes to hours - hours based on 24 hour format
(float)$current_hours_minutes = $time_hour + $current_minutes;

//calculate average wind speed for entire day - up to EXACT point of last data collection
(float)$dailyavewindspeed = $windruntoday / $current_hours_minutes;
$nwind = round($dailyavewindspeed,2);


// Build semi-colon delimited text file for FWI data
// Fields are: Date,Temperature,Humidity,Windspeed,Rainfall
// Input data defined in testtags.php

$fwidat = $date . ";" . strip_units($maxtemp) . ";" . $lowhum . ";" . $nwind . ";" . strip_units($dayrn);
$fwi = PutData("fwicalc.txt",$fwidat);

############################################################################
// A simple function to write data to a file

function PutData($file, $data) {
$fp = fopen($file, "w") or die('ERROR: Can\'t write to ('.$file.')');
    flock($fp, LOCK_EX);
   fputs($fp, $data );
    flock($fp, LOCK_UN);
   fclose($fp );
}
?>

Mark... (ccweather)
http://www.charlottecountyweather.com
WU: KFLPORTC25

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #27 on: May 15, 2012, 09:53:10 AM »
I have downloaded this software and read the instructions and the comments on here, but still a bit confused as to how to get this to work.
From what I can see I need to create a custom tag file. Now I'm not quite sure how to do this. Is it done under special file conversions along with testtags? And where do I store the files? Sorry if it sounds dumb but I hate messing around with WD as invariably I mess something up  :oops:
Help with this would be much appreciated, thanks.

Offline jmcmurry

  • Jim McMurry
  • Forecaster
  • *****
  • Posts: 526
  • Davis Vantage Pro 2 Plus Wireless.
    • Juneau County Weather
Re: FWI Calculator
« Reply #28 on: May 15, 2012, 10:09:39 AM »
The attached is how mine is set up.

- Jim

Forum Search and Google Can be Your Best Friends

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3205
    • North Georgia Weather
Re: FWI Calculator
« Reply #29 on: May 15, 2012, 11:34:16 AM »
Lars,

I did that this morning prior to going to golf with my buddies and after 18 holes and several beers I find that it is now working.  Must have been the golf. 

Thanks.  - Jim
Everything works better after a few beers!

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #30 on: May 15, 2012, 11:49:04 AM »
Thanks Jim, that made life much easier and the file is now being created.
Now on to the next section of creating the table and uploading it to my website, problem is I don't drink beer or play golf  :lol:

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3205
    • North Georgia Weather
Re: FWI Calculator
« Reply #31 on: May 15, 2012, 12:26:45 PM »
Now on to the next section of creating the table and uploading it to my website, problem is I don't drink beer or play golf  :lol:
You might have a long road ahead of you then!  :grin:

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #32 on: May 15, 2012, 02:44:05 PM »
Yes I know, it is not exactly intuitive. I have the table working now, but not the ftp upload even though it has accepted the ftp details. More work needed but we will get there.

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #33 on: May 16, 2012, 12:24:03 PM »
Any ideas as to why the ftp doesn't want to work for me? I have filled all the details in and hit test, the red box flashes green before turning back to red and the error code is 0. On the main page of FWI it says ftp enabled, but it is not uploading the file. A bit stumped on this one.

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: FWI Calculator
« Reply #34 on: May 16, 2012, 01:10:21 PM »
Any ideas as to why the ftp doesn't want to work for me? I have filled all the details in and hit test, the red box flashes green before turning back to red and the error code is 0. On the main page of FWI it says ftp enabled, but it is not uploading the file. A bit stumped on this one.

Look in the ftp log?

Maybe there are some clues to why it does not work.

You will find it under Web, view ftp log.
Lars Magnusson
Axelvold / Sweden
55 57' 41" N / 13 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #35 on: May 16, 2012, 01:31:37 PM »
Nothing in the ftp log even though it is checked to keep a log.

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #36 on: May 16, 2012, 01:50:37 PM »
Duhh, missed the Start ftp  ](*,) Although I did have to close the program down and restart and hey presto it worked. Thanks guys.

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: FWI Calculator
« Reply #37 on: May 16, 2012, 02:15:02 PM »
Duhh, missed the Start ftp  ](*,) Although I did have to close the program down and restart and hey presto it worked. Thanks guys.

Glad you got it working, how does your page look?
Lars Magnusson
Axelvold / Sweden
55 57' 41" N / 13 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline youngros

  • Senior Member
  • **
  • Posts: 87
    • Sans Souci Weather
Re: FWI Calculator
« Reply #38 on: May 17, 2012, 01:43:16 PM »
Looks like this www.mad-weather.com/fwi.php I probably need to look at the settings a bit more closely now I have it working. I like the FIRMS fire web mapper, that shows 3 fires near to us. Fortunately not too much ash raining down on us. So little rain in the last 12 months everywhere is tinder dry. I will put the description as link as it takes up too much page space really.

Offline tstorm

  • Contributor
  • ***
  • Posts: 141
    • Harpers Ferry Weather
Re: FWI Calculator
« Reply #39 on: May 17, 2012, 03:03:12 PM »
For some reason I can't get the ftp function to work when I click on test.  It goes from red to green to red.   I did exit out of the program several time and clicked on the Start FTP under Web.  There is nothing in the FTP log and I do have the FTP log checked under the FTP setup.  Any ideas?

Below are the results I get when I click on the ftp test

Proto = ""
User  = "harpersf"
Pass  = "**************"
Host  = "ftp.harpersferry-weather.com"
Port  = "21"
Path  = ""
OnRequestDone. RqType = 1    ErrCode = 0
OnRequestDone. RqType = 2    ErrCode = 0
OnRequestDone. RqType = 3    ErrCode = 0
OnRequestDone. RqType = 37    ErrCode = 0
OnRequestDone. RqType = 15    ErrCode = 0
FTP tests completed
Done.

Thanks,

John
« Last Edit: May 17, 2012, 03:05:07 PM by tstorm »

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: FWI Calculator
« Reply #40 on: May 17, 2012, 03:22:39 PM »
For some reason I can't get the ftp function to work when I click on test.  It goes from red to green to red.   I did exit out of the program several time and clicked on the Start FTP under Web.  There is nothing in the FTP log and I do have the FTP log checked under the FTP setup.  Any ideas?

Below are the results I get when I click on the ftp test

Proto = ""
User  = "harpersf"
Pass  = "**************"
Host  = "ftp.harpersferry-weather.com"
Port  = "21"
Path  = ""
OnRequestDone. RqType = 1    ErrCode = 0
OnRequestDone. RqType = 2    ErrCode = 0
OnRequestDone. RqType = 3    ErrCode = 0
OnRequestDone. RqType = 37    ErrCode = 0
OnRequestDone. RqType = 15    ErrCode = 0
FTP tests completed
Done.

Thanks,

John


Is it green or red on the main screen under web function for the FTP?
Lars Magnusson
Axelvold / Sweden
55 57' 41" N / 13 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline tstorm

  • Contributor
  • ***
  • Posts: 141
    • Harpers Ferry Weather
Re: FWI Calculator
« Reply #41 on: May 17, 2012, 03:59:37 PM »
Was white now it's green.  Looks like I got it to work  

Thanks,

John
« Last Edit: May 17, 2012, 04:06:59 PM by tstorm »

Offline tstorm

  • Contributor
  • ***
  • Posts: 141
    • Harpers Ferry Weather
Re: FWI Calculator
« Reply #42 on: May 18, 2012, 09:03:44 AM »
When I do the test parse from FWI setup I get the following

DATA FILE PARSED OUTPUT
----------------------------------------------
Date: 05/18/12
Temp: 54.7
Humidity: 86
Wind Speed: 0.9
Rainfall: 0.00.

Seems like there's an issue with the rainfall having a . after 0.00 as when I click on "Process Now" it says that the "Rainfall is not a valid number!".  I'm using the following as fwi-in.txt
%date-month%/%date-day%/%utcdate-yeartwo%,%temp%,%hum%,%avgspd%,%totalrainlast24hours%

Any ideas?

Also can anyone share the html/php files that would be used to create the table under web file options that I've seen on some web pages?

Thanks,

John

Update:  I figured out the . after the rainfall (0.00.).  I had to turn off the units in WD.  In Web Files/Web Page Setup under Web Files Setup #1 I unchecked the "Include the Units Used"

Still need to figure out the web page stuff so if anyone is willing to share the html/php files used in the Web/File Options I would be greatful.
« Last Edit: May 18, 2012, 10:00:40 PM by tstorm »

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: FWI Calculator
« Reply #43 on: May 18, 2012, 01:59:56 PM »
This is what I'm using, nothing fancy but it works.
Lars Magnusson
Axelvold / Sweden
55 57' 41" N / 13 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3205
    • North Georgia Weather
Re: FWI Calculator
« Reply #44 on: June 04, 2012, 05:14:50 PM »
Crap... I guess I'll have to get it installed now. You all are just making more work for me!  :-)

Offline Axelvold

  • Forecaster
  • *****
  • Posts: 1704
    • Axelvold's weather and photo
Re: FWI Calculator
« Reply #45 on: June 04, 2012, 06:14:17 PM »
Crap... I guess I'll have to get it installed now. You all are just making more work for me!  :-)

He he, that's what friends are for.  :lol:
Lars Magnusson
Axelvold / Sweden
55 57' 41" N / 13 6' 1" E
WX Station: Davis Vantage Pro2 Plus

Offline DaculaWeather

  • WxElement panel
  • Forecaster
  • *****
  • Posts: 3205
    • North Georgia Weather
Re: FWI Calculator
« Reply #46 on: June 04, 2012, 06:18:58 PM »
So I guess I need to sit back and wait a few days now?? I see that it's set to process a couple of minutes past midnight.

Offline wuhu_software

  • Forecaster
  • *****
  • Posts: 689
    • WUHU Software Yahoo Group
Re: FWI Calculator
« Reply #47 on: June 23, 2012, 09:12:27 AM »

Great job on the Charlotte website.

Offline ccweather

  • Member
  • *
  • Posts: 49
    • Charlotte County Weather
Re: FWI Calculator
« Reply #48 on: June 25, 2012, 07:24:59 PM »

Great job on the Charlotte website.


Thank You!! Very Much!!
Mark... (ccweather)
http://www.charlottecountyweather.com
WU: KFLPORTC25

Offline Melinamour

  • Member
  • *
  • Posts: 1
Re: FWI Calculator
« Reply #49 on: July 28, 2013, 06:37:34 AM »
Hi, i have the FWI calculator but I want some help if you can. I have this project where I have 40 years of data in EXCEL and I want to find FWI for each day but I don't know how. Is there a way I can put this file as input and then the program automatically finds the FWI and saves it somewhere? Please help!!!