def loadStarFile(self, box_name ):
box_data = np.loadtxt( box_name, comments="_", skiprows=5 )
# box_data columns = [x_center, y_center, ..., ..., FigureOfMerit]
# In star files coordinates are centered
self.boxYX = np.fliplr( box_data[:,:2] )
# DEBUG: The flipping of the y-coordinate system is annoying...
self.boxYX[:,0] = self.im.shape[0] - self.boxYX[:,0]
# There's no box size information in a star file so we have to use a guess
self.boxLen = 224
#self.boxYX[:,1] -= int( self.boxLen / 2 )
#self.boxYX[:,0] += int( self.boxLen / 2 )
try:
self.boxFoM = box_data[:,4]
clim = zorro.zorro_util.ciClim( self.boxFoM, sigma=2.5 )
self.boxFoM = zorro.zorro_util.normalize( np.clip( self.boxFoM, clim[0], clim[1] ) )
except:
self.boxFoM = np.ones( self.boxYX.shape[0] )
self.boxColors = plt.cm.gnuplot( self.boxFoM )
评论列表
文章目录