Skip to content

Commit

Permalink
Merge pull request #57 from FRBs/beamforming
Browse files Browse the repository at this point in the history
Beamforming
  • Loading branch information
cwjames1983 authored Dec 9, 2024
2 parents 942e545 + d17661e commit 84c6b4b
Show file tree
Hide file tree
Showing 8 changed files with 1,214 additions and 0 deletions.
9 changes: 9 additions & 0 deletions zdm/beam_generator/DSA110_beamfile.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
1.405e9 #MHz obs frequency
3.4 # FWHM [deg]
34.37 0 # pointing angle (zenith, azimuth) of primary beam. Centre is 71.6 deg - 37:14:02 = 34.37
48 # number of antennas
-200 0 # ant 1
200 0 # ant 48
256 # number of beams
-3.764 # azimuth angle of beam0 [deg]. 2.125 / sin(34.37)
3.764 # azimuth angle of final beam [deg] Adding 255 / 60. to above
29 changes: 29 additions & 0 deletions zdm/beam_generator/FAST.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
2 -1 1 1.04 60.
# above are: beam method (2: read tabe below)
# -1: individual half power beam widths
# 1: beam widths are HPBW
# 1.04: scale beam widths by this value (1.3 GHz to 1.25 GHz)
# 60. units of below, here arcminutes
# data from https://iopscience.iop.org/article/10.1088/1674-4527/20/5/64/pdf
# bX bY HPBW1300 A1250
-0.04 -0.02 3.01 0.622
5.76 -0.01 3.04 0.581
2.86 -4.98 3.03 0.617
-2.89 -5.01 3.05 0.598
-5.78 -0.02 3.03 0.639
-2.92 4.98 3.07 0.604
2.85 4.97 3.02 0.602
11.55 -0.02 3.04 0.554
8.65 -5.01 3.04 0.577
5.78 -10.02 3.08 0.586
0.00 -10.04 3.05 0.580
-5.78 -10.07 3.07 0.576
-8.67 -5.05 3.04 0.604
-11.61 -0.02 3.10 0.573
-8.68 4.99 3.06 0.568
-5.83 10.02 3.10 0.529
-0.03 10.00 3.02 0.565
5.76 10.00 3.05 0.557
8.63 4.98 3.03 0.569


24 changes: 24 additions & 0 deletions zdm/beam_generator/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This folder contains files used to generate simulate telescope beamshapes,
and convert them into Beamdata. These programs are independent of the zdm code,
but provide useful into to it.

The relevant programs are:

###### sim_fast_mutibeam.py ########
This program simulates the FAST multibeam system using data
contained in "FAST.dat", which is taken from
https://iopscience.iop.org/article/10.1088/1674-4527/20/5/64/pdf
With little adaptation, it could also simulate Parkes and Arecibo
multibeam systems.

###### sim_askap_beams.py ########
This program is used to simulate the envelope formed by
ASKAP beams.


###### sim_DSA_beams.py ######
Used to simulate the beamhape from tied beams generated by
an array of coherently added antennas. It is used to simulate
e.g. DSA beamshapes - although the exact locations of DSA
antennas are not known. It could easily be adapted to an arbitrary
tied array (e.g. MeerKAT)
52 changes: 52 additions & 0 deletions zdm/beam_generator/compare_fast_parkes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""
Compares FAST and PARKES multibeam profiles
Parkes is scaled to FAST according to simple scaling
relations.
Note that the Parkes profile is originally taken
from a full beam simulation.
"""
import numpy as np
from matplotlib import pyplot as plt

def main():



FASTb = np.load("FAST_log_bins.npy")
FASTh = np.load("FAST_log_hist.npy")

Parkesb = np.load("../data/BeamData/parkes_mb_log_bins.npy")
Parkesh = np.load("../data/BeamData/parkes_mb_log_hist.npy")

lPb = np.log10(Parkesb)
lPb = lPb[:-1]
lPb += (lPb[1]-lPb[0])/2.
Parkesb = 10**lPb

lFb = np.log10(FASTb)
lFb = lFb[:-1]
lFb += (lFb[1]-lFb[0])/2.
FASTb = 10**lFb

total = np.sum(FASTh)
print("Total FAST is ",total)
# scaling of Parkes hist
Parkesh *= 19/13 * (64/300)**2.

plt.figure()

plt.plot(Parkesb,Parkesh,label="Scaled Parkes")
plt.plot(FASTb,FASTh,label="Gaussian FAST sim")
plt.xlabel("B")
plt.ylabel("$\\Omega(B)$")
plt.xscale('log')
plt.yscale('log')
plt.legend()
plt.tight_layout()
plt.savefig("parkes_fast_comparison.png")
plt.close()

main()

44 changes: 44 additions & 0 deletions zdm/beam_generator/plot_askap_avals.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
"""
Simple script to plot the "avals": values of
beam sensitivity for ASKAP as a function of
distance from boresight.
These "avals" are taken from James et al.
"""

import numpy as np
from matplotlib import pyplot as plt


#### Defines theta offsets from boresights [deg] #####
thetas = np.linspace(0,4,51)

##### Loads in avals from Hotan et al #####
data = np.loadtxt("avals.dat")
x = data[:,0]
y = data[:,1]
h_avals = np.interp(thetas,x,y)

##### Calculates avals from James et al. #####
theta_off = 0.8
sigma_theta = 3.47

small = np.where(thetas < theta_off)

ftheta = np.exp(-0.5 * ((thetas-theta_off)/sigma_theta)**2.)
ftheta[small] = 1.

##### plots the values ######
plt.figure()

plt.plot(thetas,ftheta,label="James et al")
plt.plot(thetas,h_avals,label="Hotan et al")
plt.xlim(0,4.)
plt.ylim(0.63,1.06)
plt.xlabel("Offset from boresight [deg]")
plt.ylabel("Relative beam amplitude [B/B(0)]")
plt.legend()
plt.tight_layout()
plt.savefig('avals.pdf')
plt.close()
Loading

0 comments on commit 84c6b4b

Please sign in to comment.