def read_input(args): file_name_input = '' frame_files = [] for i in range(len(args)): pair=args[i].split('=') if pair[0]=='input': file_name_input = pair[1] #other args are considered as the pickle directory if len(pair) == 1: if pair[0].endswith('.pickle'): frame_files.append(pair[0]) if file_name_input == '': print("Please provide input-parameters file (usage: input=yourinput.inp)") exit() from xfel.cxi.postrefine import postref_handler prh = postref_handler() iph = prh.read_input_parameters(file_name_input) #make run_no folder if not os.path.exists(iph.run_no): os.makedirs(iph.run_no) #check if pickle_dir is given in input file instead of from cmd arguments. if len(frame_files)==0: print('Path to pickle files is missing, please specify it at command line.') print('Usage: cxi.postrefine input=myinp.inp /path/to/pickles/*') exit() return iph, frame_files
def read_input(args): file_name_input = '' frame_files = [] for i in range(len(args)): pair=args[i].split('=') if pair[0]=='input': file_name_input = pair[1] #other args are considered as the pickle directory if len(pair) == 1: if pair[0].endswith('.pickle'): frame_files.append(pair[0]) if file_name_input == '': print "Please provide input-parameters file (usage: input=yourinput.inp)" exit() from xfel.cxi.postrefine import postref_handler prh = postref_handler() iph = prh.read_input_parameters(file_name_input) #make run_no folder if not os.path.exists(iph.run_no): os.makedirs(iph.run_no) #check if pickle_dir is given in input file instead of from cmd arguments. if len(frame_files)==0: print 'Path to pickle files is missing, please specify it at command line.' print 'Usage: cxi.postrefine input=myinp.inp /path/to/pickles/*' exit() return iph, frame_files
def postrefine_by_frame_mproc(frame_no, frame_files, iph, miller_array_ref): from xfel.cxi.postrefine import postref_handler prh = postref_handler() pres = prh.postrefine_by_frame(frame_no, frame_files[frame_no], iph, miller_array_ref) return pres
def scale_frame_by_mean_I_mproc(frame_no, frame_files, iph, mean_of_mean_I): from xfel.cxi.postrefine import postref_handler prh = postref_handler() pres = prh.scale_frame_by_mean_I(frame_no,frame_files[frame_no], iph, mean_of_mean_I) return pres
def determine_mean_I_mproc(frame_no, frame_files, iph): from xfel.cxi.postrefine import postref_handler prh = postref_handler() mean_I = prh.calc_mean_intensity(frame_files[frame_no], iph) return mean_I