<html>
<head>
<link rel="stylesheet" type="text/css" href="cto4.css" />

<title>Centretown Observatory: Weather: Next Year</title>
<script>
function httpGet(theUrl,xml)
{
var xmlHttp = null;
xmlHttp = new XMLHttpRequest();
xmlHttp.open("POST",theUrl,true);
xmlHttp.send(xml);
return xmlHttp.responseText;
}
function runWithIt(url)
{
var theUrl = url;
var xml="<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\" ?><masterRecalc><location>CTO</location>";
var tml="";
var abort=false;
tml = "";
var sDate;
sDate = new Date(document.getElementById("sDate").value);
if (sDate == "Invalid Date") {
document.getElementById("stub").innerHTML = "Invalid Start Date";
abort = true;
}
if (!abort) {
xml = xml+"<startDate>"+sDate.getFullYear()+"-";
tml = (sDate.getMonth()+1);
if (sDate.getMonth() < 9) {tml = "0"+tml}
xml = xml+tml;
tml = (sDate.getDate()+1);
if (sDate.getDate() < 9) {tml = "0"+tml}
xml = xml+"-"+tml+"</startDate>";
var eDate;
eDate = new Date(document.getElementById("eDate").value);
if (eDate == "Invalid Date") {
document.getElementById("stub").innerHTML = "Invalid End Date";
abort = true;
}
if (!abort) {
xml = xml+"<endDate>"+eDate.getFullYear()+"-";
tml = (eDate.getMonth()+1);
if (eDate.getMonth() < 9) {tml = "0"+tml}
xml = xml+tml;
tml = (eDate.getDate()+1);
if (eDate.getDate() < 9) {tml = "0"+tml}
xml = xml+"-"+tml+"</endDate>";
if (!abort) {
if (document.getElementById("name").value == ""){
document.getElementById("stub").innerHTML = "Name field must be filled";
abort=true;
}
if (!abort) {
xml = xml+"<name>"+document.getElementById("name").value+"</name>";
tml = "";
if (document.cb.calcVals[0].checked) { tml=tml+"<recalcDaily/>" }
if (document.cb.calcVals[1].checked) { tml=tml+"<recalcMonthly/>" }
if (document.cb.calcVals[2].checked) { tml=tml+"<recalcYearly/>" }
if (document.cb.calcVals[3].checked) { tml=tml+"<recalcLimits/>" }
if (document.cb.calcVals[4].checked) { tml=tml+"<recalcExtremes/>" }
if (document.cb.calcVals[5].checked) { tml=tml+"<recalcRecords/>" }
if (document.cb.calcVals[6].checked) { tml=tml+"<recalcNormals/>" }
xml = xml+tml;
tml = "";
if (document.getElementById("tempLowerBound").value != "") {
tml=tml+"<tempLowerBound>"+document.getElementById("tempLowerBound").value*10+"</tempLowerBound>";
}
if (document.getElementById("tempUpperBound").value != "") {
tml=tml+"<tempUpperBound>"+document.getElementById("tempUpperBound").value*10+"</tempUpperBound>";
}
if (document.getElementById("bpLowerBound").value != "") {
tml=tml+"<pressLowerBound>"+document.getElementById("bpLowerBound").value*10+"</pressLowerBound>";
}
if (document.getElementById("bpUpperBound").value != "") {
tml=tml+"<pressUpperBound>"+document.getElementById("bpUpperBound").value*10+"</pressUpperBound>";
}
if (document.getElementById("dpLowerBound").value != "") {
tml=tml+"<dpLowerBound>"+document.getElementById("dpLowerBound").value*10+"</dpLowerBound>";
}
if (document.getElementById("dpUpperBound").value != "") {
tml=tml+"<dpUpperBound>"+document.getElementById("dpUpperBound").value*10+"</dpUpperBound>";
}
if (document.getElementById("rhLowerBound").value != "") {
tml=tml+"<rhLowerBound>"+document.getElementById("rhLowerBound").value+"</rhLowerBound>";
}
if (document.getElementById("rhUpperBound").value != "") {
tml=tml+"<rhUpperBound>"+document.getElementById("rhUpperBound").value+"</rhUpperBound>";
}
if (document.getElementById("visUpperBound").value != "") {
tml=tml+"<visUpperBound>"+document.getElementById("visUpperBound").value*10+"</visUpperBound>";
}
if (document.getElementById("sunshineUpperBound").value != "") {
tml=tml+"<sunshineUpperBound>"+document.getElementById("sunshineUpperBound").value+"</sunshineUpperBound>";
}
if (document.getElementById("wnUpperBound").value != "") {
tml=tml+"<wnUpperBound>"+document.getElementById("wnUpperBound").value+"</wnUpperBound>";
}
if (document.getElementById("rainUpperBound").value != "") {
tml=tml+"<rainUpperBound>"+document.getElementById("rainUpperBound").value*10+"</rainUpperBound>";
}
if (document.getElementById("snowUpperBound").value != "") {
tml=tml+"<snowUpperBound>"+document.getElementById("snowUpperBound").value*10+"</snowUpperBound>";
}
if (document.getElementById("snowQUpperBound").value != "") {
tml=tml+"<snowQUpperBound>"+document.getElementById("snowQUpperBound").value*10+"</snowQUpperBound>";
}
if (document.getElementById("precipUpperBound").value != "") {
tml=tml+"<precipUpperBound>"+document.getElementById("precipUpperBound").value*10+"</precipUpperBound>";
}
if (tml != "") {
tml="<options>"+tml+"</options>";
xml = xml+tml;
}
xml = xml+"</masterRecalc>";
if (!abort) {
var response = httpGet(theUrl,xml);
document.getElementById("stub").innerHTML = response;
// document.getElementById("stub").innerHTML = xml;
}
}
}
}
}
}
</script>
</head>
<body background="Graphics/CTO/clouds.jpg" bgproperties="fixed">
<font face="Arial" color="black">

<table width="1080px" align="center" border="1" frame="border" bordercolor="black" bgcolor="white" cellspacing="0" cellpadding="0">
<tr>
<td valign="TOP">
<table width="100%" rules="none" border="0" bgcolor="white" cellspacing="0" cellpadding="5">
<tr>
<!-- TITLE -->

<td width="50%" bgcolor="white" valign="top">
<table width="100%" bgcolor="white" valign="top">
<tr>
<td width="120px">
<img width="120" height="160" src="Graphics/CTO/cto_logo_120x160.jpg"/>
</td>
<td>
<center>
<h1>Centretown Observatory:</h1>
<h2>Master Recalc</h2>
<b><font color="Teal" size="-1">Times in <@OTZF> (<@OTZS> = GMT<@OTZO>)</b><br><br/>
(To see this page's template code, please <a href="w-masterrecalc-src.html">Click Here</a>.)
</center>
</td>
</tr>
</table>
</td>

<!-- TOP MENU -->
<td width="50%" valign="top" bgcolor="white">
<table border="0" width="100%" align="left" valign="top" bordercolor="cornflowerblue" bgcolor="white" cellspacing="0">
<tr>
<td><table class="mcell"><tr><td><a class="mtxt" href="weather.html"><#Spc2>Current Weather<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="index.html"><#Spc2>CTO Home<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-about.html"><#Spc2>About<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-news.html"><#Spc2>News<#Spc2></a></td></tr></table></td>
</tr>
<tr>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-forecasts.html"><#Spc2>Forecasts<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-warnings.html"><#Spc2>Warnings<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-records.html"><#Spc2>Records<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-normals.html"><#Spc2>Normals<#Spc2></a></td></tr></table></td>
</tr>
<tr>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-temp.html"><#Spc2>Temps<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-press.html"><#Spc2>Baro+RH<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-winds.html"><#Spc2>Winds<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-rain.html"><#Spc2>Precip<#Spc2></a></td></tr></table></td>
</tr>
<tr>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-today.html"><#Spc2>Today<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-yesterday.html"><#Spc2><@YDW:TF><#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-tomorrow.html"><#Spc2><@WDW:TF><#Spc2></a></td></tr></table></td>
<td><table class="ccell"><tr><td><mctxt><b><#Spc2>Query<#Spc2></td></tr></table></td>
</tr>
<tr>
</td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-thismonth.html"><#Spc2>This Month<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-lastmonth.html"><#Spc2><@LDM:TF><#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-nextmonth.html"><#Spc2><@NDM:TF><#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="diags.html"><#Spc2>Diags<#Spc2></a></td></tr></table></td>
</tr>
<tr>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-thisyear.html"><#Spc2>This Year<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-lastyear.html"><#Spc2><@PDY><#Spc2></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-nextyear.html"><#Spc2><@XDY><#Spc2></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-notices.html"><#Spc2><i>NOTICES</i><#Spc2></a></td></tr></table></td>
</tr>
<tr>
<td><table class="mlcell"><tr><td><mltxt><#Spc2>CTO<#Spc2></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="YOW/weather.html"><#Spc2>Airport<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-regional.html"><#Spc2>Regional<#Spc2></a></td></tr></table></td>
<td><table class="mcell"><tr><td><a class="mtxt" href="w-national.html"><#Spc2>National<#Spc2></a></td></tr></table></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>


<!-- ******************************************************************************************************
QUERY BUILDER
****************************************************************************************************** -->

<tr class="groupheading"><td colspan="2"><p class="groupheading"><#Spc3><i>Build your Master Recalc query below, then hit [Submit Inside].</i></td></tr>
<tr bgcolor="#FFEFEF"><td colspan="2">
<table border="0" rules="none" bgcolor="#FFEFEF" bordercolor="#000000" width="100%" cellspacing="0" cellpadding="5">
<tr>
<td>
<font size="+1"><b>Master Recalc Query Builder v1.00</b></font><br/>
<br/>
<i>This query allows you to recalculate everything from source: daily/monthly/yearly 'limits' (highs/lows/averages/totals), extremes, records, normals in one go. Daily limits
are calculated from any live readings present; monthly stats from daily stats; and so on. Essentially, it purges the dataset of bad data (defined by you) and recalculates.
You can optionally limit what's recalculated (and when) by unchecking some of the boxes below. The optional bounds will filter out data that lies outside of the normal operating
range of this station (i.e. bad data acquired before built-in limiting was imposed.)<br/>
<br/>
It is expected that this function will have little effect on a from-scratch implementation of WxPro, as handling of internal data has been improved; the CTO dataset predates
these changes.</i><br/>
<br/>
<b>*Note:</b> Because this will actually change the dataset permanently, and therefore bad settings for filters can cause real loss of data, functionality is limited to within
the CTO building.<br/>
<br/>
<b>Start Date:</b> <input type="date" name="sDate" id="sDate" onClick="">  
<br/>
<b>End Date:</b> <input type="date" name="eDate" id="eDate" onClick="">  
<br/>
<b>Name for records/normals:</b> <input type="text" id="name" onClick="">  
<br/>
<a name="stub2" id="stub2"/>
<br/>
<form name="cb">
<b>Select Recalc Items:</b><br/>
Ordinarily, all checkboxes below should be selected.<br/>
<input type="checkbox" name="calcVals" value="daily" onClick="" CHECKED>Daily  
<input type="checkbox" name="calcVals" value="monthly" onClick="" CHECKED>Monthly  
<input type="checkbox" name="calcVals" value="yearly" onClick="" CHECKED>Yearly  <br/>
<input type="checkbox" name="calcVals" value="limits" onClick="" CHECKED>Limits (high/low/averages)  <br/>
<input type="checkbox" name="calcVals" value="extremes" onClick="" CHECKED>Extremes<br/>
<input type="checkbox" name="calcVals" value="records" onClick="" CHECKED>Records<br/>
<input type="checkbox" name="calcVals" value="normals" onClick="" CHECKED>Normals<br/>
</form>
<br/>
<table>
<tr><td align="right"><b>Optional bounds to filter out bad data:</b></td><td> </td></tr>
<tr><td align="right">Temperature Lower Bound (default -100):  </td><td><input type="text" id="tempLowerBound" value="-50"/> °C</td></tr>
<tr><td align="right">Temperature Upper Bound (default 50):  </td><td><input type="text" id="tempUpperBound" value="50"/> °C</td></tr>
<tr><td align="right">Barometric pressure Lower Bound (default 800):  </td><td><input type="text" id="bpLowerBound" value="850"/> mb</td></tr>
<tr><td align="right">Barometric pressure Upper Bound (default 1200):  </td><td><input type="text" id="bpUpperBound" value="1200"/> mb</td></tr>
<tr><td align="right">Dewpoint Lower Bound (default -150):  </td><td><input type="text" id="dpLowerBound" value="-150"/> °C</td></tr>
<tr><td align="right">Dewpoint Upper Bound (default 100):  </td><td><input type="text" id="dpUpperBound" value="100"/> °C</td></tr>
<tr><td align="right">Relative Humidity Lower Bound (default 0):  </td><td><input type="text" id="rhLowerBound" value="0"/> %</td></tr>
<tr><td align="right">Relative Humidity Upper Bound (default 100):  </td><td><input type="text" id="rhUpperBound" value="100"/> %</td></tr>
<tr><td align="right">Visibility Upper Bound (default 50):  </td><td><input type="text" id="visUpperBound" value="50"/> km</td></tr>
<tr><td align="right">Sunshine Upper Bound (default 16:00):  </td><td><input type="text" id="sunshineUpperBound" value="16:00"/> hh:mm</td></tr>
<tr><td align="right">Wind Upper Bound (default 150):  </td><td><input type="text" id="wnUpperBound" value="150"/> km/h</td></tr>
<tr><td align="right">Rain Upper Bound (default 200):  </td><td><input type="text" id="rainUpperBound" value="200"/> mm</td></tr>
<tr><td align="right">Snow Upper Bound (default 200):  </td><td><input type="text" id="snowUpperBound" value="200"/> cm</td></tr>
<tr><td align="right">SnowQ Upper Bound (default 200):  </td><td><input type="text" id="snowQUpperBound" value="200"/> mm</td></tr>
<tr><td align="right">Precip Upper Bound (default 200):  </td><td><input type="text" id="precipUpperBound" value="200"/> mm</td></tr>
</table>
<br/>
<input type="button" value="Submit Inside" onClick="runWithIt('http://gypsy/cgi-bin/wxqueries')"/>     <br/>
<!-- <input type="button" value="Submit Outside" onClick="runWithIt('http://mizar64.dyndns-home.com:64180/cgi-bin/wxqueries')"><br/> -->
<a name="stub" id="stub"/>
</td>
</tr>
</table>
</td>
</tr>


</table>
<br>
<br>


</font>
</body>
</html>