コード例 #1
0
        def __init__(self, k, xdata, ydata):
                """
                xdata is linear from the CTF
                ydata is the normalized CTF with range 0 -> 1 and mean 0.5
                k is the shift as published in:
                        Park et al., IEEE Trans on Instr. and Meas. v 60#8, Aug 2011
                DOI: 10.1109/TIM.2011.2121231

                ydata ~= sin ( xdata^2 * freq + phi)
                """
                self.k = k
                self.xdata = xdata
                self.ydata = ydata
                self.xdatasq = self.xdata**2
                xfull = self.xdatasq.max() - self.xdatasq.min()
                self.sampling = xfull/float(len(self.xdata))

                self.xmax = self.sampling * len(self.xdata)**2
                print "Max X", self.xmax
                print "X sampling", self.sampling
                print "X data", len(self.xdata)
                imagestat.printImageInfo(self.xdata)
                print "X data^2", len(self.xdatasq)
                imagestat.printImageInfo(self.xdatasq)
                print "Y data", len(self.ydata)
                imagestat.printImageInfo(self.ydata)
コード例 #2
0
    def __init__(self, k, xdata, ydata):
        """
		xdata is linear from the CTF
		ydata is the normalized CTF with range 0 -> 1 and mean 0.5
		k is the shift as published in:
			Park et al., IEEE Trans on Instr. and Meas. v 60#8, Aug 2011
		DOI: 10.1109/TIM.2011.2121231

		ydata ~= sin ( xdata^2 * freq + phi)
		"""
        self.k = k
        self.xdata = xdata
        self.ydata = ydata
        self.xdatasq = self.xdata**2
        xfull = self.xdatasq.max() - self.xdatasq.min()
        self.sampling = xfull / float(len(self.xdata))

        self.xmax = self.sampling * len(self.xdata)**2
        print "Max X", self.xmax
        print "X sampling", self.sampling
        print "X data", len(self.xdata)
        imagestat.printImageInfo(self.xdata)
        print "X data^2", len(self.xdatasq)
        imagestat.printImageInfo(self.xdatasq)
        print "Y data", len(self.ydata)
        imagestat.printImageInfo(self.ydata)
コード例 #3
0
			%(fieldsize, count, apDisplay.timeString(time.time()-t0)))
	return poweravg, freq

#===================
#===================
#===================
if __name__ == "__main__":
	a = mrc.read("/home/vosslab/test.mrc")
	a = imagefilter.planeRegression(a)
	fullpower = imagefun.power(a)
	#imagestat.printImageInfo(a)
	t0 = time.time()
	x = numpy.arange(6, 13)
	N = 2**x
	print N
	for n in N:
		print "====================================="
		b = power(a, n)
		b = imagefilter.frame_cut(b, numpy.array(b.shape)/2)
		imagefile.arrayToPng(b, "%04d-field.png"%(n))
		imagestat.printImageInfo(b)

		bin = int(round(2**12/n))
		b = imagefun.bin2(fullpower, bin)
		b = imagefilter.frame_cut(b, numpy.array(b.shape)/2)
		imagefile.arrayToPng(b, "%04d-binned.png"%(n))
		imagestat.printImageInfo(b)

	print "complete in %s"%(apDisplay.timeString(time.time()-t0))
	#imagestat.printImageInfo(b)