Revised Chandler Burning Index calculated by a virtual sensor

Moderator: Mattk

Post Reply
User avatar
Expert Boarder
Expert Boarder
Posts: 137
Joined: Fri Mar 13, 2009 12:58 am
Location: Reno, Nevada USA

Revised Chandler Burning Index calculated by a virtual sensor

Post by d_l »

I previously had posted a way to compute the Chandler Burning Index with a virtual sensor. On another weather forum, it was suggested that the CBI should never be below 0 or above 100 even though the raw formula will calculate these extremes under certain weather conditions. Note that there is another popular PHP program which calculates the CBI, but does not limit the output to the 0 to 100 range. I couldn't find any "official" CBI definitions to confirm these limits, but it does seem that the the constriction of the numerical ranges of the higher fire severity categories suggests that the 100 numerical cap is valid.

I reworked my old AWK conversion script to impose these limits. Although this new script is fairly simple, it took some trial-and-error programming/recompute attempts to get it to work. The AWK/GAWK manuals do not fully address how to arrange the elements of multiple conditional tests, equations, and printfs within a compact Meteohub-type AWK script. Nor do they address the immensely significant fact that the Meteohub's internal calculations are computed at full values and then divided by 100 before being displayed as a Meteohub sensor value. This CBI virtual sensor is also programmed to round up values greater or equal than x.5 and round down those below to yield a "decimal integer".

First of all, this computation is still using Meteohub version 4.6t (I don't update often), but I think it should run correctly on later versions.

These are the updated "how-to" settings:

For your virtual sensor, define the following:
New ID - data#
Name - CBI or what ever you wish
Trigger - th#
Conversion - awk ' { cbi = ((110 - 1.373 * $4) - 0.54 * (10.20 - $3 / 10)) * (124 * 10 ** (-0.0142 * $4)) / 60; if (cbi < 0) cbi = 0; if (cbi > 100) cbi = 100; cbi = int (cbi -- 0.5) * 100; printf ''%i'', cbi } '

Simply copy and paste the AWK script into the conversion box in order to avoid entry mistakes.

The Chandler Burning Index formula is CBI = (((110 - 1.373*RH) - 0.54 * (10.20 - T)) * (124 * 10^(-0.0142*RH)))/60. Note that the temperature value as output by the Meteohub must be divided by 10 and the overall index number multiplied by 100 to produce the correct CBI value. I also could not get the exponentiation symbol "^" to work. It errored as "_". So I switched the formula to a double asterisk "**" which is supposed to be equivalent to "^".

For now, I've been plotting the CBI on a simple 24 hr graph with an explanation of the different color code levels underneath the graph -

Edit: In the U.S., the most common way of depicting the Chandler Burning Index level is a Smokey Bear graphic with a dial graph pointing to the fire danger level. The PHP script for this graphic had previously been modified to collect input data from a Weather Display input file.

Because the Meteohub can calculate the CBI, this PHP script, now called firedangerMet.php, has been greatly modified/simplified to collect input data from a firedanger.txt generated by the Meteohub. On the graph/data upload schedule page, simply use firedanger.txt as the file name for the HTML template upload. These HTML template uploads are described in the Meteohub-v4.7en manual, sections 2.11.4 and 3.4. The HTML upload template file is composed of the following data variables.:

[actual_data##_value_num] [actual_th0_temp_f] [actual_th0_hum_rel]

where [actual_data##_value_num] is the data## virtual sensor for the CBI computed by the Meteohub.

The firedangerMet.php script has also been modified to show No Data, if the Meteohub's data logging has been paused for too long or if there has been some other problem with the CBI output.

To use the firedangerMet.php script contained within the file, the file path to the firedanger.txt file must be specified within the script. Determining the complete file path might be the hardest part of implementing this script. The various Smokey Bear fire danger graphics are also contained in the zip file:
(44.11 KiB) Downloaded 46 times

Post Reply