Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4017) - 17 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

Chandler Burning Index

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Chandler Burning Index

Post by GraemeT »

For anyone who's interested, here is a snippet of php code to calculate the Chandler Burning Index using current data.

I don't know how the result compares with official fire indices, as in this part of the world (Aus.) we're now out of the fire danger period.
I hope this is useful to someone.

Code: Select all

<?php
			$cbi = (((110 - 1.373 * $hum) - 0.54 * (10.20 - $temp)) * (124 * pow(10,(-0.0142 * $hum))))/60;
			if ($cbi > "97.5") {
		        $cbitxt = "EXTREME";
			} elseif ($cbi >="90") {
		        $cbitxt = "VERY HIGH";
			} elseif ($cbi >= "75") {
		        $cbitxt = "HIGH";
			} elseif ($cbi >= "50") {
		        $cbitxt = "MODERATE";
			} else
			if ($cbi < "50") {
		        $cbitxt="LOW";
			}
			echo "Fire Risk for Today: " . $cbitxt
?>
Edit: fixed typo in formula
Last edited by GraemeT on Thu 22 Apr 2010 7:48 am, edited 1 time in total.
Cheers,
Graeme.
User avatar
Gordon-Loomberah
Posts: 230
Joined: Mon 17 Aug 2009 7:51 am
Weather Station: Davis VP2 + Solar and UV
Operating System: Windows 10 home
Location: Loomberah, Australia
Contact:

Re: Chandler Burning Index

Post by Gordon-Loomberah »

You missed catastrophic (index>100?) :!: i think they dropped moderate from the scale too?

I wouldnt mind displaying the fire index on my Cumulus page, but admit to having no idea at all about what to do with that piece of code :?
Loomberah Weather: http://gunagulla.com
User avatar
beteljuice
Posts: 3292
Joined: Tue 09 Dec 2008 1:37 pm
Weather Station: None !
Operating System: W10 - Threadripper 16core, etc
Location: Dudley, West Midlands, UK

Re: Chandler Burning Index

Post by beteljuice »

CAUTION !

Be very careful using this on your website !

For it to produce any meaningful advisory your weather station MUST be able to give RH <15%.

Many of the lower end kit stop at 15% or 10% and either 'stick' at that figure or give OFL or ---

In order to use the formula above you need a php enabled server and some means of inputing T (deg. C) and RH, either from realtime.txt or as a Cumulus Template. If you use the template method your file would need to uploaded seperately with a .php extension.

As a Cumulus Template:

Code: Select all


My boring html code

<?php

$hum = <#hum>;
$temp = <#temp>; // must be degrees centigrade

         $cbi = (((110 - 1.373 * $hum) - 0.54 * (10.20 - $temp)) * (124 * pow(10,(-0.0142* $hum))))/60;
         if ($cbi > 97.5) {
              $cbitxt = "EXTREME";
         } elseif ($cbi >= 90) {
              $cbitxt = "VERY HIGH";
         } elseif ($cbi >= 75) {
              $cbitxt = "HIGH";
         } elseif ($cbi >= 50) {
              $cbitxt = "MODERATE";
         } else
         if ($cbi < 50) {
              $cbitxt="LOW";
         }
         echo "Fire Risk for Today: " . $cbitxt . " (CBI = ". $cbi . ")";
?>
 more of my boring html

Image
......................Imagine, what you will KNOW tomorrow !
User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Re: Chandler Burning Index

Post by GraemeT »

As CBI is an American index, I'm still not sure of the equivalence to our CFA fire danger indicators, so I didn't include catastrophic.

Yes, Beteljuice, I had wondered about the hardware's ability to report very low humidity.
I haven't had my WS-2355 long enough to put that to the test - I'll have to wait till next summer, now.

On the subject of where/how to put the code, I've put it in an included .php file with my UV calculator and a couple of other bits and pieces.
I then use html header cells to display the variables as below:

Code: Select all

<tr>
<th>Current Observations: <span class="ajax" id="currcond"></span><br /></th>
<th><?php echo $uv ?></th>
<th><?php echo $cbitxt ?></th>
</tr>
Cheers,
Graeme.
User avatar
garytx
Posts: 52
Joined: Sun 22 Jun 2008 3:00 pm
Weather Station: Davis VantagePro 2 Plus w/FARS
Operating System: Windows 7
Location: Central Texas, USA
Contact:

Re: Chandler Burning Index

Post by garytx »

The Chandler Burning Index can be computed entirely using Javascript, I've been doing it for years. You can see a page I have dedicated to real time fireweather at http://www.wilcowx.com/firemet.php. This is a PHP page but only for some other purposes and scripts on the page.

I'd also like to highly recommend the freeware program FWI Calc. You'll need to create a small and very simple textfile output from Cumulus that this software will use to read and calculate not only the Chandler Burning Index, but the more internationally used Fire Weather Index, which takes into account historical data - meaning the calculations get more accurate and meaningful as time goes by. This program can be had at http://www.wilddata.org.nz/fwicalc/index.php?page=9. There's also a facility for sharing your data worldwide in a single point - visit the Fire Weather links on that page to see currently contributing sites (among the few there currently is mine) with vast historical data available. You can see my FWI Calc output page at http://www.wilcowx.com/rr_fwi.html. I can't recommend this software highly enough!

I'm a fire weather afficianado and something of an expert, having dealt with wildland fire management for 30 some years now, and I heartily endorse FWI Calc.
bbcar
Posts: 23
Joined: Sun 26 Apr 2009 5:07 pm
Weather Station: national geographic
Operating System: Windows 7
Location: Calgary, Ab
Contact:

Re: Chandler Burning Index

Post by bbcar »

now if it would only run on 64bit windows 7
Maybe a newer version will in the future
User avatar
garytx
Posts: 52
Joined: Sun 22 Jun 2008 3:00 pm
Weather Station: Davis VantagePro 2 Plus w/FARS
Operating System: Windows 7
Location: Central Texas, USA
Contact:

Re: Chandler Burning Index

Post by garytx »

Gordon-Loomberah wrote:You missed catastrophic (index>100?) :!: i think they dropped moderate from the scale too?

I wouldnt mind displaying the fire index on my Cumulus page, but admit to having no idea at all about what to do with that piece of code :?
These adjectives are correct for the Chandler Burning Index. The "Forest Fire Weather Index" and/or "Fire Weather Index" used in some countries has added Catastrophic and may have dropped Moderate.
wheels
Posts: 16
Joined: Fri 26 Sep 2008 10:53 pm
Weather Station: Fine Offset WH1081
Operating System: XP
Location: Otatara New Zealand

Re: Chandler Burning Index

Post by wheels »

Re. FWI Calc.

What tags are are you using from cumulus?
In particular where FWI wants the rain in last 24hrs. the closest I can find is yesterdays total rain which is 12hrs behind.
I am reluctant to use total rainfall for year as sometimes get strange readings (Fine offset, though no problems since tightened usb plug), and total rainfall may cause problem at start of new year.
thanks
wayne
User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Re: Chandler Burning Index

Post by GraemeT »

Use the previous 24 hours rainfall as described in the FWI help.
I'm using this file: http://weather.gktnet.com/fwi.txt

Here is some simple php code to create fwi.txt. I'm running it as a task from Windoze Scheduler once a day, at about midday.

Code: Select all

<?php
// Build space-delimited text file for FWI data
// Fields are: Date,Temperature,Humidity,Windspeed,Rainfall
// Input data defined in main php script
$fwidat = $date . " " . $temp . " " . $hum . " " . $wspeed . " " . $rfallY;
$fwi = PutData("fwi.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 );
}
?>
Here's a link to the webtags file I've built for those who want to play with some of the 87 tags FWI offers.

http://weather.gktnet.com/common_files/fwiwebtags.txt

You tell FWI to process this file into fwiwebtags.php and then use it as you would cumuluswebtags.php.
Last edited by GraemeT on Thu 10 Jun 2010 12:53 am, edited 1 time in total.
Cheers,
Graeme.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Chandler Burning Index

Post by n9mfk »

Hi Graeme,
what do you mean by
You tell FWI to process this file into fwiwebtags.php
thanks beau
User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Re: Chandler Burning Index

Post by GraemeT »

Beau

In menu: Web/File Options I set the input file to fwiwebtags.txt and output file to fwiwebtags.php - just as in Cumulus
In File Processing Options I set the path to the file containing my current weather data (eg. fwi.txt)

When you click Apply / Test / Process now, the main display should update if all is well.

If not, just follow Churchill's adage of "KBO - Keep Buggering On"

cheers
Cheers,
Graeme.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Chandler Burning Index

Post by n9mfk »

Hi Graeme,
I am not clear how you get the data from Cumulus in to fwi calc ?
thanks beau
User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Re: Chandler Burning Index

Post by GraemeT »

As mentioned previously, my code runs automatically as a scheduled task.
It is actually part of a larger script which I to use to process several other datasets for use on my website.

The code can be inserted inline in a php webpage and used to create fwi.txt when the page is manually loaded. The file would in turn be processed by fwi.exe

Of course, all of this assumes a php-enabled web server.

I am just a learner on windows task scheduler, but there's quite a lot of information both in other posts here and out on the internet to help with using it.
Cheers,
Graeme.
n9mfk
Posts: 845
Joined: Sun 10 May 2009 8:52 pm
Weather Station: davis vp2 Serial datalogger
Operating System: Windows 7 64-bit
Location: Springfield, IL

Re: Chandler Burning Index

Post by n9mfk »

Hi Graeme,

this code builds fwi.txt on web host when triggered by windows task scheduler
my question is if the file on your web host how do you get the fwi.txt to the pc were fwi calc is ?

Code: Select all

<?php
// Build space-delimited text file for FWI data
// Fields are: Date,Temperature,Humidity,Windspeed,Rainfall
// Input data defined in main php script
$fwidat = $date . " " . $temp . " " . $hum . " " . $wspeed . " " . $rfallY;
$fwi = PutData("fwi.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 );
}
?>
Thanks beau
User avatar
GraemeT
Posts: 312
Joined: Wed 21 Oct 2009 11:19 am
Weather Station: La Crosse WS-2355 & WS-2306
Operating System: Windoze 7, 10, 11
Location: Bayswater, Australia
Contact:

Re: Chandler Burning Index

Post by GraemeT »

Hi Beau,

I have FWI and Cumulus running on the same machine as my web-server, so it's not a problem
as they both have direct file access.

If you use a remote web host with FWI and Cumulus running locally then you you should be able to have the windows task save the data file locally.
You can then insert the correct path to the file in the FWI 'File Processing Options' field.

I hope this helps.
Cheers,
Graeme.
Post Reply