Пример #1
0
    reset($warn["lsrs"]);
    if (sizeof($warn["lsrs"]) == 0 && $warn["verify"]) {
        $s .= "<tr><td></td><td colspan=\"10\">The warning above had one or more local\n  \t\t\tstorm reports that were within previously issued warnings and are\n  \t\t\tnot double counted here.  Thus the warning appears as verified,\n  \t\t\tbut no local storm reports are shown. Future code improvements may \n  \t\t\tbe added to the Cow to better account for these.</td></tr>";
    }
    while (list($k, $lsr) = each($warn["lsrs"])) {
        $s .= printLSR($cow->lsrs[$lsr]);
    }
    return $s;
}
include_once "../../include/cow.php";
$cow = new Cow(iemdb("postgis"));
$cow->setLimitWFO(array($wfo));
$cow->setLimitTime($sts, $ets);
$cow->setHailSize($hail);
$cow->setWind($wind);
$cow->setLimitType($wtype);
$cow->setLimitLSRType($ltype);
$cow->setLSRBuffer($lsrbuffer);
$cow->setWarningBuffer($warnbuffer);
if (isset($useWindHailTag) && $useWindHailTag == 'Y') {
    $cow->useWindHailTag = true;
}
if (isset($limitwarns) && $limitwarns == 'Y') {
    $cow->limitwarns = true;
}
$cow->milk();
$charturl = sprintf("chart.php?aw=%s&ae=%s&b=%s&c=%s&d=%s", $cow->computeWarningsVerified(), $cow->computeWarnedEvents(), $cow->computeUnwarnedEvents(), $cow->computeWarningsUnverified(), "NA");
if (sizeof($ltype) == 0) {
    $content .= "<div class='warning'>You did not select any of the Local Storm \n\tReport types above, so none are listed below...<br /><br /></div>";
}
if (sizeof($wtype) == 0) {
Пример #2
0
/*
 * Print a report of IEM Cow statistics
 * This is called from the python spammer script as it uses the output to
 * send in an email
 */
date_default_timezone_set('America/Chicago');
/* Generate some cow statistics! */
$ets = mktime(0, 0, 0, date("m"), date("d"), date("Y"));
$sts = $ets - 86400.0;
date_default_timezone_set('UTC');
include "../../include/cow.php";
include "../../include/database.inc.php";
$cow = new Cow(iemdb("postgis"));
$cow->setLimitTime($sts, $ets);
$cow->setHailSize(1.0);
$cow->setLimitType(array("TO", "SV"));
$cow->setLimitLSRType(array("TO", "SV"));
$cow->milk();
if (sizeof($cow->warnings) == 0) {
    echo "No Warnings Issued\n";
    die;
}
echo sprintf("SVR+TOR Warnings Issued: %s Verified: %s  [%.1f %%]\n", sizeof($cow->warnings), $cow->computeWarningsVerified(), $cow->computeWarningsVerifiedPercent());
echo sprintf("Reduction of Size Versus County Based     [%.1f %%]\n", $cow->computeSizeReduction());
echo sprintf("Average Perimeter Ratio                   [%.1f %%]\n", $cow->computeAveragePerimeterRatio());
echo sprintf("Percentage of Warned Area Verified (15km) [%.1f %%]\n", $cow->computeAreaVerify());
echo sprintf("Average Storm Based Warning Size          [%.0f sq km]\n", $cow->computeAverageSize());
echo sprintf("Probability of Detection(higher is better)[%.2f]\n", $cow->computePOD());
echo sprintf("False Alarm Ratio (lower is better)       [%.2f]\n", $cow->computeFAR());
echo sprintf("Critical Success Index (higher is better) [%.2f]\n", $cow->computeCSI());