In [24]:
% matplotlib notebook

In [28]:
import pandas as pd
import matplotlib.pyplot as plt
from ipywidgets import interact_manual

In [81]:
def plot_xshore(filename):
    global df
    df = pd.read_fwf(filename, 
                     names=['survey','distance','elevation'],
                     widths=[15,12,12],
                     header=None)
    xmin = 0
    xmax = 0
    for item in df.survey.unique():
        distance = df[df.survey==item]['distance']
        elevation = df[df.survey==item]['elevation']
        plt.plot(distance,
                 elevation,
                 label=item)
        plt.xlabel('Distance from monument (ft)')
        plt.ylabel('Elevation (ft NGVD)')
        xmin = min(xmin, min(distance))
        xmax = max(xmax, max(distance))
    plt.hlines(y=0,
               xmin=xmin,
               xmax=xmax,
               colors='blue',
               linewidth=2)
    plt.show()
    plt.legend()

In [78]:
cd fire_island/


[WinError 2] The system cannot find the file specified: 'fire_island/'
C:\Users\jdorvinen\Documents\Jared\Projects\East Hampton\profiles\fire_island

In [79]:
filenames = ['F'+str(i+1)+'.txt' for i in range(84)]

In [82]:
interact_manual(plot_xshore, filename=filenames)



In [69]:
df[df.survey=='MSpring1997']


Out[69]:
survey distance elevation
564 MSpring1997 -76.49 15.67
565 MSpring1997 -76.49 15.67
566 MSpring1997 -64.31 16.60
567 MSpring1997 -53.58 17.77
568 MSpring1997 -41.15 18.87
569 MSpring1997 -29.71 20.24
570 MSpring1997 -11.63 23.11
571 MSpring1997 11.81 25.19
572 MSpring1997 12.08 20.84
573 MSpring1997 22.21 18.84
574 MSpring1997 36.22 18.62
575 MSpring1997 49.12 18.34
576 MSpring1997 49.28 20.58
577 MSpring1997 61.02 16.00
578 MSpring1997 72.34 14.63
579 MSpring1997 82.74 12.92
580 MSpring1997 98.91 11.94
581 MSpring1997 113.23 11.54
582 MSpring1997 125.95 11.05
583 MSpring1997 138.49 10.56
584 MSpring1997 149.62 9.96
585 MSpring1997 162.90 9.28
586 MSpring1997 174.95 8.44
587 MSpring1997 175.16 8.43
588 MSpring1997 191.95 7.04
589 MSpring1997 211.15 5.72
590 MSpring1997 221.66 4.81
591 MSpring1997 231.32 3.67
592 MSpring1997 248.39 1.88
593 MSpring1997 257.03 3.44
... ... ... ...
693 MSpring1997 1646.00 -21.76
694 MSpring1997 1660.58 -22.00
695 MSpring1997 1675.35 -22.24
696 MSpring1997 1685.10 -22.83
697 MSpring1997 1696.26 -23.33
698 MSpring1997 1707.78 -23.85
699 MSpring1997 1724.70 -24.09
700 MSpring1997 1743.95 -24.30
701 MSpring1997 1763.76 -24.51
702 MSpring1997 1776.33 -25.15
703 MSpring1997 1791.39 -25.70
704 MSpring1997 1806.57 -26.27
705 MSpring1997 1821.07 -26.66
706 MSpring1997 1837.63 -27.00
707 MSpring1997 1855.02 -27.35
708 MSpring1997 1873.22 -27.59
709 MSpring1997 1894.31 -27.79
710 MSpring1997 1916.16 -28.00
711 MSpring1997 1933.83 -28.36
712 MSpring1997 1953.93 -28.67
713 MSpring1997 1974.86 -28.99
714 MSpring1997 2011.82 -29.34
715 MSpring1997 2054.80 -29.64
716 MSpring1997 2099.18 -29.94
717 MSpring1997 2130.38 -29.98
718 MSpring1997 2166.60 -30.02
719 MSpring1997 2203.93 -30.06
720 MSpring1997 2245.72 -30.26
721 MSpring1997 2293.91 -30.43
722 MSpring1997 2344.50 -30.61

159 rows × 3 columns


In [54]:
for item in df.survey.unique():
    print(item)


FIMPFall1995
FIMPSpring1998
MFall1996
MSpring1996
MSpring1997

In [ ]: