I missed understood what you were saying. Your a genius. I removed the Zip and pow. The Norm YTD and MNT Precips came back.
Thank you!
Just a quick FYI - The values VWS has labeled as "Normal YTD Precip." & "Normal MTD Precip." are actually the current measured YTD & MTD values at your chosen METAR.
Many remove this from the VWS template or rename it. In my case, I'm using the correct Normal YTD & MTD numbers available from National Climatic Data Center (I placed the values in a PHP array).
http://www.ncdc.noaa.gov/
For those of us who are PHP challenged, do you care to share your code?
No problem!
In the
head body (you will need to adjust the GMT offset, in the third line, to match your time zone).
This creates the array, reads the value for the correct day and then sets the result to a fixed decimal place (e.g. "2.3" would show as "2.30").
During leap years "ARRAY_MTD.php" will need to be changed to "ARRAY_MTD_Leap.php", and "ARRAY_YTD.php" changed to "ARRAY_YTD_Leap.php"
<?php include("ARRAY_MTD.php"); // create array
include("ARRAY_YTD.php");
$time = new DateTime( NULL, new DateTimeZone('Etc/GMT+5' )); // set day of the year step 1
$dayOfYear = $time->format('z'); // set day of the year step 2
$var_mtd = $MTD[$dayOfYear]; // read array
$var_ytd = $YTD[$dayOfYear];
$normal_mtd = sprintf("%01.2f", $var_mtd); // set fixed decimal place
$normal_ytd = sprintf("%01.2f", $var_ytd);
?>
In the
body (these will insert the numbers):
<?php print $normal_mtd; ?>
<?php print $normal_ytd; ?>
The
arrays are located in the same directory as your index.php (two versions of each array, one for normal years, one for leap years).
The names of these files would be "ARRAY_MTD.php", "ARRAY_MTD_Leap.php", "ARRAY_YTD.php", and "ARRAY_YTD_Leap.php"
Sample "ARRAY_MTD.php" (Normal Month To Date Precipitation):
(creating the arrays was the tedious part
)
<?php
$MTD=array(0.11,0.22,0.33,0.44,0.55,0.65,0.76,0.86,0.96,1.06,1.17,1.28,1.38,1.48,1.58,1.69,1.79,1.9,1.98,2.05,2.11,2.18,2.24,2.31,2.38,2.45,2.52,2.59,2.66,2.73,2.8,0.09,0.19,0.28,0.37,0.47,0.57,0.67,0.77,0.88,0.98,1.08,1.19,1.29,1.37,1.46,1.54,1.63,1.72,1.81,1.9,1.99,2.08,2.16,2.25,2.33,2.41,2.5,2.6,0.08,0.16,0.23,0.33,0.43,0.54,0.64,0.75,0.85,0.95,1.05,1.16,1.28,1.4,1.54,1.67,1.8,1.93,2.06,2.19,2.32,2.45,2.58,2.72,2.86,3,3.14,3.28,3.42,3.56,3.71,0.14,0.27,0.38,0.49,0.61,0.73,0.86,1,1.13,1.26,1.39,1.51,1.63,1.75,1.87,2,2.13,2.26,2.4,2.53,2.67,2.81,2.96,3.12,3.27,3.43,3.59,3.75,3.91,4.07,0.17,0.34,0.52,0.7,0.89,1.07,1.25,1.42,1.59,1.76,1.93,2.1,2.28,2.45,2.62,2.79,2.95,3.12,3.28,3.44,3.6,3.77,3.93,4.1,4.26,4.42,4.57,4.72,4.87,5.02,5.17,0.17,0.34,0.49,0.65,0.8,0.95,1.11,1.26,1.41,1.55,1.69,1.82,1.97,2.12,2.26,2.4,2.55,2.69,2.82,2.96,3.09,3.21,3.35,3.49,3.63,3.78,3.93,4.07,4.2,4.33,0.1,0.22,0.35,0.49,0.63,0.76,0.9,1.06,1.21,1.36,1.51,1.66,1.8,1.94,2.09,2.23,2.38,2.52,2.66,2.79,2.93,3.06,3.19,3.32,3.44,3.55,3.66,3.78,3.89,4,4.11,0.1,0.21,0.31,0.43,0.54,0.64,0.74,0.85,0.95,1.06,1.16,1.26,1.35,1.44,1.54,1.64,1.75,1.87,1.99,2.11,2.23,2.35,2.46,2.58,2.71,2.82,2.94,3.06,3.18,3.29,3.4,0.1,0.18,0.27,0.35,0.43,0.52,0.61,0.71,0.81,0.9,1,1.11,1.24,1.35,1.46,1.56,1.65,1.74,1.83,1.92,2.02,2.11,2.2,2.29,2.39,2.48,2.58,2.68,2.78,2.89,0.09,0.19,0.28,0.38,0.47,0.57,0.67,0.76,0.87,0.98,1.1,1.19,1.3,1.4,1.5,1.61,1.71,1.82,1.92,2.03,2.13,2.24,2.34,2.44,2.54,2.64,2.74,2.84,2.94,3.03,3.12,0.13,0.25,0.36,0.48,0.6,0.72,0.83,0.92,1,1.08,1.17,1.27,1.37,1.48,1.59,1.71,1.83,1.95,2.07,2.18,2.3,2.42,2.54,2.66,2.78,2.9,3.03,3.15,3.28,3.41,0.1,0.21,0.33,0.44,0.56,0.67,0.79,0.9,1.02,1.12,1.22,1.32,1.4,1.49,1.57,1.65,1.74,1.83,1.92,2.01,2.13,2.26,2.38,2.51,2.63,2.75,2.86,2.97,3.08,3.2,3.3);
?>
I'm currently using this method to display:
[Normals for my location - KHAO, Butler County Regional Airport]
Normal Month To Date Precipitation
Normal Year To Date Precipitation
Normal High Temperature (VWS displays the value for Cincinnati, but I wanted the value for the airport 3 miles away).
Normal Low Temperature (VWS displays the value for Cincinnati, but I wanted the value for the airport 3 miles away).
[Records for Cincinnati]
http://www.erh.noaa.gov/iln/cvgrec.htmRecord Warmest High
Record Coldest High
Record Warmest Low
Record Coldest Low
Record Daily Precipitation
Record Daily Snowfall