Example #1
0
include "../../../config/settings.inc.php";
include "../../../include/myview.php";
$t = new MyView();
$station = isset($_GET["station"]) ? $_GET["station"] : "";
$year = isset($_GET["year"]) ? $_GET["year"] : date("Y");
$month = isset($_GET["month"]) ? $_GET["month"] : date("m");
$day = isset($_GET["day"]) ? $_GET["day"] : date("d");
$t->thispage = "networks-awos";
$t->title = "AWOS 1 Minute Time Series";
include "../../../include/imagemaps.php";
include "../../../include/forms.php";
$nselect = networkSelect("AWOS", $station);
$yselect = yearSelect(1995, 2011, $year);
$mselect = monthSelect($month);
$dselect = daySelect($day);
$content = <<<EOF
<ol class="breadcrumb">
 <li><a href="/AWOS/">AWOS Network</a></li>
 <li class="active">One minute time series</li>
</ol>

<p><b>Note:</b>The archive currently contains data from 1 Jan 1995 
till the end of the previous month.  Fort Dodge and Clinton were converted to ~ASOS, 
but are available for some times earlier in the archive.<p>

  <form method="GET" action="1station_1min.php">
Make plot selections: <br>
    {$nselect} 
 
   {$yselect}
Example #2
0
include "../../config/settings.inc.php";
define("IEM_APPID", 156);
include_once "../../include/myview.php";
include_once "../../include/database.inc.php";
include_once "../../include/forms.php";
include_once "../../include/imagemaps.php";
include_once "../../include/network.php";
$nt = new NetworkTable("NWSCLI");
$station = isset($_GET["station"]) ? $_GET["station"] : 'KDSM';
$year = isset($_GET["year"]) ? intval($_GET["year"]) : date("Y");
$month = isset($_GET["month"]) ? intval($_GET["month"]) : null;
$day = isset($_GET["day"]) ? intval($_GET["day"]) : null;
$opt = isset($_GET["opt"]) ? $_GET["opt"] : "bystation";
$ys = yearSelect(2009, $year, "year");
$ms = monthSelect($month, "month");
$ds = daySelect($day, "day");
$pgconn = iemdb("iem");
$byday = false;
if ($opt === "bystation") {
    $title = sprintf("Station: %s for Year: %s", $station, $year);
    $col1label = "Date";
    $rs = pg_prepare($pgconn, "SELECT", "SELECT *,\n\t\t\tarray_to_string(high_record_years, ' ') as hry,\n\t\t\tarray_to_string(low_record_years, ' ') as lry,\n\t\t\tarray_to_string(precip_record_years, ' ') as pry,\n\t\t\tarray_to_string(snow_record_years, ' ') as sry\n\t\t\tfrom cli_data where\n\t\t\tstation = \$1 and valid BETWEEN \$2 and \$3 ORDER by valid ASC");
    $rs = pg_execute($pgconn, "SELECT", array($station, "{$year}-01-01", "{$year}-12-31"));
} else {
    $col1label = "Station";
    $byday = true;
    $day = mktime(0, 0, 0, $month, $day, $year);
    $title = sprintf("All Stations for Date: %s", date("d F Y", $day));
    $rs = pg_prepare($pgconn, "SELECT", "SELECT *,\n\t\t\tarray_to_string(high_record_years, ' ') as hry,\n\t\t\tarray_to_string(low_record_years, ' ') as lry,\n\t\t\tarray_to_string(precip_record_years, ' ') as pry,\n\t\t\tarray_to_string(snow_record_years, ' ') as sry\n\t\t\tfrom cli_data where\n\t\t\tvalid = \$1 ORDER by station ASC");
    $rs = pg_execute($pgconn, "SELECT", array(date("Y-m-d", $day)));
}
Example #3
0
\t\t}
\t}
\tif (hide){
\t\tdocument.getElementById("metar_toggle").innerHTML = "Show METARs";
\t} else{
\t\tdocument.getElementById("metar_toggle").innerHTML = "Hide METARs";
\t}
\thide = !hide;
}
</script>
EOF;
$dstr = date("d F Y", $date);
$tzname = $metadata["tzname"];
$ys = yearSelect($startyear, date("Y", $date));
$ms = monthSelect(date("m", $date));
$ds = daySelect(date("d", $date));
$mbutton = preg_match("/ASOS|AWOS/", $network) ? "<a onclick=\"javascript:hideMetars();\" class=\"btn btn-default\" id=\"metar_toggle\">Show Metars</a>" : "";
$content = <<<EOF
<style>
.high {
  color: #F00;
}
.low {
  color: #00F;
}
.metar {
  display: none;
}
</style>

<h3>{$dstr} Observation History, timezone: {$tzname}</h3>
Example #4
0
    $t->headextra = <<<EOF
<link rel="stylesheet" href="/vendor/openlayers/{$OL}/ol.css" type="text/css">
<link type="text/css" href="/vendor/openlayers/{$OL}/ol3-layerswitcher.css" rel="stylesheet" />
EOF;
    $t->jsextra = <<<EOF
<script src="/vendor/openlayers/{$OL}/ol.js" type="text/javascript"></script>
<script src='/vendor/openlayers/{$OL}/ol3-layerswitcher.js'></script>
<script src="/js/olselect.php?network={$network}"></script>
EOF;
}
$t->title = "SchoolNet One Minute Time Series";
$t->thispage = "networks-schoolnet";
$nselect = networkSelect($network, $station);
$ys = yearSelect2(2002, $year, "year");
$ms = monthSelect($month);
$ds = daySelect($day);
$content = "";
if (strlen($station) > 0) {
    $content .= sprintf("<p><img src=\"1min_T.php?station=%s&year=%s&month=%s&day=%s\" />", $station, $year, $month, $day);
    $content .= sprintf("<p><img src=\"1min_V.php?station=%s&year=%s&month=%s&day=%s\" />", $station, $year, $month, $day);
    $content .= sprintf("<p><img src=\"1min_P.php?station=%s&year=%s&month=%s&day=%s\" />", $station, $year, $month, $day);
    $content .= "<p><b>Note:</b> The wind speeds are indicated every minute by the red line.  The blue dots represent wind direction and are shown every 10 minutes.</p>";
} else {
    $content = <<<EOF

<p>or select from this map...<p>

<div class="row well">
 <div class="col-md-4 col-sm-4">
<a href="?network=KCCI" style="text-decoration: none;">
   <img src="/schoolnet/images/kcci8.jpg" border="0"><br /><b>SchoolNet8</b></a>
Example #5
0
    }
    if ($sortdir == 'ASC') {
        $sorted_data = sortBySecondIndex($data, $sortcol);
    } else {
        $sorted_data = aSortBySecondIndex($data, $sortcol);
    }
    while (list($key, $val) = each($sorted_data)) {
        $link = sprintf("extremes.php?station=%s&amp;network=%s&amp;tbl=%s", $val["station"], $network, $tbl);
        $table .= sprintf("<tr><td><a href=\"%s\">%s</a> (%s)</td><td>%s</td>\n \t\t\t\t<td>%.1f</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>\n \t\t\t\t<td></td>\n \t\t\t\t<td>%.1f</td><td>%s</td><td>%s</td><td>%s</td><td>%s</td>\n \t\t\t\t<td></td>\n \t\t\t\t<td>%.2f</td><td>%.2f</td><td>%s</td>\n \t\t\t\t</tr>", $link, $cities[$val["station"]]['name'], $val["station"], $val["years"], $val["avg_high"], $val["max_high"], implode(", ", $val["max_high_years"]), $val["min_high"], implode(", ", $val["min_high_years"]), $val["avg_low"], $val["max_low"], implode(", ", $val["max_low_years"]), $val["min_low"], implode(", ", $val["min_low_years"]), $val["avg_precip"], $val["max_precip"], implode(", ", $val["max_precip_years"]));
    }
    $h3 = "<h3>NWS COOP Climatology for " . date("d F", $valid) . "</h3>";
}
$ar = array("ILCLIMATE" => "Illinois", "INCLIMATE" => "Indiana", "IACLIMATE" => "Iowa", "KSCLIMATE" => "Kansas", "KYCLIMATE" => "Kentucky", "MICLIMATE" => "Michigan", "MNCLIMATE" => "Minnesota", "MOCLIMATE" => "Missouri", "NECLIMATE" => "Nebraska", "NDCLIMATE" => "North Dakota", "OHCLIMATE" => "Ohio", "SDCLIMATE" => "South Dakota", "WICLIMATE" => "Wisconsin");
$netselect = make_select("network", $network, $ar);
$mselect = monthSelect($month, "month");
$dselect = daySelect($day, "day");
$ar = array("climate" => "All Available", "climate51" => "Since 1951", "climate71" => "1971-2000", "climate81" => "1981-2010");
$tblselect = make_select("tbl", $tbl, $ar);
$sortdir2 = $sortdir == 'ASC' ? 'DESC' : 'ASC';
if ($station != null) {
    $uribase = sprintf("&station=%s&network=%s&tbl=%s&amp;sortdir=%s", $station, $network, $tbl, $sortdir2);
    $h4 = "<a href='extremes.php?sortcol=valid" . $uribase . "'>Date</a>";
} else {
    $uribase = sprintf("&day=%s&month=%s&network=%s&tbl=%s&amp;sortdir=%s", $day, $month, $network, $tbl, $sortdir2);
    $h4 = "<a href='extremes.php?sortcol=station&day=" . $day . "&month=" . $month . "'>Station</a>";
}
$t->content = <<<EOF
 
 {$h3}
 
<p>This table gives a listing of <b>unofficial</b> daily records for NWS
Example #6
0
    $pt->draw($map, $datal, $img, 0, $row["d"]);
}
$namer->draw($img);
$counties->draw($img);
$stlayer->draw($img);
//$ttt->draw($img);
$datal->draw($img);
iemmap_title($map, $img, $plotDate . " " . $var[$plot]);
$map->drawLabelCache($img);
$url = $img->saveWebImage();
$ar = array("all" => "Iowa", "ne" => "NE Iowa", "se" => "SE Iowa", "sw" => "SW Iowa", "nw" => "NW Iowa");
$aselect = make_select("area", $area, $ar);
$ar = array("high" => "Average High Temperature", "low" => "Average Low Temperature", "precip" => "Average Precip", "max_high" => "Record High Temperature", "min_low" => "Record Low Temperature", "max_precip" => "Record Precip", "min_high" => "Record Minimum High Temp", "max_low" => "Record Maximum Low Temp");
$pselect = make_select("plot", $plot, $ar);
$mselect = monthSelect("month", $month);
$dselect = daySelect("day", $day);
$t->content = <<<EOF
<h3>COOP Climate Data</h3>

 Using the COOP data archive, daily averages and extremes
  were calculated.  These numbers are <b>not</b> official, but we believe them
  to be accurate.  Please make your form selections on the left hand side and
  then click the 'Generate Plot' button.

  <div class="row">
  <div class="col-md-7">

<img src="{$url}" class="img img-responsive" />
   <br><i>You can right-click on the image to save it.</i>
  <br><li>Only one year with the record value is shown, there may have been 
    more.</li>
Example #7
0
    function htmlEditor()
    {
        global $basins;
        $s = '
		<input type="hidden" value="' . $this->id . '" name="id">
<p><b>Name of Storm Event:</b> <input type="text" name="name" value="' . $this->name . '">

<script LANGUAGE="JavaScript1.2" type="text/javascript">
//<!--

function setMonth()
{
  for (i=0; i<13; i++)
  {
    document.estorm["r_month_"+ i].selectedIndex = document.estorm.gmonth.selectedIndex;
  }
}
function setDay()
{
  for (i=0; i<13; i++)
  {
    document.estorm["r_day_"+ i].selectedIndex = document.estorm.gday.selectedIndex;
  }
}
function setHour()
{
  for (i=0; i<13; i++)
  {
    document.estorm["r_hour_"+ i].selectedIndex = document.estorm.ghour.selectedIndex;
  }
}

-->
</script>


<p><b>Date Defaults:</b>
 <br /><i>Modify these items to set all times at once:</i>
<br /><b>Month:</b>  
<select name="gmonth" onchange="javascript: setMonth();">
 <option value="1">January
 <option value="2">February
 <option value="3">March
 <option value="4">April
 <option value="5">May
 <option value="6">June
 <option value="7">July
 <option value="8">August
 <option value="9">September
 <option value="10">October
 <option value="11">November
 <option value="12">December
</select>

<b>Day:</b>
<select name="gday" onchange="javascript: setDay();">
 <option value="1">1 <option value="2">2 <option value="3">3 
 <option value="4">4 <option value="5">5 <option value="6">6 
 <option value="7">7 <option value="8">8 <option value="9">9 
 <option value="10">10 <option value="11">11 <option value="12">12 
 <option value="13">13 <option value="14">14 <option value="15">15 
 <option value="16">16 <option value="17">17 <option value="18">18 
 <option value="19">19 <option value="20">20 <option value="21">21 
 <option value="22">22 <option value="23">23 <option value="24">24 
 <option value="25">25 <option value="26">26 <option value="27">27 
 <option value="28">28 <option value="29">29 <option value="30">30 
 <option value="31">31
</select>

<b>Hour:</b>  
<select name="ghour" onchange="javascript: setHour();">
 <option value="0">Midnight
 <option value="1">1 AM
 <option value="2">2 AM
 <option value="3">3 AM
 <option value="4">4 AM
 <option value="5">5 AM
 <option value="6">6 AM
 <option value="7">7 AM
 <option value="8">8 AM
 <option value="9">9 AM
 <option value="10">10 AM
 <option value="11">11 AM
 <option value="12">Noon
 <option value="13">1 PM
 <option value="14">2 PM
 <option value="15">3 PM
 <option value="16">4 PM
 <option value="17">5 PM
 <option value="18">6 PM
 <option value="19">7 PM
 <option value="20">8 PM
 <option value="21">9 PM
 <option value="22">10 PM
 <option value="23">11 PM
</select>


<p><b>Enter Rainfall Totals:</b>
<table class="ruler">
<thead>
<tr>
        <th>ID:</th>
        <th>Basin:</th>
        <th>Storm Precip:</th>
        <th>Month:</th>
        <th>Day:</th>
        <th>Hour:</th>
        <th>Duration (hrs):</th>
        </tr>
</thead>
                                                                                
<tbody>
';
        for ($i = 0; $i < 13; $i++) {
            $s .= "<tr class=\"row" . $i % 2 . "\"><th>{$i}</th>\n\t\t <th>" . $basins[$i]["name"] . "</th>\n\t\t <td><input type=\"text\" size=\"5\" name=\"r_stp_{$i}\" value=\"" . $this->data[$i]["precip"] . "\"></td>\n <td>" . monthSelect(date("m", $this->data[$i]["sts"]), "r_month_{$i}") . "</td>\n <td>" . daySelect(date("d", $this->data[$i]["sts"]), "r_day_{$i}") . "</td>\n <td>" . localHourSelect(date("G", $this->data[$i]["sts"]), "r_hour_{$i}") . "</td>\n\t\t <td><input type=\"text\" size=\"5\" name=\"r_dur_{$i}\" value=\"" . $this->data[$i]["dur"] . "\"></td>\n\t\t </tr>";
        }
        $s .= '</tbody></table>';
        $s .= '<p><b>Year of Event:</b>
<input type="text" value="2005" name="year" size="5">
		<p><b>Notes on event:</b><br>
<textarea name="notes" cols=60 rows=5>' . $this->notes . '</textarea>';
        return $s;
    }