How to use the pyccl.comoving_angular_distance function in pyccl

To help you get started, we’ve selected a few pyccl examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github LSSTDESC / CLMM / clmm / summarizer / shear_azimuthal_averager.py View on Github external
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)