mode = "OffLine" newerOnly = True debug = False for i in sys.argv[1:]: if i.lower().find("-online") in [0, 1]: mode = "dirwatch" elif i.lower().find("-all") in [0, 1]: newerOnly = False elif i.lower().find("-debug") in [0, 1]: debug = True if os.path.exists(i): paths.append(os.path.abspath(i)) if len(paths) == 0: if mode == "OffLine": print "This is the Normalize application of EDNA-BioSaxs, \nplease give a path to process offline or the option:\n\ --online to process online incoming data in the given directory.\n\ --all to process all existing files (unless they will be excluded)\n\ --debug to turn on debugging mode in EDNA" sys.exit() else: paths = [os.getcwd()] edna = EDParallelExecute(EDNAPluginName, fileName2xml, _functXMLerr=XMLerr, _bVerbose=True, _bDebug=debug) edna.runEDNA(paths, mode, newerOnly) EDVerbose.screen("Back in main")
mode = "dirwatch" elif i.lower().find("-all") in [0, 1]: newerOnly = False elif i.lower().find("-debug") in [0, 1]: debug = True elif i.lower().find("-ncpu") in [0, 1]: iNbCPU = int(i.split("=", 1)[1]) elif os.path.exists(i): paths.append(os.path.abspath(i)) if len(paths) == 0: if mode == "OffLine": print "This is the SPD-Correct application of %s, \nplease give a path to process offline or the option:\n\ --online to process online incoming data in the given directory.\n\ --all to process all existing files (unless they will be excluded)\n\ --debug to turn on debugging mode in EDNA\n\ --nCPU=xxx to specify the number of CPUs to use. Usually it auto-detects the number of processors." % EDNAPluginName sys.exit() else: paths = [os.getcwd()] listKeys = dictConfig.keys() listKeys.sort() for key in listKeys: val = raw_input("%s [%s] ?" % (key, dictConfig[key])) if len(val) > 0: dictConfig[key] = val edna = EDParallelExecute(EDNAPluginName, fileName2xml, _functXMLerr=XMLerr, _bVerbose=True, _bDebug=debug, _iNbThreads=iNbCPU) edna.runEDNA(paths, mode , newerOnly) edna.cleanUp(["killAllWorkers()"])
mode = "dirwatch" elif i.lower().find("-all") in [0, 1]: mode = "all" newerOnly = False elif i.lower().find("-debug") in [0, 1]: debug = True elif i.lower().find("-ncpu") in [0, 1]: iNbCPU = int(i.split("=", 1)[1]) elif i.lower().find("-h") in [0, 1]: print "This is the DiffractionCTv1 application of EDNA %s, \nplease give a path to process offline or the option:\n\ --online to process online incoming data in the given directory.\n\ --all to process all existing files (unless they will be excluded)\n\ --debug to turn on debugging mode in EDNA\n\ --nCPU=xxx to specify the number of CPUs to use. Usually EDNA autodetects the number of processors." % EDNAPluginName sys.exit() elif os.path.exists(i): paths.append(os.path.abspath(i)) dct = DiffractionCT() dct.setup(_listInput=paths, _mode=mode) edna = EDParallelExecute(EDNAPluginName, dct.makeXML, _functXMLerr=dct.error, _bVerbose=True, _bDebug=debug, _iNbThreads=iNbCPU) edna.runEDNA(dct.listInput, dct.strMode, dct.bNewerOnly) EDPluginSPDCakev1_5.killAllWorkers()
else: ffx = FullFieldXas() if os.path.isfile(".XSDataInputFullFieldXAS.xml"): ffx.load(".XSDataInputFullFieldXAS.xml") ffx.dontAlign = dontAlign if dontAlign: print ("*" * 80) print ("*" + "Skipping image alignement part".center(78) + "*") print ("*" * 80) ffx.setup(_listInput=paths, _mode=mode) if not isinstance(ffx.reference, int): ffx.uploadReferenceFrame(ffx.reference) ffx.save(".XSDataInputFullFieldXAS.xml") ffx.dump("analysis-%s.json" % time.strftime("%Y%m%d-%Hh%Mm%Ss")) edna = EDParallelExecute( ffx.pluginName, ffx.makeXML, _functXMLerr=ffx.error, _bVerbose=True, _bDebug=debug, _iNbThreads=iNbCPU ) edna.runEDNA(ffx.listInput, ffx.strMode, ffx.bNewerOnly) EDVerbose.WARNING("Back to main !") EDJob.synchronizeAll() ffx.updateAttrRefImage() EDPluginControlAlignStackv1_0.showData() if keepShare: EDShare.close() elif (ffx.getNrErrors() == 0) and (not EDVerbose.isVerboseDebug()): EDVerbose.WARNING("All processing finished successfully: Remove EDShare's big HDF5 file") EDShare.close(remove=True) else: EDShare.close()
iNbCPU = None for i in sys.argv[1:]: if i.lower().find("-online") in [0, 1]: mode = "dirwatch" elif i.lower().find("-all") in [0, 1]: mode = "all" newerOnly = False elif i.lower().find("-debug") in [0, 1]: debug = True elif i.lower().find("-ncpu") in [0, 1]: iNbCPU = int(i.split("=", 1)[1]) elif i.lower().find("-h") in [0, 1]: print "This is the DiffractionCTv1 application of EDNA %s, \nplease give a path to process offline or the option:\n\ --online to process online incoming data in the given directory.\n\ --all to process all existing files (unless they will be excluded)\n\ --debug to turn on debugging mode in EDNA\n\ --nCPU=xxx to specify the number of CPUs to use. Usually EDNA autodetects the number of processors." % EDNAPluginName sys.exit() elif os.path.exists(i): paths.append(os.path.abspath(i)) dct = DiffractionCT() dct.setup(_listInput=paths, _mode=mode) edna = EDParallelExecute(EDNAPluginName, dct.makeXML, _functXMLerr=dct.error, _bVerbose=True, _bDebug=debug, _iNbThreads=iNbCPU) edna.runEDNA(dct.listInput, dct.strMode , dct.bNewerOnly) EDPluginSPDCakev1_5.killAllWorkers()
if replay: ffx = FullFieldXas.replay_from(replay) else: ffx = FullFieldXas() if os.path.isfile(".XSDataInputFullFieldXAS.xml"): ffx.load(".XSDataInputFullFieldXAS.xml") ffx.dontAlign = dontAlign if dontAlign: print("*"*80) print("*" + "Skipping image alignement part".center(78) + "*") print("*"*80) ffx.setup(_listInput=paths, _mode=mode) if not isinstance(ffx.reference, int): ffx.uploadReferenceFrame(ffx.reference) ffx.save(".XSDataInputFullFieldXAS.xml") ffx.dump("analysis-%s.json" % time.strftime("%Y%m%d-%Hh%Mm%Ss")) edna = EDParallelExecute(ffx.pluginName, ffx.makeXML, _functXMLerr=ffx.error, _bVerbose=True, _bDebug=debug, _iNbThreads=iNbCPU) edna.runEDNA(ffx.listInput, ffx.strMode , ffx.bNewerOnly) EDVerbose.WARNING("Back to main !") EDJob.synchronizeAll() ffx.updateAttrRefImage() EDPluginControlAlignStackv1_0.showData() if keepShare: EDShare.close() elif (ffx.getNrErrors() == 0) and (not EDVerbose.isVerboseDebug()): EDVerbose.WARNING("All processing finished successfully: Remove EDShare's big HDF5 file") EDShare.close(remove=True) else: EDShare.close()