Skip to content
Snippets Groups Projects
Commit edf6799f authored by Maaijke Mevius's avatar Maaijke Mevius
Browse files

Merge branch 'add_G_only' into 'main'

add option to have a G only beam

See merge request !1
parents a1595b2d b764b3f9
No related branches found
No related tags found
1 merge request!1add option to have a G only beam
...@@ -672,3 +672,12 @@ class DualDipoleBeam(GriddedBeam): ...@@ -672,3 +672,12 @@ class DualDipoleBeam(GriddedBeam):
w = w*e w = w*e
self.Hbeam = np.sum((AF.T*w.conj()).T,axis=0)#/np.sqrt(w.shape[0]) self.Hbeam = np.sum((AF.T*w.conj()).T,axis=0)#/np.sqrt(w.shape[0])
return self.Hbeam return self.Hbeam
def getGGrid(self,freq, pol = 'rcp', transmit_pol = 'rcp'):
AF = self.getG(*(self.spherical_grid), freq, pol = pol,
transmit_pol = transmit_pol)
w = self.weights
e = self.gain_errors
w = w*e
self.beam = np.sum((AF.T*w.conj()).T,axis=0)#/np.sqrt(w.shape[0])
return self.beam
\ No newline at end of file
...@@ -306,5 +306,26 @@ def FitWeights(beam, source_dir, constraints, freq, ...@@ -306,5 +306,26 @@ def FitWeights(beam, source_dir, constraints, freq,
print("underdetermined") print("underdetermined")
return np.dot(np.linalg.pinv(Aht),constraints).squeeze() #complex weights return np.dot(np.linalg.pinv(Aht),constraints).squeeze() #complex weights
def projectionG(beam, rfi_dir, freq,
receiver_pol = 'ele', transmit_pol = 'rcp'):
W = beam.getG(rfi_dir[0], rfi_dir[1], freq,
pol = receiver_pol, transmit_pol = transmit_pol) #Nant x N_rfi
Nant = W.shape[0]
Nrfi = W.shape[1]
P = np.eye(Nant)
R = np.dot(W,W.conj().T)
l,V = np.linalg.eig(R)
V_sel = V[:,np.abs(l)>1e-7]
#print(V,V_sel.shape,V_sel,l)
P = P - np.dot(V_sel,V_sel.conj().T)
# for i in range(Nrfi):
# #wtemp = np.dot(W[:,i],P)
# #p = np.eye(beam.Nant) - \
# # np.outer(wtemp,wtemp.conj())/np.dot(wtemp,wtemp.conj())
# #P = p
# p = np.eye(beam.Nant) - \
# np.outer(W[:,i],W[:,i].conj())/np.dot(W[:,i],W[:,i].conj())
# P = np.dot(p,P)
return P
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment