def replace_coord(self, coordfile):
"""
Replace the coordinates with the data from the given
coordinate file.
"""
try:
coord_new = np.loadtxt(coordfile)
except ValueError:
coord_new = np.loadtxt(coordfile, delimiter=",")
ra_new = coord_new[:, 0]
dec_new = coord_new[:, 1]
if self.number != len(ra_new):
raise RuntimeError("invalid coordinate file: %s" % coordfile)
self.ra = ra_new
self.dec = dec_new
print("Replaced coordinates")
评论列表
文章目录