Author Topic: Fire Danger  (Read 3686 times)

0 Members and 1 Guest are viewing this topic.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Fire Danger
« on: February 25, 2017, 11:29:53 AM »
I would like to figure out a way to add Fire Danger to my pages.  Something like the one on the following screen.  It wouldn't even have to be a graphic.  I'd be happy with even just text that would appear.

http://silveracorn.nz/weather/

Things can get awfully dry up here in ND.  Coupled with our windy prairie, things can go bad in a hurry.

Thanks in advance.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 923
    • North Bend Weather
Re: Fire Danger
« Reply #1 on: February 25, 2017, 01:07:39 PM »
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #2 on: February 25, 2017, 01:20:57 PM »
That doesn't look like it supports Cumulus though.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #3 on: February 25, 2017, 01:43:41 PM »
The other script I can't seem to find is the Climate Prediction Center Outlook like on this page:

http://gosportwx.com/wxcpcoutlook.php
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline ALITTLEweird1

  • Mark
  • Global Moderator
  • Forecaster
  • *****
  • Posts: 923
    • North Bend Weather
Re: Fire Danger
« Reply #4 on: February 25, 2017, 01:59:59 PM »
I wonder if that is in a iframe.
"Nature can do without man, but man cannot do without nature."


Software: WeatherDisplay
Hardware: Davis VP2 + VP2 Solar + VP2 UV + Lightning Detector + Logitech Webcam + Soil temp + Soil Moisture

Offline Maumelle Weather

  • Forecaster
  • *****
  • Posts: 1824
    • Maumelle Weather
Re: Fire Danger
« Reply #5 on: February 25, 2017, 02:13:52 PM »
The other script I can't seem to find is the Climate Prediction Center Outlook like on this page:

http://gosportwx.com/wxcpcoutlook.php

That CPC script looks like Gerry Wilkin's. It's here on the Forum.
GR2AE, GR3, Cumulus

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #6 on: February 25, 2017, 02:20:14 PM »
The Fire Danger Index can be derived from the basic parameters (temp, humidity), it is not 100% accurate, but everything you need for that is in the realtime.txt generated by Cumulus.

You can use the formula I use in my template, it is given here:
http://www.meteotemplate.com/template/plugins/fireDanger/fireDanger.php

Offline SLOweather

  • Global Moderator
  • Forecaster
  • *****
  • Posts: 3456
    • Weatherelement Moline IL
Re: Fire Danger
« Reply #7 on: February 25, 2017, 02:27:32 PM »
That doesn't look like it supports Cumulus though.

It will work directly if you can get Cumulus to upload a stickertags.txt formatted file as used in Anole's sticker script. That's where I started. :)

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #8 on: February 25, 2017, 02:34:51 PM »
I would like to figure out a way to add Fire Danger to my pages.  Something like the one on the following screen.  It wouldn't even have to be a graphic.  I'd be happy with even just text that would appear.

http://silveracorn.nz/weather/

Things can get awfully dry up here in ND.  Coupled with our windy prairie, things can go bad in a hurry.

Thanks in advance.

If you have realtime.txt being uploaded regularly to your server I could help you creating a PHP snippet to read the data in it and calculate the FI

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #9 on: February 25, 2017, 02:49:53 PM »
If you have realtime.txt being uploaded regularly to your server I could help you creating a PHP snippet to read the data in it and calculate the FI

I do have a realtime.txt being uploaded to the root of my site.  Currently at http://beta.bismarckweather.net/realtime.txt  But I'll probably be switching that "beta" site over to production this afternoon.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #10 on: February 25, 2017, 02:51:02 PM »
That CPC script looks like Gerry Wilkin's. It's here on the Forum.

You have a forum name I can PM him?  Hopefully he'll pop on.  I've always digged the CPC predictions.  Would be awesome to get it added.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #11 on: February 25, 2017, 02:52:35 PM »
If you're not already familiar with the realtime.txt format:

http://wiki.sandaysoft.com/a/Realtime.txt
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #12 on: February 25, 2017, 03:25:31 PM »
If you have realtime.txt being uploaded regularly to your server I could help you creating a PHP snippet to read the data in it and calculate the FI

I do have a realtime.txt being uploaded to the root of my site.  Currently at http://beta.bismarckweather.net/realtime.txt  But I'll probably be switching that "beta" site over to production this afternoon.

Then we could make a simple PHP script which will read your realtime.txt - get the temperature and humidity and output the fire danger index

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #13 on: February 25, 2017, 04:18:20 PM »
I like your existing PHP file with the description and everything.  It would just need to be "dumbed" down to fit with my existing CSS, etc and read the realtime.

