In [1]:
%pylab inline

Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.kernel.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.

In [4]:
import pandas as pd
import os
from datetime import datetime
matplotlib.rcParams['savefig.dpi']=144
figsize(20,10)
os.chdir('D:\\datawell-raw-files-to-pandas-dataframe\\February')
raw_disp_df = pd.load('raw_plus_std')
In [6]:
figsize(20,10)
raw_disp_df[['heave','north','west']].plot(title="Displacement")
ylabel("centimetres")
xlabel("Date")
raw_disp_df[['sig_qual','>4*std','signal_error']].plot(title="Quality Check")
Index([sig_qual, heave, north, west, file_name, extrema, signal_error, heave_file_std, north_file_std, west_file_std, >4*std, max_std_factor], dtype=object)

Out[6]:
<matplotlib.axes.AxesSubplot at 0x2f3accf8>
<matplotlib.figure.Figure at 0x8e39da0>
In [23]:
raw_displacements_df = pd.load('raw_plus_std'); 
wave_height_df = pd.load('wave_height_dataframe') # Load the DataFrames prepared by hebtools from disk into memory
start_datetime, end_datetime = (datetime(2013,2,4,13,25), datetime(2013,2,4,13,30));  # Use datetime to get a subset of DataFrame 
wave_height_subset = wave_height_df.ix[start_datetime:end_datetime]; plot = wave_height_subset.wave_height_cm.plot(title="Wave Height vs Sigma", label="Wave height in centimetres")
legend(); ax = raw_displacements_df.ix[start_datetime:end_datetime].max_std_factor.plot(secondary_y=True, style='r', label='Displacement / standard deviation')
ax.right_ax.set_ylabel('Multiple of standard deviation'); ax.set_xlabel("Time (hours:minutes:seconds)"); ax.set_ylabel("Wave Height (centimetres)")
print wave_height_subset.ix[wave_height_df.max_std_factor<4].max() # Use numpy style syntax to extract statistics like maximum peak with a maximum limit std factor 
wave_height_cm                                       2205
file_name         Bragar_HebMarine2}2013-02-04T13h00Z.raw
max_std_factor                                    3.71801
heave_file_std                                   351.5322

In [14]:
max_std_subset = raw_disp_df[['max_std_factor']].ix[start_datetime:end_datetime]
max_std_subset.plot()
Out[14]:
<matplotlib.axes.AxesSubplot at 0x19c3e6d8>
In [5]:
zero_cross = pd.load('zero_crossing_dataframe')
print zero_cross[0][zero_cross[0]>20]
zero_cross.plot()
2013-02-04 07:23:48    22
2013-02-04 07:33:09    22
2013-02-04 07:49:09    22
2013-02-04 07:53:43    24
2013-02-04 07:59:42    21
2013-02-04 08:06:32    22
2013-02-04 08:13:05    22
2013-02-04 08:16:09    22
2013-02-04 08:31:29    21
2013-02-04 08:35:04    21
2013-02-04 08:39:42    21
2013-02-04 08:49:31    21
2013-02-04 08:50:10    25
2013-02-04 09:05:07    21
2013-02-04 09:09:43    23
2013-02-04 09:28:04    23
2013-02-04 09:32:08    22
2013-02-04 09:32:49    21
Name: 0

Out[5]:
<matplotlib.axes.AxesSubplot at 0xc62ef28>
In [8]:
wave_height_df = pd.load('wave_height_dataframe')
print wave_height_df.describe()
wave_height_df.ix[datetime(2013,2,4,8,12):datetime(2013,2,4,8,14)].plot()
       wave_height_cm
count    25997.000000
mean       228.823364
std        149.398374
min          1.000000
25%        131.000000
50%        203.000000
75%        284.000000
max       1325.000000

Out[8]:
<matplotlib.axes.AxesSubplot at 0x1137cc18>
In [6]:
 
Back to top