<?php
  error_reporting(E_ALL);
  require_once('/data/www/mmab/setup.php');
  // page title
  $smarty->assign("title","WAVEWATCH III&reg; Production Validation Archive");
  // xssi section
      
  // start of content section  
  $core_content = <<< END_OF_CONTENT

  <link href="/waves/validation/prod/css/hindcast.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="/waves/validation/prod/js/inventory.js"></script>
  <script type="text/javascript" src="/waves/validation/prod/js/all_buoys.js"></script>
  <script type="text/javascript" src="/waves/validation/prod/js/all_buoy_info.js"></script>
  <script type="text/javascript" src="/waves/validation/prod/js/hindcast.js"></script>

  <br>
  <h1 align="center">WAVEWATCH III<span style="font-size: smaller; vertical-align: super">&reg;</span> Production Validation Archive</h1>
  <div class="full-width-border"></div>           

  <div class="one-sixth-first">
  <form>
  <fieldset>
    <label for="year">Year</label><br>
    <select name="year" id="year" style="font-size: x-small;">
      <option disabled="true" selected="selected">Select</option>
      <option id="y2013">2013</option>
      <option id="y2014">2014</option>
      <option id="y2015">2015</option>
      <option id="y2016">2016</option>
      <option id="y2017">2017</option>
      <option id="y2018">2018</option>
      <option id="y2019">2019</option>
      <option id="y2019">2020</option>
    </select>
    <br><br>

  <label for="buoy">Buoy</label><br>
    <select name="buoy" id="buoy" style="font-size: x-small;">
    <option disabled="true" selected="selected">Select</option>
    <!--
    <optgroup label="South America">
      <option id="b31201">31201</option>
      <option id="b32012">32012</option>
      <option id="b32487">32487</option>
      <option id="b32488">32488</option>
    </optgroup>
    -->
    <optgroup label="Southeast US / Caribbean">
      <option id="b41001">41001</option>
      <option id="b41002">41002</option>
      <option id="b41004">41004</option>
      <option id="b41008">41008</option>
      <option id="b41009">41009</option>
      <option id="b41010">41010</option>
      <option id="b41012">41012</option>
      <option id="b41013">41013</option>
      <option id="b41025">41025</option>
      <!--
      <option id="b41035">41035</option>
      <option id="b41036">41036</option>
      <option id="b41037">41037</option>
      <option id="b41038">41038</option>
      -->
      <option id="b41040">41040</option>
      <option id="b41041">41041</option>
      <option id="b41043">41043</option>
      <option id="b41044">41044</option>
      <option id="b41046">41046</option>
      <option id="b41047">41047</option>
      <option id="b41048">41048</option>
      <option id="b41049">41049</option>
      <!--
      <option id="b41110">41110</option>
      <option id="b41112">41112</option>
      <option id="b41113">41113</option>
      <option id="b41114">41114</option>
      <option id="b41193">41193</option>
      -->
    </optgroup>
    <optgroup label="Gulf of America">
      <option id="b42001">42001</option>
      <option id="b42002">42002</option>
      <option id="b42003">42003</option>
      <!--
      <option id="b42007">42007</option>
      -->
      <option id="b42012">42012</option>
      <option id="b42019">42019</option>
      <option id="b42020">42020</option>
      <option id="b42035">42035</option>
      <option id="b42036">42036</option>
      <!--
      <option id="b42038">42038</option>
      -->
      <option id="b42039">42039</option>
      <option id="b42040">42040</option>
      <!--
      <option id="b42041">42041</option>
      -->
      <option id="b42055">42055</option>
      <option id="b42056">42056</option>
      <option id="b42057">42057</option>
      <option id="b42058">42058</option>
      <option id="b42059">42059</option>
      <option id="b42060">42060</option>
      <!--
      <option id="b42080">42080</option>
      <option id="b42099">42099</option>
      -->
      <option id="b42887">42887</option>
    </optgroup>
    <optgroup label="Northeast US / Canada">
      <!--
      <option id="b44004">44004</option>
      -->
      <option id="b44005">44005</option>
      <option id="b44008">44008</option>
      <option id="b44009">44009</option>
      <option id="b44011">44011</option>
      <option id="b44014">44014</option>
      <option id="b44017">44017</option>
      <option id="b44018">44018</option>
      <option id="b44024">44024</option>
      <option id="b44025">44025</option>
      <option id="b44027">44027</option>
      <option id="b44037">44037</option>
      <!--
      <option id="b44038">44038</option>
      -->
      <option id="b44066">44066</option>
      <!--
      <option id="b44070">44070</option>
      <option id="b44098">44098</option>
      <option id="b44099">44099</option>
      <option id="b44100">44100</option>
      -->
    </optgroup>
    <optgroup label="West Coast US / Alaska">
      <option id="b46001">46001</option>
      <option id="b46002">46002</option>
      <option id="b46005">46005</option>
      <!--
      <option id="b46006">46006</option>
      -->
      <option id="b46011">46011</option>
      <option id="b46012">46012</option>
      <option id="b46013">46013</option>
      <option id="b46014">46014</option>
      <option id="b46015">46015</option>
      <option id="b46022">46022</option>
      <!--
      <option id="b46023">46023</option>
      -->
      <option id="b46025">46025</option>
      <option id="b46026">46026</option>
      <option id="b46027">46027</option>
      <option id="b46028">46028</option>
      <option id="b46029">46029</option>
      <!--
      <option id="b46030">46030</option>
      -->
      <option id="b46035">46035</option>
      <option id="b46041">46041</option>
      <option id="b46042">46042</option>
      <option id="b46047">46047</option>
      <option id="b46050">46050</option>
      <option id="b46053">46053</option>
      <option id="b46054">46054</option>
      <option id="b46059">46059</option>
      <option id="b46061">46061</option>
      <option id="b46066">46066</option>
      <option id="b46069">46069</option>
      <option id="b46070">46070</option>
      <option id="b46071">46071</option>
      <option id="b46072">46072</option>
      <option id="b46073">46073</option>
      <option id="b46075">46075</option>
      <option id="b46076">46076</option>
      <option id="b46078">46078</option>
      <option id="b46080">46080</option>
      <option id="b46082">46082</option>
      <option id="b46084">46084</option>
      <option id="b46085">46085</option>
      <option id="b46086">46086</option>
      <option id="b46087">46087</option>
      <option id="b46089">46089</option>
      <!--
      <option id="b46106">46106</option>
      <option id="b46211">46211</option>
      <option id="b46213">46213</option>
      <option id="b46214">46214</option>
      <option id="b46215">46215</option>
      <option id="b46216">46216</option>
      <option id="b46217">46217</option>
      <option id="b46219">46219</option>
      <option id="b46221">46221</option>
      <option id="b46222">46222</option>
      <option id="b46223">46223</option>
      <option id="b46224">46224</option>
      <option id="b46225">46225</option>
      <option id="b46227">46227</option>
      <option id="b46229">46229</option>
      <option id="b46231">46231</option>
      <option id="b46232">46232</option>
      <option id="b46238">46238</option>
      -->
    </optgroup>
    <optgroup label="Hawaii">
      <option id="b51000">51000</option>
      <option id="b51001">51001</option>
      <option id="b51002">51002</option>
      <option id="b51003">51003</option>
      <option id="b51004">51004</option>
      <!--
      <option id="b51028">51028</option>
      -->
      <option id="b51100">51100</option>
      <option id="b51101">51101</option>
      <!--
      <option id="b51201">51201</option>
      <option id="b51202">51202</option>
      -->
    </optgroup>
    <!--
    <optgroup label="Guam">
      <option id="b52200">52200</option>
    </optgroup>
    <optgroup label="Eastern Atlantic">
      <option id="b62090">62090</option>
      <option id="b62091">62091</option>
      <option id="b62092">62092</option>
      <option id="b62093">62093</option>
      <option id="b62094">62094</option>
      <option id="b62095">62095</option>
      <option id="b62142">62142</option>
      <option id="b62144">62144</option>
      <option id="b62145">62145</option>
      <option id="b62146">62146</option>
      <option id="b62164">62164</option>
    </optgroup>
    <optgroup label="North Sea Oil Platforms">
      <option id="b63110">63110</option>
      <option id="b63112">63112</option>
      <option id="b63113">63113</option>
      <option id="b63115">63115</option>
    </optgroup>
    -->
    </select>        
    
   </fieldset>    
   </form>
   
   <br><br>
   <form>
     <fieldset>
       <legend>Month</legend>
       <div id="month" style="font-size: x-small">
         <input type="radio" id="m01" value="01" name="month"><label for="m01">Jan</label>
         <input type="radio" id="m02" value="02" name="month"><label for="m02">Feb</label>
         <input type="radio" id="m03" value="03" name="month"><label for="m03">Mar</label>
         <input type="radio" id="m04" value="04" name="month"><label for="m04">Apr</label>
         <input type="radio" id="m05" value="05" name="month"><label for="m05">May</label>
         <input type="radio" id="m06" value="06" name="month"><label for="m06">Jun</label>
         <input type="radio" id="m07" value="07" name="month"><label for="m07">Jul</label>
         <input type="radio" id="m08" value="08" name="month"><label for="m08">Aug</label>
         <input type="radio" id="m09" value="09" name="month"><label for="m09">Sep</label>
         <input type="radio" id="m10" value="10" name="month"><label for="m10">Oct</label>
         <input type="radio" id="m11" value="11" name="month"><label for="m11">Nov</label>
         <input type="radio" id="m12" value="12" name="month"><label for="m12">Dec</label>
       </div>
     </fieldset>
   </form>
   
   <br><br>
   <form>
     <fieldset>
       <legend>Forecast Hour</legend>
       <div id="fcst" style="font-size: x-small">
         <input type="radio" id="f000" value="000" name="fcst" checked="checked"><label for="f000">&nbsp;&nbsp;0</label>
         <input type="radio" id="f024" value="024" name="fcst"><label for="f024">&nbsp;24</label>   
         <input type="radio" id="f048" value="048" name="fcst"><label for="f048">&nbsp;48</label>
         <input type="radio" id="f072" value="072" name="fcst"><label for="f072">&nbsp;72</label>
         <input type="radio" id="f096" value="096" name="fcst"><label for="f096">&nbsp;96</label>
         <input type="radio" id="f120" value="120" name="fcst"><label for="f120">120</label>
         <input type="radio" id="f144" value="144" name="fcst"><label for="f144">144</label>
         <input type="radio" id="f168" value="168" name="fcst"><label for="f168">168</label>
       </div>
     </fieldset>
   </form>
   
   <br><br>
   <h2>Buoy Locations</h2>
   <a style="text-decoration: none;" href="javascript:load_img('/waves/hindcasts/images/buoys/buoy_map_41.png',800,600)">SE US / Caribbean</a><br>
   <a style="text-decoration: none;" href="javascript:load_img('/waves/hindcasts/images/buoys/buoy_map.png',800,600)">Gulf of America</a><br>
   <a style="text-decoration: none;" href="javascript:load_img('/waves/hindcasts/images/buoys/buoy_map_44.png',800,600)">NE US/Canada</a><br>
   <a style="text-decoration: none;" href="javascript:load_img('/waves/hindcasts/images/buoys/buoy_map_46.png',800,600)">West Coast US / AK</a><br>
   <a style="text-decoration: none;" href="javascript:load_img('/waves/hindcasts/images/buoys/buoy_map_51.png',800,600)">Hawaii</a><br>
  </div>    
  
  <div class="five-sixth-last">
    <div id="buoy_loc">
    	<br><br><br><br>
    </div>
    <div id="tabs">
      <ul>
        <li><a href="#windwavetab">Wind-Wave</a></li>
        <li><a href="#hwptab">Height-Wind-Period</a></li>
        <li><a href="#scattertab">Scatter</a></li>
        <li><a href="#qqtab">Q-Q</a></li>
        <li><a href="#taylortab">Taylor</a></li>
        <li><a href="#aggtab">Aggregated</a></li>
        <li><a href="#helptab">Info</a></li>
      </ul>  
      
      <div id="windwavetab">
        <img src="/waves/validation/prod/world_buoy_map_new.png" width="800" height="600" border="0">
      </div>      
      <div id="hwptab"></div>
      <div id="scattertab"></div>
      <div id="qqtab"></div>
      <div id="taylortab">
        <h4 align='center'>Click on a Taylor Diagram to zoom</h4><br>
        <table width="780" cellspacing="0" cellpadding="0" border="0">
          <tr><td id="taylor_u10"></td><td id="taylor_udir"></td></tr>
          <tr><td id="taylor_Hs"></td><td id="taylor_Tp"></td></tr>
        </table>
      </div>
      <div id="aggtab">
        <div id="subtabs">
          <ul>
            <li><a href="#agg_Hs">Hs</a></li>
            <li><a href="#agg_u10">u10</a></li>
            <li><a href="#agg_Tp">Tp</a></li>
          </ul>
          <div id="agg_Hs"></div>
          <div id="agg_u10"></div>
          <div id="agg_Tp"></div>
        </div>
      </div>        
      <div id="helptab">
      <!-- you want help? -->
<h2>Using the Validation Archive</h2>
<p>In order to browse the archive, follow these steps in order:</p>
<ol>
<li>Select a Year</li>
<li>Select a Buoy</li>
<li>Select a Month</li>
<li>Select a Forecast</li>
</ol>
<p>Once a year has been selected, the list of buoys will be updated to 
only allow selection of the buoys for which data was available from
NDBC.
</p> 
<p>
The initial (default) Wind-Wave image is a map of all of the buoy
locations in the Archive.  The same map can be viewed by clicking on
the Buoy Locations link below the Months selector.
</p>
<p>
Note that until you select a Year, Buoy, and Month, the Archive will not
display an image.  This will be replaced by the correct image
once all three items are selected and NDBC data is available.</p>
<p>Once all three are selected, you can continue changing any of the
three selections as you like.  The Archive will update the images as
you proceed.  Note that if you change buoy after the year and month
have been selected, you can find your year and month selections are
for missing data.  Just re-select the year from the list of available
years.  
</p>
<p>All of the selections are "sticky" in that they don't reset as you
change your selections.  This was incorporated to facilitate
comparisons across the different selections without having to start
from the beginning.</p>

<p>Unfortunately, This can result in an instance for a buoy in
a year where there is only one month and the month button doesn't seem
to work.  Try changing years, pick another month, then shift back to
the year where you started.  If all else fails, you can always click
on the Home button at the top of the page to reset everything back to
where you started.</p>