I like the fact you have an explanation on your page.  Not many here in North Dakota would be familiar with CBI.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #14 on: February 25, 2017, 05:05:26 PM »
Well I could transform it into stand-alone script which you could insert on your site, but it would then just give the raw numbers, you would probably have to do the CSS yourself depending on how you want it to look like

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #15 on: February 25, 2017, 05:22:58 PM »
and I would definitely need a link to your realtime.txt, because the file is not standardized so I have to know how yours looks like

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #16 on: February 25, 2017, 06:14:10 PM »
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #17 on: February 25, 2017, 06:19:22 PM »
OK, Im gonna look at it, it might take some time because I will have to change the data source from the Meteotemplate database to your realtime and also include all the dependencies which are loaded by the core template files to make this work stand-alone

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #18 on: February 25, 2017, 06:34:34 PM »
OK, try this. I changed the data input from Meteotemplate database to your Realtime, I hard-coded the descriptions (originally they used the dynamic Meteotemplate string translation, so yours will only work in English) and I included the necessary functions. See if it works. The first part goes to the PHP part of the page, second is HTML

Code: [Select]
<?php

    $rawDataRAW 
file_get_contents("http://www.bismarckweather.net/realtime.txt");
    
$data explode(" ",$rawDataRAW);
    
$TF trim($data[2]); // data in Farenheit
    
$TC = ($TF 32)/1.8// convert to Celsius
    
$H trim($data[3]); // load humidity

    
$CBI = (((110 1.373*$H) - 0.54 * (10.20 $TC)) * (124 pow(10,(-0.0142*$H))))/60;

    if(
$CBI<0){
$CBI=0;
}

if($CBI<50){
$severity 0;
}
else if($CBI>=50 && $CBI<75){
$severity 1;
}
else if($CBI>=75 && $CBI<90){
$severity 2;
}
else if($CBI>=90 && $CBI<97.5){
$severity 3;
}
else{
$severity 4;
}

$description = array();
$description[0] = 'Fuels do not ignite readily from small firebrands although a more intense heat source, such as lightning, may start fires in duff or punky wood. Fires in open cured grasslands may burn freely a few hours after rain, but woods fires spread slowly by creeping or smoldering, and burn in irregular fingers. There is little danger of spotting.';
$description[1] = 'Fires can start from most accidental causes but, with the exception of lightning fires in some areas, the number of starts is generally low. Fires in open cured grasslands will burn briskly and spread rapidly on windy days. Timber fires spread slowly to moderately fast. The average fire is of moderate intensity, although heavy concentrations of fuel, especially draped fuel, may burn hot. Short-distance spotting may occur, but is not persistent. Fires are not likely to become serious and control is relatively easy.';
$description[2] = 'All fine dead fuels ignite readily and fires start easily from most causes. Unattended brush and campfires are likely to escape. Fires spread rapidly and short-distance spotting is common. High-intensity burning may develop on slopes or in concentrations of fine fuels. Fires may become serious and their control difficult unless they are attacked successfully while small.';
$description[3] = 'Fires start easily from all causes and, immediately after ignition, spread rapidly and increase quickly in intensity. Spot fires are a constant danger. Fires burning in light fuels may quickly develop high intensity characteristics such as long-distance spotting and fire whirlwinds when they burn into heavier fuels.';
$description[4] = 'Fires start quickly, spread furiously, and burn intensely. All fires are potentially serious. Development into high intensity burning will usually be faster and occur from smaller fires than in the very high fire danger class. Direct attack is rarely possible and may be dangerous except immediately after ignition. Fires that develop headway in heavy slash or in conifer stands may be unmanageable while the extreme burning condition lasts. Under these conditions the only effective and safe control action is on the flanks until the weather changes or the fuel supply lessens.';

$valuecbi = array();
$valuecbi[0] = "CBI < 50";
$valuecbi[1] = "50 < CBI < 75";
$valuecbi[2] = "75 < CBI < 90";
$valuecbi[3] = "90 < CBI < 97,5";
$valuecbi[4] = "CBI > 98";

$valuecbiwd = array();
$valuecbiwd[0] = 'Low';
$valuecbiwd[1] = 'Moderate';
$valuecbiwd[2] = 'High';
$valuecbiwd[3] = 'Very High';
$valuecbiwd[4] = 'Extreme';

?>

<div id="mainFire">
    <br>
    <h1>
        Fire Danger Index
    </h1>
    <br><br>
    <div id="divCBI" class="indexDiv">
        <table style="width:80%;margin:0 auto">
            <tr>
                <td style="width:33%">
                    <h2>Chandler Burning Index (CBI)</h2>
                    <p style="text-align:justify">The Chandler Burning Index (CBI) uses the air temperature and relative humidity to calculate a numerical index of fire danger. That number is then equated to the Fire Danger severity of either extreme, very high, high, moderate, or low. It\'s based solely on weather conditions, with no adjustment for fuel moisture.$argc</p>
                    <table style="width:100%;margin:0 auto" class="table">
                        <tr>
                            <td>
                                CBI < 50
                            </td>
                            <td style="text-align:left">
                                Low
                            </td>
                        </tr>
                        <tr>
                            <td>
                                50 < CBI < 75
                            </td>
                            <td style="text-align:left">
                                Moderate
                            </td>
                        </tr>
                        <tr>
                            <td>
                                75 < CBI < 90
                            </td>
                            <td style="text-align:left">
                                High
                            </td>
                        </tr>
                        <tr>
                            <td>
                                90 < CBI < 97,5
                            </td>
                            <td style="text-align:left">
                                Very High
                            </td>
                        </tr>
                        <tr>
                            <td>
                                CBI > 98
                            </td>
                            <td style="text-align:left">
                                Extreme
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width:33%">
                    <div id="CBI" class="actualValue">
                        <h2><?php echo round($CBI)?></h2>
                    </div>
                </td>
                <td style="text-align:justify">
                    <div id="text" style="margin-left:auto;margin-right:auto;width:80%;text-align:center;font-size:1.1em">
                        <h2>Current risk</h2>
                    </div>
                    <br>
                    <div id="text" style="margin-left:auto;margin-right:auto;width:80%;text-align:center;font-size:1.1em">
                        <strong style="font-size:1.5em"><?php echo $valuecbi[$severity]?></strong>
                        <p style="width:100%;font-size:1.5em;text-decoration:underline"><?php echo $valuecbiwd[$severity]?></p>
                    </div>
                    <br>
                    <div id="text" style="margin-left:auto;margin-right:auto;width:80%;text-align:justify;font-size:1.1em">
                        <?php echo $description[$severity]?>
                    </div>
                </td>
            </tr>
        </table>
    </div>

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #19 on: February 25, 2017, 06:45:52 PM »
Formatting is off just a bit.  But real close.  My zero is just stuck in the middle in an odd spot.

http://www.bismarckweather.net/fire.php
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #20 on: February 25, 2017, 06:53:29 PM »
OK, yes...
Im actually surprised it looks this good because the HTML was more or less just for demonstration purposes, I did not know where and how you are going to integrate this. OK now I see so I will send you a modified version for Saratoga. Hang on.

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #21 on: February 25, 2017, 06:54:47 PM »
Sweet!  Much appreciated.   Coders like you are what makes this forum so great.
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #22 on: February 25, 2017, 06:57:37 PM »
Leave the PHP part as is, for the HTML try this:

Code: [Select]
<div id="mainFire">
    <br>
    <h1>
        Fire Danger Index
    </h1>
    <br><br>
    <div style="width:98%;margin:0 auto;text-align:center">
        <span style="font-size:3.0em"><?php echo round($CBI)?></span>
    </div>
    <div style="width:98%;margin:0 auto;text-align:center">
        <table style="width:80%;margin:0 auto">
            <tr>
                <td style="width:50%;vertical-align:top;text-align:justify">
                    <h2>Chandler Burning Index (CBI)</h2>
                    <p style="text-align:justify">The Chandler Burning Index (CBI) uses the air temperature and relative humidity to calculate a numerical index of fire danger. That number is then equated to the Fire Danger severity of either extreme, very high, high, moderate, or low. It\'s based solely on weather conditions, with no adjustment for fuel moisture.</p>
                    <table style="width:100%;margin:0 auto">
                        <tr>
                            <td>
                                CBI < 50
                            </td>
                            <td style="text-align:left">
                                Low
                            </td>
                        </tr>
                        <tr>
                            <td>
                                50 < CBI < 75
                            </td>
                            <td style="text-align:left">
                                Moderate
                            </td>
                        </tr>
                        <tr>
                            <td>
                                75 < CBI < 90
                            </td>
                            <td style="text-align:left">
                                High
                            </td>
                        </tr>
                        <tr>
                            <td>
                                90 < CBI < 97,5
                            </td>
                            <td style="text-align:left">
                                Very High
                            </td>
                        </tr>
                        <tr>
                            <td>
                                CBI > 98
                            </td>
                            <td style="text-align:left">
                                Extreme
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width:50%;vertical-align:top">
                    <div id="text" style="margin-left:auto;margin-right:auto;width:80%;text-align:center;font-size:1.1em">
                        <h2>Current risk</h2>
                    </div>
                    <br>
                    <div id="text" style="margin-left:auto;margin-right:auto;width:80%;text-align:center;font-size:1.1em">
                        <strong style="font-size:1.5em"><?php echo $valuecbi[$severity]?></strong>
                        <p style="width:100%;font-size:1.5em;text-decoration:underline"><?php echo $valuecbiwd[$severity]?></p>
                    </div>
                    <br>
                    <div id="text" style="margin-left:auto;margin-right:auto;width:80%;text-align:justify;font-size:1.1em">
                        <?php echo $description[$severity]?>
                    </div>
                </td>
            </tr>
        </table>
    </div>

Offline 92merc

  • BismarckWeather.net
  • Forecaster
  • *****
  • Posts: 1308
  • BismarckWeather.net
    • BismarckWeather.net
Re: Fire Danger
« Reply #23 on: February 25, 2017, 07:05:00 PM »
Better.  Zero is still somewhat floating out there.  Maybe it needs some text near it?
https://www.BismarckWeather.net
Davis VP2, Cumulus, WeatherDisplay, Blitzortung, Saratoga Scripts, NOAA Stream via PI

Offline Jáchym

  • Meteotemplate Developer
  • Forecaster
  • *****
  • Posts: 8605
    • Meteotemplate
Re: Fire Danger
« Reply #24 on: February 25, 2017, 07:07:49 PM »
OK, looks like you added the CBI=0 there, I think it is ok now:

http://www.bismarckweather.net/fire.php

 

anything