In [1]:
%matplotlib inline

In [2]:
import pandas
pandas.set_option('display.mpl_style', 'default') # Make the graphs a bit prettier
df = pandas.read_csv('pysolar_v_usno.csv', index_col='timestamp')

Azimuth error


In [3]:
print('Mean error: {0} degrees'.format(df.az_error.mean()))
print('Standard deviation: {0} degrees'.format(df.az_error.std()))
print('Minimum error: {0} degrees'.format(df.az_error.min()))
print('Maximum error: {0} degrees'.format(df.az_error.max()))


Mean error: 0.004633386089868058 degrees
Standard deviation: 0.005503656465757925 degrees
Minimum error: 6.10451968441339e-06 degrees
Maximum error: 0.1761643725626243 degrees

Altitude error


In [4]:
print('Mean error: {0} degrees'.format(df.alt_error.mean()))
print('Standard deviation: {0} degrees'.format(df.alt_error.std()))
print('Minimum error: {0} degrees'.format(df.alt_error.min()))
print('Maximum error: {0} degrees'.format(df.alt_error.max()))


Mean error: 0.03793168049884554 degrees
Standard deviation: 0.07946525469183155 degrees
Minimum error: 1.044170204522743e-06 degrees
Maximum error: 0.6037170069907489 degrees

In [5]:
alt_error_plot = df.plot(x='alt1', y='alt_error', marker='.', linestyle='', color='#2980B9', figsize=(15,10))
alt_error_plot.set_xlabel('Altitude [degrees]', fontsize=16)
alt_error_plot.set_ylabel('Error [degrees]', fontsize=16)
alt_error_plot.set_title('Error in altitude between USNO and Pysolar', fontsize=16)


Out[5]:
<matplotlib.text.Text at 0xaf6f06ac>
/usr/lib/python3/dist-packages/matplotlib/font_manager.py:1236: UserWarning: findfont: Font family ['monospace'] not found. Falling back to Bitstream Vera Sans
  (prop.get_family(), self.defaultFamily[fontext]))

In [6]:
az_error_plot = df.plot(x='az1', y='az_error', marker='.', linestyle='', color='#2980B9', figsize=(15,10))
az_error_plot.set_xlabel('Azimuth [degrees]', fontsize=16)
az_error_plot.set_ylabel('Error [degrees]', fontsize=16)
az_error_plot.set_title('Error in azimuth between USNO and Pysolar', fontsize=16)
az_error_plot.set_xlim(0, 360)


Out[6]:
(0, 360)

In [7]:
longitude_error_plot = df.plot('longitude', 'alt_error', 'longitude', 'az_error', marker='.', linestyle='', color='#2980B9', figsize=(15,10))
longitude_error_plot.set_xlabel('Longitude [degrees]', fontsize=16)
longitude_error_plot.set_ylabel('Error [degrees]', fontsize=16)
longitude_error_plot.set_title('Error between USNO and Pysolar as a function of longitude', fontsize=16)
longitude_error_plot.set_xlim(0, 360)


Out[7]:
(0, 360)

In [8]:
latitude_error_plot = df.plot('latitude', 'alt_error', 'latitude', 'az_error', marker='.', linestyle='', color='#2980B9', figsize=(15,10))
latitude_error_plot.set_xlabel('Latitude [degrees]', fontsize=16)
latitude_error_plot.set_ylabel('Error [degrees]', fontsize=16)
latitude_error_plot.set_title('Error between USNO and Pysolar as a function of latitude', fontsize=16)
latitude_error_plot.set_xlim(-90, 90)


Out[8]:
(-90, 90)

It may appear from the graph above that the latitude errors are worse in the northern hemisphere. That's not the case; we've just gathered more data from the northern hemisphere because we didn't know how to retrieve data for the southern hemisphere from the USNO website until late 2013. At some point, we'll rerun the data-gathering script with points evenly distributed in both hemispheres.


In [ ]: