Пример #1
0
def main():
    import mrc
    im1 = mrc.read(
        '/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00006m.mrc')
    mag1 = 14500
    im2 = mrc.read(
        '/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00007m.mrc')
    mag2 = 11500
    '''
        im1 = mrc.read('/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00002m.mrc')
        mag1 = 50000
        im2 = mrc.read('/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00003m.mrc')
        mag2 = 29000
        '''
    '''
        im1 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00005hl3.mrc')
        mag1 = 7800
        im2 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00005hl2.mrc')
        mag2 = 6500
        '''
    '''
        im1 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00004fa.mrc')
        mag1 = 50000
        im2 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00004fa2.mrc')
        mag2 = 29000
        '''
    '''
        im1 = mrc.read('../images/07apr03a/07apr03a_00003gr_00005sq_v01_00006hl.mrc')
        mag1 = 5000
        im2 = mrc.read('../images/07apr03a/07apr03a_00003gr_00005sq_v01.mrc')
        mag2 = 800
        '''
    #im1 = mrc.read('../images/07sep17jim4/07sep17jim4_00001a.mrc')
    #im2 = mrc.read('../images/07sep17jim4/07sep17jim4_00003a.mrc')
    #im1 = mrc.read('im00.mrc')
    #im2 = mrc.read('im01.mrc')

    scale = float(mag2) / mag1
    scalestart = scale - 0.02
    scaleend = scale + 0.02
    scaleinc = 0.005
    anglestart = -3
    angleend = 3
    angleinc = 0.25
    bin = 4
    binim1 = imagefun.bin(im1, bin)
    binim2 = imagefun.bin(im2, bin)
    rotation, scale = findRotationScale(binim1, binim2, anglestart, angleend,
                                        angleinc, scalestart, scaleend,
                                        scaleinc)

    shift = findShift(im1, im2, scale, rotation)
    print 'BEST SHIFT', shift
Пример #2
0
def main():
    import mrc

    im1 = mrc.read("/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00006m.mrc")
    mag1 = 14500
    im2 = mrc.read("/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00007m.mrc")
    mag2 = 11500
    """
	im1 = mrc.read('/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00002m.mrc')
	mag1 = 50000
	im2 = mrc.read('/ami/data00/leginon/07sep26cal/rawdata/07sep26cal_00003m.mrc')
	mag2 = 29000
	"""
    """
	im1 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00005hl3.mrc')
	mag1 = 7800
	im2 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00005hl2.mrc')
	mag2 = 6500
	"""
    """
	im1 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00004fa.mrc')
	mag1 = 50000
	im2 = mrc.read('/ami/data00/leginon/07sep25jim/rawdata/07sep25jim_00004fa2.mrc')
	mag2 = 29000
	"""
    """
	im1 = mrc.read('../images/07apr03a/07apr03a_00003gr_00005sq_v01_00006hl.mrc')
	mag1 = 5000
	im2 = mrc.read('../images/07apr03a/07apr03a_00003gr_00005sq_v01.mrc')
	mag2 = 800
	"""
    # im1 = mrc.read('../images/07sep17jim4/07sep17jim4_00001a.mrc')
    # im2 = mrc.read('../images/07sep17jim4/07sep17jim4_00003a.mrc')
    # im1 = mrc.read('im00.mrc')
    # im2 = mrc.read('im01.mrc')

    scale = float(mag2) / mag1
    scalestart = scale - 0.02
    scaleend = scale + 0.02
    scaleinc = 0.005
    anglestart = -3
    angleend = 3
    angleinc = 0.25
    bin = 4
    binim1 = imagefun.bin(im1, bin)
    binim2 = imagefun.bin(im2, bin)
    rotation, scale = findRotationScale(binim1, binim2, anglestart, angleend, angleinc, scalestart, scaleend, scaleinc)

    shift = findShift(im1, im2, scale, rotation)
    print "BEST SHIFT", shift
Пример #3
0
def readMrc():
        if len(sys.argv) <= 1:
                return numpy.zeros((1,1,1))
        mrcfile = sys.argv[1]
        if not os.path.isfile(mrcfile):
                return numpy.zeros((1,1,1))
        import mrc
        voldata = mrc.read(mrcfile)
        array = numpy.where(voldata > 0.5, 1.0, 0.0)
        return array