def overlap_check(ra, dec, radius):
"""
A very rough implementation, not using any distance or coverage calculation
for efficiency
"""
for i, re in enumerate(overlap_regions):
if (ra >= re[0] and ra <= re[1] and dec >= re[2] and dec <= re[3] and
radius <= re[4]):
#raise Exception("Sorry the region '{0}' does not contain any GLEAM sources".format(overlap_names[i]))
raise Exception(overlap_err)
icrs_coord = SkyCoord(ra * u.degree, dec * u.degree, frame='icrs')
gg = icrs_coord.galactic
b = float(str(gg.to_string().split(',')[0]).split()[1])
if (b < 9 and b > -9):
#raise Exception("Sorry Galactic Plane does not contain any GLEAM sources.")
raise Exception(overlap_err)
评论列表
文章目录