import numpy as np
import pylab as plt
from scipy import signal
import math
import itertools
from datetime import datetime, timedelta
import csv, os
%matplotlib inline
%config InlineBackend.figure_formats=['svg']
Most of this information can be found on Matt Newcomb's South Pole Ice website. Needed are functional forms for $n(z)$ and $\lambda(z, T)$.
def index(depth):
"""
Returns the index of refraction at a given depth.
PARAMETERS
- depth : depth in meters
RETURN
index of refraction
"""
return 1.32 + 0.438*(1-np.exp(-0.0132*depth))
d = np.arange(0, 2500, 10)
plt.plot(d, index(d))
plt.xlabel('Depth (meters)')
plt.ylabel('Index of Refraction')
plt.grid()
def temperature(depth):
return -54.975 + 3.062 * np.exp(depth / 976.1)
plt.plot(d, temperature(d))
plt.xlabel('Depth (meters)')
plt.ylabel('Temperature (degrees C)')
plt.grid()
def atten2(f, depth):
t = temperature(depth)
a = 5.03097*np.exp(0.134806*t)
b = 0.172082*t+10.629
c = -0.00199175*t - 0.703323
return 1701/(a+b*f**(c+1))
d = np.arange(0, 2500, 100)
for f in np.arange(100, 1000, 150):
plt.plot(d, atten2(f*0.001, d), label='%d MHz' % f)
plt.grid()
plt.xlabel('Depth [meters]')
plt.ylabel('Attenuation Length [meters]')
plt.legend()
This is taken from Alvarez-Muñiz, Wolf, Zas, Practical and Accurate Calculations of Askaryan Radiation arXiv:1106.6283. These give time-domain models of the vector potential. As the article explains it is the convolution of the lateral shower charge distribution with the longitudinal distribution. The authors give a parametrized fit of the former. For the latter I use the standard shower parametrization from, e.g. PDG.
TODO: verify correct behavior of emission angles greater than $\frac{\pi}{2}$.
def RAC(t):
tp = t >= 0
tn = t < 0
ta = np.abs(t)
return -4.5E-11 * ((np.exp(-17.5*ta) + (1.0 + 2.87*ta)**-3)*tp + \
(np.exp(-33.3*ta) + (1.0 + 3.05*ta)**-3.5)*tn)
def shower(t, a, b=0.5):
return (b*t)**(a-1.0) * np.exp(-b*t) * b / math.gamma(a)
def askvp(t, theta, n=1.78):
if theta < 0.0 or theta > 0.5*math.pi:
return np.zeros(len(t), dtype='d')
zp = np.arange(0, 10, 0.02).reshape(500, 1)
Q = shower(zp*0.92/0.36, 4)
tp = zp * 3.33 * (1.0 - n*math.cos(theta))
return 0.01 * np.sum(Q * RAC(t-tp), 0)*math.sin(theta)/(1 - 1/n**2)**0.5
t = np.arange(-30, 30.05, 0.1)
plt.plot(t, askvp(t, math.radians(30)), label='30 deg')
plt.plot(t, askvp(t, math.radians(45)), label='45 deg')
plt.plot(t, 0.1*askvp(t, math.radians(55)), label='55 deg $\cdot$ 0.1')
plt.plot(t, askvp(t, math.radians(70)), label='70 degrees')
plt.grid()
plt.xlabel('Time (ns)')
plt.ylabel('Vector Potential [V.s]')
plt.legend(loc=4)
The electric field is given by the partial derivative of $\mathbf{A}$ with respect to time: $$\mathbf{E} = -\frac{\partial\mathbf{A}}{\partial t}$$
a45 = askvp(t, math.radians(45))
a55 = askvp(t, math.radians(55))
te = 0.5 * (t[1:] + t[0:-1])
e45 = -np.diff(a45)*1E10
e55 = -np.diff(a55)*1E10
plt.plot(te, e45)
plt.plot(te, e55*0.1)
plt.grid()
Then of course the frequency domain can be obtained from your best Fourier method. Below, I will transform to frequency space and then use the non-dispersive but lossy model for radio wave propagation. I would include dispersion effects but it seems hard and something I read said that it was really small. But, it's a TODO.
f, Pxx_den = signal.periodogram(e45, fs=20)
plt.semilogy(f, Pxx_den)
f, Pxx_den = signal.periodogram(e55, fs=20)
plt.semilogy(f, Pxx_den)
plt.axis([0, 2.5, 1E-10, 1E-2])
plt.grid()
plt.xlabel('Frequency [GHz]')
plt.ylabel('Power')
Here's an example of how propagation effects would be simulated.
E55 = np.fft.fft(e55)
fs = 10.0
f = np.fft.fftfreq(len(e55), d=1.0/fs)
plt.plot(f, np.abs(E55), '.')
E55p = E55*np.exp(-1000 / atten2(np.abs(f), 1000))*(1 > np.abs(f))*(0.1 < np.abs(f))
plt.plot(f, np.abs(E55p), '.')
plt.xlim((-2.5,2.5))
e55p = np.fft.ifft(E55p)
plt.plot(te, 0.1*e55)
plt.plot(te, np.real(e55p))
plt.xlim((-8, 8))
class Dipole(object):
def __init__(self, pos, length=1.0):
self.pos = pos
self.w = 0.0
self.length = length
self.f0 = 0.3 / (2.0 * length)
self.fmin = 0.4 * self.f0
self.fmax = 2.5 * self.f0
def heff(self, f, p_in):
"""
Antenna effective height.
INPUT:
f - frequency (MHz)
p_in - incident plane wave unit vector
"""
return (1.0 - p_in[2]**2)**0.5
def receive(self, w, t0, fs):
self.t = np.arange(0, len(w)) / fs + t0
self.w = w
class simkern(object):
def __init__(self, ant, genvol, **simpar):
self.ant = ant
self.genvol = genvol
self.askt0 = -25
self.askt1 = 25
self.fs = 10.0
def generate_event(self, e_scale=1.):
# generate neutrino direction
while True:
u = np.random.uniform(-1, 1, size=3)
um = np.sum(u**2)
if um <= 1.0:
um = um**0.5
u /= um
break
# generate vertex position in the ice
v = np.random.uniform(low=self.genvol[0], high=self.genvol[1])
print('Neutrino dir', u)
print('Neutrino vertex', v)
# loop on detectors (antennas)
tvp = np.linspace(self.askt0, self.askt1, (self.askt1 - self.askt0)*self.fs + 1)
t = 0.5*(tvp[1:] + tvp[0:-1])
f = np.fft.fftfreq(len(t), d=1.0/self.fs)
for a in self.ant:
obs = a.pos - v
r = np.dot(obs, obs)**0.5
costh = np.dot(obs, u) / r
theta = math.acos(costh)
#print('r = %.1f m' % r)
#print('cosine(theta) = %.3f' % costh)
if theta < 0.5*math.pi:
# askaryan radiation model in the time domain
vp = e_scale * askvp(tvp, theta) / r
er = -np.diff(vp)*fs*1E9
fwt = np.ones(len(f), dtype='d')
# step from source to receiver
track_step = np.arange(0, r+24, 25)
track_step[-1] = r
t_sig = 0.0
ia, ib = itertools.tee(track_step)
next(ib, None)
for ra, rb in zip(ia, ib):
rmid = 0.5*(ra + rb)
dr = rb - ra
x = v + obs * rmid / r
depth = -x[2]
atl = atten2(np.abs(f), depth)
fwt *= np.exp(-dr/atl)
#print(depth, f[20], atl[20], fwt[20])
t_sig += 3.33 * dr * index(depth)
# current signal propagation model is dispersionless
spx = np.real(np.fft.ifft(np.fft.fft(er) * fwt))
a.receive(spx, t_sig, self.fs)
a = [ Dipole(np.array((x, y, -z), 'd'))
for x in np.linspace(-4000, 4000, 21)
for y in np.linspace(-4000, 4000, 21)
for z in [50, 100]]
sk0 = simkern(a, genvol=((-2000, -2000, -2500), (2000, 2000, 0)))
sk0.generate_event(e_scale=100.)
nhit = 0
for a in sk0.ant:
if np.max(np.abs(a.w)) > 15E-6: nhit += 1
print (nhit)
plt.rcParams['figure.figsize'] = (5,5)
plt.scatter([a.pos[0]*0.001 for a in sk0.ant], [a.pos[1]*0.001 for a in sk0.ant], s=[np.max(np.abs(a.w))*1E5 for a in sk0.ant])
plt.grid()
plt.savefig('askarr-105.png', dpi=300)
plt.plot(sk0.ant[115].t, sk0.ant[115].w+np.random.normal(scale=12E-6, size=500))
f, Pxx = signal.periodogram(sk0.ant[115].w, fs=10.)
plt.plot(f, 10*np.log10(Pxx*50))
plt.axis([0, 2, -125, -50])
for i, a in enumerate(sk0.ant):
ax = np.max(np.abs(a.w))
if ax > 1E-5:
print (a.pos, i, ax)
Pn = 1.38E-23 * 220 * 1E9
Vn = (Pn*50)**0.5
Pn