In [13]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [27]:
import pandas
import numpy

In [3]:
file = '/Users/schriste/Desktop/bamsringsdata.csv'

In [6]:
data = pandas.read_csv(file, index_col=2, parse_dates=True)

In [7]:
data


Out[7]:
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 2345 entries, 2013-09-21 12:44:27 to 2013-09-22 14:26:57
Data columns (total 12 columns):
Unnamed: 0                      2345  non-null values
time                            2345  non-null values
aft x movement arcmin           389  non-null values
aft y movement arcmin           389  non-null values
fwd ring 2 x movement arcmin    528  non-null values
fwd ring 2 y movement arcmin    528  non-null values
fwd ring 3 x movement arcmin    604  non-null values
fwd ring 3 y movement arcmin    604  non-null values
fwd ring 7 x movement arcmin    317  non-null values
fwd ring 7 y movement arcmin    317  non-null values
fwd ring F x movement arcmin    507  non-null values
fwd ring F y movement arcmin    507  non-null values
dtypes: float64(10), object(2)

In [8]:
data.describe()


Out[8]:
aft x movement arcmin aft y movement arcmin fwd ring 2 x movement arcmin fwd ring 2 y movement arcmin fwd ring 3 x movement arcmin fwd ring 3 y movement arcmin fwd ring 7 x movement arcmin fwd ring 7 y movement arcmin fwd ring F x movement arcmin fwd ring F y movement arcmin
count 389.000000 389.000000 528.000000 528.000000 604.000000 604.000000 317.000000 317.000000 507.000000 507.000000
mean -0.067532 0.771003 -0.202121 -0.982083 -0.077235 -0.825960 -0.030379 -0.965868 -0.133018 -1.039704
std 0.772922 1.170815 0.152193 0.559925 0.198987 0.577304 0.176882 0.575705 0.210340 0.519244
min -2.720000 -0.370000 -0.530000 -2.670000 -0.480000 -2.660000 -0.570000 -2.800000 -0.590000 -2.570000
25% -0.460000 0.100000 -0.310000 -1.320000 -0.240000 -1.002500 -0.150000 -1.140000 -0.310000 -1.245000
50% -0.110000 0.420000 -0.220000 -0.880000 -0.120000 -0.720000 -0.080000 -0.830000 -0.140000 -0.980000
75% 0.190000 0.770000 -0.060000 -0.710000 0.110000 -0.580000 0.140000 -0.680000 0.040000 -0.720000
max 2.180000 4.410000 0.080000 0.150000 0.300000 0.130000 0.270000 0.050000 0.240000 0.090000

In [28]:
ndata = data.resample('600s', how=np.mean)

In [29]:
ndata


Out[29]:
<class 'pandas.core.frame.DataFrame'>
DatetimeIndex: 155 entries, 2013-09-21 12:40:00 to 2013-09-22 14:20:00
Freq: 600S
Data columns (total 10 columns):
aft x movement arcmin           155  non-null values
aft y movement arcmin           155  non-null values
fwd ring 2 x movement arcmin    155  non-null values
fwd ring 2 y movement arcmin    155  non-null values
fwd ring 3 x movement arcmin    155  non-null values
fwd ring 3 y movement arcmin    155  non-null values
fwd ring 7 x movement arcmin    155  non-null values
fwd ring 7 y movement arcmin    155  non-null values
fwd ring F x movement arcmin    155  non-null values
fwd ring F y movement arcmin    155  non-null values
dtypes: float64(10)

In [41]:
ndata['fwd ring F y movement arcmin'].plot()
ndata['aft y movement arcmin'].plot()


Out[41]:
<matplotlib.axes.AxesSubplot at 0x10a8bb410>

In [43]:
ndata['fwd ring F x movement arcmin'].plot()
ndata['aft x movement arcmin'].plot()


Out[43]:
<matplotlib.axes.AxesSubplot at 0x10ae5aad0>

In [44]:
ydiff = ndata['fwd ring F y movement arcmin']+ndata['aft y movement arcmin']

In [45]:
xdiff = ndata['fwd ring F x movement arcmin']+ndata['aft x movement arcmin']

In [46]:
ydiff.plot()


Out[46]:
<matplotlib.axes.AxesSubplot at 0x10ae76250>

In [47]:
xdiff.plot()


Out[47]:
<matplotlib.axes.AxesSubplot at 0x10aecd1d0>

In [35]:
import Pysolar
sunel = [Pysolar.GetAltitude(34.4731, -104.2422, t) for t in ndata['aft x movement arcmin'].index]

In [37]:
sunel = pandas.Series(sunel, index=ndata['aft x movement arcmin'].index)

In [40]:
ax = sunel.plot()
ax.set_ylabel('Sun Elevation [degrees]')


Out[40]:
<matplotlib.text.Text at 0x10a0ac690>

In [ ]: