title: Discrepancies in Results from Pysolar
body: <p>I have recently downloaded and installed the PySolar module and would like to use it to calculate sun position (azimuth and altitude). </p>
  
  <p>The problem I am having is that the results calculated do not match the results calculated by the NOAA Solar calculator <a href="http://www.esrl.noaa.gov/gmd/grad/solcalc/azel.html" rel="nofollow">http://www.esrl.noaa.gov/gmd/grad/solcalc/azel.html</a></p>
  
  <p>For example. Using the PySol </p>
  
  <pre><code>&gt;&gt;&gt; import datetime, solar
  &gt;&gt;&gt; d = datetime.datetime(2007,12,21,9,0,0,0)
  &gt;&gt;&gt; lat = 41.5
  &gt;&gt;&gt; long = -111.5
  &gt;&gt;&gt; solar.GetAltitude(lat, long, d)
  -63.0267096801
  &gt;&gt;solar.GetAzimuth(lat, long, d)
  -235.44406245
  </code></pre>
  
  <p>Using the NOAA model The Altitude is calculated at 0.7 and Azimuth is calculated at 237.64. </p>
  
  <p>Therefore there is a discrepancy between the two values. To summarise: </p>
  
  <ul>
  <li>Pysolar is calculating Altitude at -63.03 and NOAA is calculating it at 0.7 </li>
  <li>Pysolar is calculating Azimuth at -235.44 and NOAA is calculating it at 237.64</li>
  </ul>
  
  <p>If you have any suggestions what I am doing wrong or how I can calculate the correct altitude and azimuth for a given location, it would be much appreciated. </p>