<h2>Technical Definitions</h2>
<br>

<h3>Wind Speed (u10) and Direction (udir)</h3>
<p>
The model is driven by hourly 1/2 degree CFSR Reanalysis wind fields
that have been corrected to remove bias in the 99th percentile wind
speeds. Wind speeds are given in meters/second (m/s) and direction in
degrees.  
</p>

<h3>Power law estimation for NDBC buoy winds</h3>
<p>
NDBC buoy wind speeds are recorded at the buoy anemometer height and
are not height adjusted by NDBC in the archive.  We estimate the winds
at 10 meters by using as method described by S. A. Hsu et al. (1994).</p>
<p>
Although never used operationally by NDBC, the method was tested and
found to compare favorably with the more elaborate method under
near-neutral stability. This is the condition most frequently
encountered at sea and occurs when air and water temperatures are not
too far apart. The method, referred to as the Power Law Method, is
offered here for those who may want to explore the nature of the
marine wind speed profile without having to deal with the complexity
of the above method. The relationship is:
<pre>
u2 = u1 (z2/z1)^P
</pre>                        
where u2 is the wind speed at the desired reference height, z2, and u1
is the wind speed measured at height z1. A value for the exponent, P,
equal to 0.11 was empirically determined to be applicable most of the
time over the ocean.
</p>
<p><span style="font-weight: bold">Reference</span><br>
Hsu, S. A., Eric A. Meindl, and David B. Gilhousen, 1994:
Determining the Power-Law Wind-Profile Exponent under Near-Neutral
Stability Conditions at Sea, 
<span style="font-style: italic">Applied Meteorology</span>, Vol. 33, No. 6,
June 1994.
</p>

<h3>Significant Wave Height (Hs)</h3>
<p>
The significant wave height is defined as the mean wave height (trough
to crest) of the highest third of the waves.  Note that the highest
wave height of an individual wave will be significantly larger.
Significant wave height values are in meters (m).
</p>

<h3>Peak Wave Period (Tp)</h3>
<p>
The peak wave period is estimated as the period corresponding to the
highest peak in the one dimensional frequency spectrum of the wave
field.  The wave field generally consists of a set of individual wave
fields. The peak period identifies either the locally generated "wind
sea" (in cases with strong local winds) or the dominant wave system
("swell") that is generated elsewhere. Peak wave period values are in
seconds (s).
</p>

<h3>Bias</h3>
<p>
The mean difference between the model and observations, measures the
tendency of the model process to over- or under-estimate the value of
a parameter. Smaller absolute bias values indicate better agreement
between measured and calculated values.  Positive bias means
overprediction, negative means underprediction.
<pre>
diff = model_data - buoy_data
bias = diff.mean()       
</pre>
</p>

<h3>Root-Mean-Square Error (RMS Error)</h3>
<p>
Also called the root-mean-squared deviation, it's a measure of the
differences between the observed and predicted values.  Smaller RMSE
values indicate better agreement between measured and calculated
values.
<pre>
rmse=(diff**2).mean()**0.5
</pre>
</p>

<h3>Scatter Index (SI)</h3>
<p>
Defined as the standard deviation of the difference between model and
observations, normalised by the mean of the observations. Smaller
values of SI indicate better agreement between the model and
observations. Note that low wave heights or areas where wind seas
dominate can result in high SI values.
<pre>
scatter_index=100.0*(((diff**2).mean())**0.5 - bias**2)/buoy_data.mean()
</pre>
</p>

<h3>Scatter Plot</h3>
<p>
Shows the relationship of a specific parameter (u10, udir, Hs, Tp) by
plotting the buoy value on the x-axis and the model value on the
y-axis. The ideal agreement would line up all the points along the 45
degree dashed line. The solid blue line represents the Ordinary Least
Squares (OLS) fit to the data.  Additionally, the Adjusted R-Squared
value is given: this is a statistical measure of how well the
regression line approximates the real data points, adjusted based on
the number of observations and the degrees-of-freedom of the
residuals.
</p>

<h3>Quantile-Quantile (Q-Q) Plot</h3>
<p>
A Q-Q plot is a plot of the quantiles of the first data set against
the quantiles of the second data set. This is a graphical technique
for comparing two probability distributions - if the two distributions
agree, then the Q-Q plot follows some line.  Perfect agreement would
yield the y=x line.  If the general trend of th Q-Q plot is flatter
than the line y=x, the distribution plotted on the x-axis is more
dispersed than the distribution plotted on the y-axis, and vice versa.
</p>

<h3>Taylor Diagram</h3>
<p>
Taylor diagrams are usually used to show how a variety of different
models do compared to the same data source.  However, we want to show
how one model​ ​ does at a variety of data sources (different buoys). In
order to put the data from many different buoys on the same Taylor
diagram, first you have to​ ​ normalize the model and observation values
by the standard deviation of the​ ​ observation. In this case the model
buoys standard deviation is divided by​ ​ the observed buoys standard
deviation.  But you must also normalize the observed values standard
deviation: this means that the observations standard deviation will be
set to 1, cross-correlation is 1, and the RMS is 0.  So you've
basically replaced all the observed points by the star at 1 along the
x-axis of the Taylor diagram, and you just plot all of the model buoys
statistics.
</p>

<h3>Aggregated Statistics</h3>
<p>The Aggregated tab contains time series for Significant Height (Hs)
and Wind Speed (u10) gathered across all reporting buoys and analyzed 
per-day for the full month.
</p>  
      </div>
    </div> 
  </div>
    
END_OF_CONTENT;
  // end of content section
  $smarty->assign("core_content",$core_content);
  $smarty->display("emc.tpl");
?>
