<commit_before><?php 
include("../../../config/settings.inc.php");
$TITLE = "IEM | Beloit Weather Station";
$THISPAGE = "networks-other";
include("$rootpath/include/header.php");  

$year = isset( $_GET["year"] ) ? $_GET["year"] : date("Y");
$month = isset( $_GET["month"] ) ? $_GET["month"] : date("m");
$day = isset( $_GET["day"] ) ? $_GET["day"] : date("d");

include ("$rootpath/include/forms.php");
include ("$rootpath/include/iemaccess.php");
include ("$rootpath/include/iemaccessob.php");
$iem = new IEMAccess();
$iemob = $iem->getSingleSite("OT0009");
$rs = $iemob->db;

 $vardict = Array("valid" => "Observation Time", "tmpf" => "Air Temperature [F]",
   "dwpf" => "Dew Point [F]", "relh" => "Relative Humidity [%]",
   "drct" => "Wind Direction", "sknt" => "Wind Speed [knots]",
   "srad" => "Solar Radiation [W m{-2}]",
   "mslp" => "Pressure [mb]", "phour" => "Hourly Precipitation [inches]",
   "c1tmpf" => "Soil Temperature [F]");
?>

<h3 class="heading">Beloit Weather Station</h3>
<p>The <a href="http://www.lsiowa.org/residential_beloit.html">Beloit Residential Treatment Center</a> is situated in a neighborhood
area at 1323 Northwestern Avenue in Ames. Children ages 5 to 15 live in
two facilities on campus, including the new Anna J. Hull Treatment
Center. This weather station is used by the students to help their 
gardening activities.</p>

<strong>Current Observation</strong><br />
<table cellpadding="3" cellspacing="0" border="1">
<?php
  foreach ( $vardict as $key => $value ) {
    if ($rs[$key] != "") {
      if ($key == "valid") {
        $t = date("d M Y, g A", strtotime($rs[$key]));
        echo '<tr><td><b>'. $value .'</b></td><td>'. $t .'</td></tr>';
      } else {
        echo '<tr><td><b>'. $value .'</b></td><td>'. $rs[$key] .'</td></tr>';
      } // End if
    } // End if
  }
?>
</table>

<p><strong>Time Series Graph</strong><br />
Select Date after 14 May 2010:
<form method="GET" name="formerr">
<?php echo yearSelect2(2010, $year, "year"); ?>
<?php echo monthSelect($month, "month"); ?>
<?php echo daySelect($day, "day"); ?>
<input type="submit" value="Create Chart">
</form>
<br />


<img src="t_rad.php?year=<?php echo $year; ?>&month=<?php echo $month; ?>&day=<?php echo $day; ?>" />


<?php include("$rootpath/include/footer.php"); ?>
<commit_msg>add some other bells and whistles<commit_after><?php 
include("../../../config/settings.inc.php");
$TITLE = "IEM | Beloit Weather Station";
$THISPAGE = "networks-other";
include("$rootpath/include/header.php");  

$year = isset( $_GET["year"] ) ? $_GET["year"] : date("Y");
$month = isset( $_GET["month"] ) ? $_GET["month"] : date("m");
$day = isset( $_GET["day"] ) ? $_GET["day"] : date("d");

include ("$rootpath/include/forms.php");
include ("$rootpath/include/iemaccess.php");
include ("$rootpath/include/iemaccessob.php");
$iem = new IEMAccess();
$iemob = $iem->getSingleSite("OT0009");
$rs = $iemob->db;


 $vardict = Array("valid" => "Observation Time", "tmpf" => "Air Temperature [F]",
   "dwpf" => "Dew Point [F]", "relh" => "Relative Humidity [%]",
   "drct" => "Wind Direction", "sknt" => "Wind Speed [knots]",
   "srad" => "Solar Radiation [W m{-2}]",
   "mslp" => "Pressure [mb]", "phour" => "Hourly Precipitation [inches]",
   "c1tmpf" => "Soil Temperature [F]", "pday" => "Daily Precipitation [inches]");
?>

<h3 class="heading">Beloit Weather Station</h3>
<p>The <a href="http://www.lsiowa.org/residential_beloit.html">Beloit Residential Treatment Center</a> is situated in a neighborhood
area at 1323 Northwestern Avenue in Ames. Children ages 5 to 15 live in
two facilities on campus, including the new Anna J. Hull Treatment
Center. This weather station is used by the students to help their 
gardening activities.</p>

<strong>Current Observation</strong><br />
<table cellpadding="3" cellspacing="0" border="1">
<?php
  foreach ( $vardict as $key => $value ) {
    if ($rs[$key] != "") {
      if ($key == "valid") {
        $t = date("d M Y, g A", strtotime($rs[$key]));
        echo '<tr><td><b>'. $value .'</b></td><td>'. $t .'</td></tr>';
      } else {
        echo '<tr><td><b>'. $value .'</b></td><td>'. $rs[$key] .'</td></tr>';
      } // End if
    } // End if
  }
?>
</table>

<p><strong>Time Series Graph</strong><br />
Select Date after 14 May 2010:
<form method="GET" name="formerr">
<?php echo yearSelect2(2010, $year, "year"); ?>
<?php echo monthSelect($month, "month"); ?>
<?php echo daySelect($day, "day"); ?>
<input type="submit" value="Create Chart">
</form>
<br />


<img src="t_rad.php?year=<?php echo $year; ?>&month=<?php echo $month; ?>&day=<?php echo $day; ?>" />

<p><strong>Daily Totals</strong><br />
<table cellpadding="2" cellspacing="0" border="1">
<tr><th>Day</th><th>High Temperature</th><th>Low Temperature</th><th>Rainfall [inch]</th></tr>
<?php
$rs2 = pg_query($iem->dbconn, "SELECT day, max_tmpf, min_tmpf, pday from summary_2010 WHERE station = 'OT0009' ORDER by day ASC");
for($i=0;$row=@pg_fetch_array($rs2,$i);$i++){
  echo sprintf("<tr><th>%s</th><td>%.1f</td><td>%.1f</td><td>%.2f</td></tr>", 
   $row["day"], $row["max_tmpf"], $row["min_tmpf"], $row["pday"]);
}
?>
</table>

<?php include("$rootpath/include/footer.php"); ?>

{'fraction_non_alphanumeric': 0.23915976103295433, 'fraction_numerical': 0.014453651956060899, 'mean_word_length': 4.550802139037433, 'pattern_counts': {'":': 0, '<': 120, '<?xml version=': 0, '>': 148, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7463429', 'n_tokens_mistral': 1958, 'n_tokens_neox': 1867, 'n_words': 474}