In [1]:
%matplotlib inline
In [2]:
import pandas as pd
import matplotlib.pyplot as plt
In [3]:
array_vals = pd.read_csv("data-readonly/transportable_array/data_tohoku_norm_transpose.csv", header=None)
In [4]:
array_vals.dtypes
Out[4]:
In [5]:
v = pd.date_range("2:46PM", "6:46PM", freq="1s")
v -= v[0]
array_vals["time"] = v
array_vals.set_index("time", inplace=True)
In [6]:
array_vals.shape
Out[6]:
In [7]:
date_range = pd.date_range("2:46PM", "6:46PM", freq="1s")
In [8]:
date_range - date_range[0]
Out[8]:
In [9]:
array_vals.loc["03:30:12":"03:45:15"][0]
Out[9]:
In [10]:
array_vals[0]
Out[10]:
In [11]:
plt.plot(array_vals[0])
Out[11]:
In [12]:
locations = pd.read_csv("/srv/nbgrader/data/transportable_array/location.txt",
delimiter="\t", names =["longitude", "latitude", "a", "b"])
del locations["a"], locations["b"]
In [13]:
locations.iloc[0]
Out[13]:
We'll get to proper maps next week.
In [14]:
plt.scatter(locations["longitude"], locations["latitude"])
Out[14]:
In [15]:
import ipywidgets
In [16]:
array_vals.max().max()
Out[16]:
In [17]:
@ipywidgets.interact(station = (0, 437, 1))
def make_plot(station = 0):
plt.subplot(211)
plt.plot(array_vals[station])
plt.xlim(0, 14000)
plt.ylim(-1.0, 1.0)
plt.subplot(212)
plt.scatter(locations.iloc[station]["longitude"], locations.iloc[station]["latitude"])
plt.xlim(-180, 180)
plt.ylim(-90, 90)
In [18]:
from IPython.display import Audio
In [19]:
normed = (array_vals[0] - array_vals[0].min())/(array_vals[0].max() - array_vals[0].min()) * 2 - 1
Audio(normed, rate=44100/8)
Out[19]: