示例#1
0
文件: Main.py 项目: xia2/trashcan
    def run(self):

        global inq
        global outq
        global tq

        if len(self._images) == 2:
            print 'Running %d %d' % self._images
            print '(%d left...)' % inq.qsize()
        elif len(self._images) == 3:
            print 'Running %d %d %d' % self._images
            print '(%d left...)' % inq.qsize()
        elif len(self._images) == 4:
            print 'Running %d %d %d %d' % self._images
            print '(%d left...)' % inq.qsize()

        mi_id = self._id

        # make a directory

        startdir = os.getcwd()

        if not os.path.exists(os.path.join(startdir, mi_id)):
            os.makedirs(os.path.join(startdir, mi_id))
        
        cell = m_index(mi_id, self._template, self._directory,
                       self._beam, self._images)

        shutil.rmtree(os.path.join(startdir, mi_id), True)

        outq.put((self._images, celldiff(cell, self._cell)))
        tq.put(self._id)

        return
示例#2
0
    if not p1:
        mi.set_not_p1()
    cell = mi.index()

    return cell

if __name__ == '__main__':

    # run a test...

    from BitsAndBobs import celldiff

    mi = MosflmIndexer()

    directory = os.path.join(os.environ['XIA2_ROOT'], 'Data', 'Test', 'Images')
    template = '12287_1_E1_###.img'
    beam = (109.0, 105.0)

    mi.set_directory(directory)
    mi.set_template(template)
    mi.set_beam(beam)
    mi.set_images((1, 90))

    cd = celldiff(mi.index(), (51.73, 51.85, 158.13, 90.00, 90.05, 90.20))

    if cd[0] > 0.5 or cd[1] > 0.5:
        raise RuntimeError, 'large autoindex error'