zorro_plotting.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:zorro 作者: C-CINA 项目源码 文件源码
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 )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号