from .constants import * # ----------------------------------------------------------------------------- # Generic profile generator # ----------------------------------------------------------------------------- class KSZ_Profile(object): R_star= 0.050 # 15 kpc/h L_gal0 = 10**(0.4*(tmpp_cat['Msun']-tmpp_cat['Mstar'])) def __init__(self): self.rGalaxy = 1.0 def evaluate_profile(r): raise NotImplementedError("Abstract function") def projected_profile(cos_theta,angularDistance): idx = np.where(cos_theta > 0)[0] tan_theta_2 = 1/(cos_theta[idx]**2) - 1 tan_theta_2_max = (self.rGalaxy/angularDistance)**2 tan_theta_2_min = (R_star/angularDistance)**2 idx0 = np.where((tan_theta_2 < tan_theta_2_max)) idx = idx[idx0] tan_theta_2 = tan_theta_2[idx0] tan_theta = np.sqrt(tan_theta_2) r = (tan_theta*DA) m,idx_mask = self.evaluate_profile(r) idx_mask = np.append(idx_mask,np.where(tan_theta_2