From 14e913c2577796f30e88a64345c08fc1cd5de06a Mon Sep 17 00:00:00 2001 From: saurabh-astro Date: Mon, 3 Jun 2019 12:09:48 -0600 Subject: [PATCH] replaced feed_pol with pol --- hera_pspec/pspecdata.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/hera_pspec/pspecdata.py b/hera_pspec/pspecdata.py index e5ef2b86..fa99064b 100644 --- a/hera_pspec/pspecdata.py +++ b/hera_pspec/pspecdata.py @@ -917,7 +917,7 @@ def cov_q_hat(self, key1, key2, time_indices=None): qc[indnum] = np.trace(np.matmul(Ealphas, np.matmul(N1, np.matmul(Ebetas, N2))), axis1=2, axis2=3) return qc/4. - def q_hat(self, key1, key2, allow_fft=False, exact_norm = False, feed_pol=False): + def q_hat(self, key1, key2, allow_fft=False, exact_norm = False, pol=False): """ If exact_norm is False: @@ -967,7 +967,7 @@ def q_hat(self, key1, key2, allow_fft=False, exact_norm = False, feed_pol=False) If False, Q_alt is used (HERA memo #44, Eq. 16), and the power spectrum is normalized separately. - feed_pol: str/int/bool, optional + pol: str/int/bool, optional Used only if exact_norm is True. This argument is passed to get_Q to extract the requested beam polarization. Default is the first polarization passed to pspec. @@ -1014,7 +1014,7 @@ def q_hat(self, key1, key2, allow_fft=False, exact_norm = False, feed_pol=False) for i in range(self.spw_Ndlys): # Ideally, del_tau should be part of get_Q. We use it here to # avoid its repeated computation - Q = del_tau * self.get_Q(i, feed_pol) + Q = del_tau * self.get_Q(i, pol) Q_matrix_all_delays[i] = Q QRx2 = np.dot(Q, Rx2) @@ -1516,7 +1516,7 @@ def get_Q_alt(self, mode, allow_fft=True): Q_alt = np.einsum('i,j', m.conj(), m) # dot it with its conjugate return Q_alt - def get_Q(self, mode, feed_pol=False): + def get_Q(self, mode, pol=False): ''' Computes Q_alpha(i,j), which is the response of the data covariance to the bandpower (dC/dP_alpha). This includes contributions from primary beam. @@ -1526,7 +1526,7 @@ def get_Q(self, mode, feed_pol=False): mode : int Central wavenumber (index) of the bandpower, p_alpha. - feed_pol : str/int/bool, optional + pol : str/int/bool, optional Polarization for the beam. In case the polarization is not found, isotropic beam would be returned. @@ -1543,7 +1543,6 @@ def get_Q(self, mode, feed_pol=False): "of allowed range of delay modes.") tau = self.delays()[int(mode)] * 1.0e-9 # delay in seconds nu = self.freqs[self.spw_range[0]:self.spw_range[1]] # in Hz - pol = feed_pol #Get polarization try: beam_res, beam_omega, N = self.primary_beam.beam_normalized_response(pol, nu) @@ -2277,7 +2276,7 @@ def pspec(self, bls1, bls2, dsets, pols, n_dlys=None, verbose=verbose) scalar = 1.0 - feed_pol = (p[0]) # used in get_Q function to specify the correct polarization for the beam + pol = (p[0]) # used in get_Q function to specify the correct polarization for the beam spw_scalar.append(scalar) # Loop over baseline pairs @@ -2344,7 +2343,7 @@ def pspec(self, bls1, bls2, dsets, pols, n_dlys=None, # Calculate unnormalized bandpowers if verbose: print(" Building q_hat...") - qv = self.q_hat(key1, key2, exact_norm=exact_norm, feed_pol = feed_pol) + qv = self.q_hat(key1, key2, exact_norm=exact_norm, pol = pol) # Normalize power spectrum estimate if exact_norm: