Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
z_src = self.src_table['z']
if 'kappa' in self.src_table:
gamma_1 = self.src_table['gamma1']
gamma_2 = self.src_table['gamma2']
kappa = self.src_table['kappa']
g1 = gamma_1/(1-kappa)
g2 = gamma_2/(1-kappa)
else:
print('read g1, g2 directly')
g1 = self.src_table['gamma1']
g2 = self.src_table['gamma2']
self.theta = np.sqrt((ra_src-ra_cl)**2+(dec_src-dec_cl)**2)*np.pi/180.
self.phys_dist = self.theta * ccl.comoving_angular_distance(self.cosmo, 1/(1+z_cl))/(1+z_cl)
phi = np.arctan2(dec_src-dec_cl, -(ra_src-ra_cl))
self.shear_t = - g1 * np.cos(2.0 * phi) - g2 * np.sin(2.0 * phi)
self.shear_c = - g1 * np.sin(2.0 * phi) + g2 * np.cos(2.0 * phi)
#plt.hist(self.shear_t)