Commits

James Morrison committed 8466fe8

removed older files in root directory

Comments (0)

Files changed (2)

example.spt

-15
-480.7
-8.061
-3.8653E+1
-0.0
-0.0
-0
-0.0
-0.0
-0.0
-0.0
-0.0
-0.025,8.9833E-5,308.9,63.4,0.33,1.58
-0.030,2.0377E-4,305.2,57.6,0.27,2.38
-0.035,6.7682E-4,6.2,61.9,-0.05,2.21
-0.040,1.9427E-3,1.5,57.7,1.02,2.91
-0.045,3.3858E-3,6.9,57.4,2.01,2.94
-0.050,9.6246E-3,358.9,52.7,1.95,2.67
-0.055,1.6258E-2,354.1,43.2,-1.48,4.21
-0.060,4.8058E-2,4.2,39.5,0.49,4.45
-0.065,2.6958E-1,357.3,27.9,3.87,11.78
-0.070,4.8061E-1,355.1,38.4,4.15,6.28
-0.075,4.9913E-1,359.7,43.9,1.82,4.44
-0.080,6.6290E-1,351.8,31.5,0.78,5.55
-0.085,3.3858E-1,344.0,46.5,0.30,2.44
-0.090,6.8341E-1,338.4,44.0,0.55,2.48
-0.095,1.0000E+0,336.3,34.1,0.75,4.15
-0.100,4.6579E-1,327.7,38.4,0.14,2.12
-0.105,3.0479E-1,350.3,37.2,1.61,3.92
-0.110,2.4149E-1,331.8,47.4,0.62,1.83
-0.115,2.4496E-1,330.1,44.7,0.34,1.92
-0.120,2.4492E-1,344.1,41.5,0.99,2.92
-0.125,2.1784E-1,345.9,43.8,1.23,2.84
-0.130,1.9756E-1,342.5,40.9,0.70,2.84
-0.135,1.6498E-1,337.8,41.2,0.54,2.93
-0.140,1.4809E-1,325.9,46.5,0.41,2.39
-0.145,1.4480E-1,320.4,48.7,0.21,2.21
-0.150,1.2223E-1,325.0,48.4,0.37,2.17
-0.155,9.4722E-2,328.7,49.7,0.50,2.15
-0.160,6.9001E-2,325.1,54.4,0.30,1.90
-0.165,5.6958E-2,329.5,53.9,0.33,1.96
-0.170,5.9108E-2,333.9,48.6,0.20,2.14
-0.175,5.8596E-2,329.1,46.1,-0.18,2.17
-0.180,5.5295E-2,329.4,43.8,-0.20,2.77
-0.185,4.4118E-2,336.4,42.6,0.29,3.28
-0.190,3.7229E-2,340.1,46.0,0.41,2.22
-0.195,3.4479E-2,332.3,49.2,0.02,1.75
-0.200,2.9260E-2,323.7,47.8,-0.18,2.17
-0.205,2.7144E-2,323.0,47.6,-0.04,2.13
-0.210,2.6598E-2,324.4,51.9,0.02,1.67
-0.215,3.3444E-2,329.2,50.2,0.21,1.72
-0.220,3.7725E-2,328.4,47.3,0.12,2.00
-0.225,2.5902E-2,325.3,52.3,-0.04,1.99
-0.230,1.4602E-2,331.6,59.2,0.04,1.76
-0.235,1.1176E-2,340.8,58.3,0.29,1.93
-0.240,1.0761E-2,348.4,56.5,0.88,2.39
-0.245,1.3252E-2,334.4,53.7,0.56,2.35
-0.250,1.4071E-2,315.8,49.6,-0.26,2.60
-0.255,1.4214E-2,314.3,48.3,-0.51,2.83
-0.260,1.5520E-2,319.9,48.0,-0.07,2.83
-0.265,1.3405E-2,323.6,51.3,0.37,2.71
-0.270,9.7879E-3,322.1,55.7,0.29,2.27
-0.275,1.0062E-2,321.5,49.6,0.07,2.29
-0.280,1.0202E-2,326.5,44.7,0.12,2.60
-0.285,7.1345E-3,323.0,48.4,-0.17,2.70
-0.290,5.2764E-3,307.6,48.4,-0.58,3.24
-0.295,5.7450E-3,308.6,46.2,-0.21,3.36
-0.300,5.3440E-3,317.0,49.2,0.12,2.70
-0.305,4.8571E-3,326.9,57.2,0.09,2.23
-0.310,5.4819E-3,337.2,61.3,0.14,1.99
-0.315,6.0389E-3,331.6,56.7,0.05,2.11
-0.320,7.2825E-3,329.7,50.0,0.29,2.74
-0.325,7.0517E-3,328.0,48.7,0.23,2.88
-0.330,4.7086E-3,318.9,54.5,-0.71,2.10
-0.335,4.0838E-3,327.4,58.6,-0.53,1.53
-0.340,3.8877E-3,332.7,55.7,-0.21,1.49
-0.345,3.1754E-3,327.6,52.8,-0.26,1.69
-0.350,2.5980E-3,344.1,54.5,0.30,1.87
-0.355,2.0754E-3,2.9,56.5,0.82,2.16
-0.360,2.6676E-3,340.7,56.5,0.15,1.67
-0.365,3.0313E-3,322.6,50.8,-0.49,1.90
-0.370,2.7092E-3,321.7,49.1,-0.67,2.39
-0.375,2.7755E-3,314.6,51.6,-0.83,2.25
-0.380,2.4983E-3,300.3,54.4,-1.33,2.39
-0.385,2.2875E-3,321.4,61.7,-0.43,1.61
-0.390,2.8057E-3,6.5,54.4,1.60,2.46
-0.395,2.7390E-3,11.2,51.6,1.58,2.69
-0.400,1.8078E-3,353.3,57.3,0.37,1.79
-0.405,1.5891E-3,324.3,51.5,-0.33,2.24
-0.410,2.0199E-3,330.0,48.3,-0.15,2.42
-0.415,1.8691E-3,340.4,52.4,-0.09,1.93
-0.420,1.2849E-3,337.2,57.0,-0.22,1.70
-0.425,8.3900E-4,329.2,57.8,-0.11,1.85
-0.430,9.7271E-4,326.1,55.5,0.34,2.20
-0.435,1.3881E-3,324.0,54.3,0.28,2.50
-0.440,1.6625E-3,320.0,50.5,-0.24,3.15
-0.445,1.6407E-3,315.3,45.6,-0.62,3.76
-0.450,1.1803E-3,312.6,48.7,-0.95,2.84
-0.455,9.2122E-4,319.8,57.8,-0.64,1.76
-0.460,9.0655E-4,332.2,58.6,-0.06,1.57
-0.465,8.0972E-4,337.4,59.1,-0.07,1.72
-0.470,1.1634E-3,342.3,56.3,-0.11,1.91
-0.475,1.5732E-3,335.0,51.3,-0.09,2.18
-0.480,1.1655E-3,326.2,53.3,-0.43,2.00
-0.485,6.5211E-4,331.4,58.6,-0.32,1.71
-0.490,6.5829E-4,340.6,57.5,0.10,1.79
-0.495,7.8936E-4,336.3,55.8,-0.26,1.91
-0.500,9.1049E-4,335.5,56.4,-0.61,2.11
-0.505,9.2187E-4,353.5,60.3,0.24,1.86
-0.510,7.4970E-4,10.2,60.3,1.25,1.96
-0.515,6.4194E-4,5.1,62.5,0.92,1.66
-0.520,7.1172E-4,348.7,61.3,0.29,1.62
-0.525,8.3957E-4,338.2,52.8,0.03,2.08
-0.530,7.8778E-4,332.6,48.3,-0.32,2.53
-0.535,6.5754E-4,331.4,47.2,-0.44,3.08
-0.540,5.7662E-4,332.4,50.8,-0.24,2.45
-0.545,5.1178E-4,322.8,54.2,-0.59,1.82
-0.550,5.4154E-4,316.9,54.1,-0.62,1.83
-0.555,5.6371E-4,329.0,57.3,-0.11,1.70
-0.560,5.7191E-4,345.8,54.8,0.05,1.91
-0.565,4.9075E-4,348.6,51.9,0.01,1.93
-0.570,3.3697E-4,354.1,56.1,0.18,1.89
-0.575,3.0300E-4,358.8,61.4,0.18,1.80
-0.580,2.9289E-4,349.6,61.2,0.14,1.87
-0.585,3.5516E-4,351.0,57.6,0.56,2.09
-0.590,4.6053E-4,351.6,57.6,0.55,2.10
-0.595,3.7464E-4,347.0,60.7,0.21,1.92
-0.600,2.3210E-4,0.9,63.8,0.49,1.84
-0.605,1.4357E-4,32.8,62.2,1.33,2.36
-0.610,6.8776E-5,37.3,62.2,1.01,2.29
-0.615,2.7698E-5,3.7,62.0,-0.15,2.06
-0.620,7.7057E-6,340.3,61.1,-0.98,2.67
-0.625,1.6847E-6,311.4,67.1,-1.14,2.30
-0.630,6.7177E-7,323.8,73.8,-1.10,1.74
-0.635,4.9841E-7,341.9,73.3,0.14,1.66

plot_spectra.py

-import os
-import numpy as np
-import matplotlib.cm as cm
-import matplotlib.pyplot as plt
-import matplotlib.mlab as mlab
-import math
-
-files = { 'Buoy_Name':"example.spt"}
-
-for buoy_name, file_path in files.items():
-    spt = np.genfromtxt(file_path, delimiter=',', skiprows=12)
-    spt_under_90 = spt[spt[:,2]<90]
-    spt_over_270 = spt[spt[:,2]>270]
-    spt_under_90[:,2] = spt_under_90[:,2] + 360
-    spt_over_270[:,2] = spt_over_270[:,2] - 360
-    extra_spt = np.concatenate((spt_under_90,spt_over_270),axis=0)
-    complete_spt = np.concatenate((extra_spt,spt),axis=0)
-    
-    fig = plt.figure()
-    ax = fig.add_subplot(111, projection='polar')
-    ax.set_theta_zero_location("N")
-    ax.set_theta_direction(-1)
-    ax.set_ylabel('Frequency (Hz)')
-    ax.set_xlabel('Direction (degrees)')
-    ax.yaxis.set_label_coords(0.75, 0.75)
-    #y is frequency 
-    yi = np.linspace(min(spt[:,0]), max(spt[:,0]),123)
-    #x is direction
-    xi = np.linspace(-0.5*math.pi, 2.5*math.pi, 540)
-    X,Y = np.meshgrid(xi,yi)
-    Z = mlab.griddata(np.radians(complete_spt[:,2]),complete_spt[:,0],complete_spt[:,1],xi,yi)
-    Z = Z.filled(0)
-    subset_Z = Z[:,np.arange(90,450)]
-    ax_im = ax.contourf(xi[90:450], yi, subset_Z, cmap=cm.Reds)
-    fig.colorbar(ax_im)
-    t = fig.text(0.5, 0.97, file_path.split(os.sep)[-1], 
-                 horizontalalignment='center', fontsize=14)
-    plt.savefig(buoy_name + ".png")