Exemplo n.º 1
0
 def test_get_tilt_series_label(self):
     self.assertEqual(util.get_tilt_series_label(0), 'a')
     self.assertEqual(util.get_tilt_series_label(2), 'c')
     self.assertEqual(util.get_tilt_series_label(24), 'y')
     self.assertEqual(util.get_tilt_series_label(25), 'z')
     self.assertEqual(util.get_tilt_series_label(26), 'ba')
     self.assertEqual(util.get_tilt_series_label(27), 'bb')
     self.assertEqual(util.get_tilt_series_label(51), 'bz')
     self.assertEqual(util.get_tilt_series_label(52), 'ca')
     self.assertEqual(util.get_tilt_series_label(180), 'gy')
Exemplo n.º 2
0
    def _put_all_tilts_into_result_dir(self, dirlist):

        resultdir = self._get_result_dir()
        if not os.path.isdir(resultdir):
            os.makedirs(resultdir)

        counter = 0
        for path in dirlist:
            tiltname = util.get_tilt_series_label(counter)
            # copy clip mrc file
            shutil.copy(
                os.path.join(path, self._projectionclipmrc),
                os.path.join(resultdir, self._mrcname + tiltname + TiltSeriesCreator.PREALI_EXT),
            )

            # copy clip fid file
            shutil.copy(
                os.path.join(path, self._projectionclipfid),
                os.path.join(resultdir, self._mrcname + tiltname + TiltSeriesCreator.FID_EXT),
            )

            # copy rawtilt if it exists
            rawtlt = os.path.join(path, self._rawtlt)
            if os.path.isfile(rawtlt):
                destrawtlt = os.path.join(resultdir, self._mrcname + tiltname + TiltSeriesCreator.RAW_TLT_EXT)
                shutil.copy(rawtlt, destrawtlt)
            else:
                if destrawtlt is not None:

                    shutil.copy(
                        destrawtlt, os.path.join(resultdir, self._mrcname + tiltname + TiltSeriesCreator.RAW_TLT_EXT)
                    )
            counter += 1