Пример #1
0
     DoArchive = True
 if not DoArchive:
     # If we removed some files it doesn't make sense to archive again
     print
     print '\tWe already ran DarkDeleter.py on experiment', \
         ExperimentID[SelectedExperiment]
     print '\tWe thus do not archive it again.'
     print '\tTake a look at', os.path.join(
         os.path.dirname(Experiment[SelectedExperiment])[len(
             StartingFolder):], ExperimentID[SelectedExperiment] +
         '.archive.log'), 'for more info'
     print
 else:
     # Archive it!
     logfile = functions.myLogger(
         os.path.dirname(Experiment[SelectedExperiment]),
         ExperimentID[SelectedExperiment] + '.archive.log')
     logfile.info('Archival log file for Experiment ID %s, archived on '
                  '%s', ExperimentID[SelectedExperiment],
                  time.strftime('%d.%m.%Y at %H:%M:%S'))
     logfile.info('\nMade with "%s" at Revision %s', os.path.basename(
         __file__), functions.get_git_hash())
     logfile.info(80 * '-')
     # Tar the selected folder
     TarCommand = ['tar', '-czf', Experiment[SelectedExperiment] +
                   '.tar.gz', '-C',
                   os.path.dirname(Experiment[SelectedExperiment]),
                   os.path.basename(Experiment[SelectedExperiment])]
     print 'Packing', ExperimentID[SelectedExperiment]
     logfile.info('Packing the original files with')
     logfile.info('---')
Пример #2
0
                                 SelectionImage.shape[0],
                                 facecolor='red', alpha=overlayalpha))
     tellme(' '.join(['click left (green) if you want to do the '
                      'evaluation,\nclick right (red) if you want to skip '
                      'experiment', ExperimentID[Counter]]))
     # If the user clicks in the red, we do the analysis, if in the green
     # we 'continue' to the next experiment ID
     if plt.ginput(1, timeout=-1)[0][0] > SelectionImage.shape[1] / 2:
         print 'We skip', ExperimentID[Counter]
         plt.close('all')
         continue
     else:
         print 'We evaluate', ExperimentID[Counter]
 else:
     wediditalready = False
 logfile = functions.myLogger(os.path.dirname(Experiment[Counter]),
                              ExperimentID[Counter] + '.resolution.log')
 logfile.info(
     'Log file for Experiment %s, Resolution analsyis performed on %s',
     ExperimentID[Counter], time.strftime('%d.%m.%Y at %H:%M:%S'))
 logfile.info('\nMade with "%s" at Revision %s', os.path.basename(__file__),
              git_hash)
 logfile.info(80 * '-')
 # either read original or contrast-stretched corrected image
 OriginalImage = plt.imread(os.path.join(
     os.path.dirname(Experiment[Counter]), ExperimentID[Counter] +
     '.image.corrected.png'))
 StretchedImage = plt.imread(os.path.join(
     os.path.dirname(Experiment[Counter]), ExperimentID[Counter] +
     '.image.corrected.stretched.png'))
 logfile.info('Loading corrected and contrast stretched corrected image')
 logfile.info(os.path.join(os.path.dirname(Experiment[Counter]),