def loadBoxFile(self, box_name ):
box_data = np.loadtxt( box_name, comments="_" )
# box_data columns = [x_center, y_center, ..., ..., FigureOfMerit]
self.boxLen = box_data[0,2]
# In boxfiles coordinates are at the edges.
self.boxYX = np.fliplr( box_data[:,:2] )
# DEBUG: The flipping of the y-coordinate system is annoying...
print( "boxYX.shape = " + str(self.boxYX.shape) + ", len = " + str(self.boxLen) )
self.boxYX[:,0] = self.im.shape[0] - self.boxYX[:,0]
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 )
评论列表
文章目录