Splitting Intensity

Following Chevrot (2000)


In [1]:
%load_ext autoreload
%autoreload 2
%matplotlib inline

import sys
sys.path.append("..")
import splitwavepy as sw

import numpy as np
import matplotlib.pyplot as plt

In [2]:
def splittingintensity(rdiff,trans):
    """
    Calculate splitting intensity.
    """
    
    s = -2 * np.trapz(trans * rdiff) / np.trapz(rdiff**2)

    return s

In [17]:
a = sw.Pair(delta=0.05)

In [18]:
a.plot()



In [19]:
rdiff = np.gradient(a.x)
trans = a.y
print(splittingintensity(rdiff,trans))


-0.0169002774218

In [32]:
split=(0,4)
p = []
s = []
for pol in np.arange(0,365,5):
    data = sw.Pair(split=split,pol=pol,noise=0.01,delta=0.05)
    data.rotateto(pol)
    rdiff = np.gradient(data.x)
    trans = data.y
    p.append(pol)
    s.append(splittingintensity(rdiff,trans))

plt.plot(p,s)


Out[32]:
[<matplotlib.lines.Line2D at 0x10b729d68>]

In [7]:
data = sw.Pair(split=split,pol=45,noise=0.01,delta=0.05)
data.plot()



In [25]:
def dft(k,s,p):
    const = 2 * np.pi * 1j / 360
    return np.sum([ a * np.exp(const * k * b) for a,b in zip(s,p) ])

def h(k,s,p):
    n = len(p)
    return 2 * np.abs(dft(k,s,p)) / n

In [26]:
h(1,s,p)


Out[26]:
0.044223526295910386

In [20]:
[ print(a,b) for a,b in zip(s,p) ]


-0.495213354232 0
2.50996692745 5
4.79233941051 10
8.81003208846 15
11.6274386773 20
14.7892356035 25
17.8106243986 30
20.1012171308 35
20.5392089895 40
21.7059857589 45
22.4686501715 50
20.3421817891 55
18.3088312735 60
14.2213802255 65
11.1901693204 70
8.15985160796 75
5.56730443425 80
2.54878857146 85
0.316079727 90
-3.22841777563 95
-5.99763529957 100
-8.47803389157 105
-11.1645120004 110
-15.0045564858 115
-16.7817255506 120
-19.4263428115 125
-22.0641305104 130
-22.1402079019 135
-21.5204399566 140
-20.802565462 145
-17.761917772 150
-13.9480218657 155
-11.9128746025 160
-8.97198522725 165
-5.36534340635 170
-2.88685382896 175
-0.464511832409 180
2.63730179085 185
5.57813091244 190
7.64218611121 195
11.2993595563 200
14.3229267311 205
17.3737479934 210
20.083259037 215
22.0468810893 220
22.0385435235 225
21.9367995321 230
19.7980814973 235
17.2510310438 240
14.7660056661 245
11.2874720646 250
7.90102606686 255
5.18923614457 260
2.74915616938 265
0.206929077152 270
-3.26878669385 275
-5.76776233849 280
-8.34304935447 285
-11.5601225164 290
-14.9681266252 295
-17.2041504825 300
-19.6711455292 305
-21.904466298 310
-22.483353036 315
-20.8614455581 320
-20.1182754822 325
-17.2784819886 330
-15.1443221733 335
-11.8847444886 340
-8.412590538 345
-5.89177857202 350
-3.0380514305 355
0.218802251224 360
Out[20]:
[None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None,
 None]

In [ ]: