galaxyperlin.py 文件源码

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

项目:pythonprograms 作者: ElsaMJohnson 项目源码 文件源码
def svimg(totarr):
    #print it out:
    x,y=totarr.shape
    vl = np.around(totarr.flatten(),5)#round to 5 digits
    xx = np.repeat(np.arange(x),x)+1
    yy = np.tile(np.arange(y),y)+1
    big =np.column_stack((xx,yy,vl))
    np.savetxt("noisyimage.txt",big,fmt=('%4.1f','%4.1f','%10.5f'))
    ##Add this if you want to
    ##read it out to make sure it works
    ##Otherwise slows down routine.
    #row,col,data=np.loadtxt("noisyimage.txt",unpack=True)
    #rsize = int(max(row))
    #csize = int(max(col))
    #data=np.array(data).reshape(rsize,csize)
#   plt.imshow(data, interpolation='None',cmap=plt.cm.Greys_r)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号