def gen_single_ps(self):
"""
Generate single point source, and return its data as a list.
"""
# Redshift and luminosity
self.z, self.lumo = self.get_lumo_redshift()
# angular diameter distance
self.param = PixelParams(self.z)
self.dA = self.param.dA
# W/Hz/Sr to Jy
dA = self.dA * 3.0856775814671917E+22 # Mpc to meter
self.lumo = self.lumo / dA**2 / (10.0**-24) # [Jy]
# Position
x = np.random.uniform(0, 1)
self.lat = (np.arccos(2 * x - 1) / np.pi * 180 - 90) # [deg]
self.lon = np.random.uniform(0, np.pi * 2) / np.pi * 180 # [deg]
# Area
npix = hp.nside2npix(self.nside)
self.area = 4 * np.pi / npix # [sr]
ps_list = [self.z, self.dA, self.lumo, self.lat, self.lon, self.area]
return ps_list
评论列表
文章目录