def run_fast(args): islow = args[0] result_val = flex.int(388) for jfast in xrange(388): histo1 = histograms[islow*388+jfast,:] nphotons = fit_3_gaussian.test_fit(histo1,plot=False) print islow*388+jfast, "of %d, # photons= %d"%(len(histograms),nphotons) result_val[jfast]=nphotons return {islow:result_val}
def run_fast(args): islow = args[0] result_val = flex.int(388) for jfast in range(388): histo1 = histograms[islow * 388 + jfast, :] nphotons = fit_3_gaussian.test_fit(histo1, plot=False) print islow * 388 + jfast, "of %d, # photons= %d" % ( len(histograms), nphotons) result_val[jfast] = nphotons return {islow: result_val}
fig=True if fig: plt.figure() plt.imshow(image,interpolation="none") plt.title("Raw ADU count, no histogram fitting") plt.colorbar() plt.clim(0, 25000) inelastic = copy.deepcopy(image) single_process = False if single_process: for islow in xrange(185): for jfast in xrange(388): histo1 = histograms[islow*388+jfast,:] nphotons = fit_3_gaussian.test_fit(histo1,plot=False) print islow*388+jfast, "of %d, # photons= %d"%(len(histograms),nphotons) inelastic[islow,jfast]=nphotons else: # same thing, multiprocess from libtbx import easy_mp import libtbx.introspection nproc = libtbx.introspection.number_of_processors(return_value_if_unknown=4) def run_fast(args): islow = args[0] result_val = flex.int(388) for jfast in xrange(388): histo1 = histograms[islow*388+jfast,:] nphotons = fit_3_gaussian.test_fit(histo1,plot=False) print islow*388+jfast, "of %d, # photons= %d"%(len(histograms),nphotons)
fig = True if fig: plt.figure() plt.imshow(image, interpolation="none") plt.title("Raw ADU count, no histogram fitting") plt.colorbar() plt.clim(0, 25000) inelastic = copy.deepcopy(image) single_process = False if single_process: for islow in range(185): for jfast in range(388): histo1 = histograms[islow * 388 + jfast, :] nphotons = fit_3_gaussian.test_fit(histo1, plot=False) print islow * 388 + jfast, "of %d, # photons= %d" % ( len(histograms), nphotons) inelastic[islow, jfast] = nphotons else: # same thing, multiprocess from libtbx import easy_mp import libtbx.introspection nproc = libtbx.introspection.number_of_processors( return_value_if_unknown=4) def run_fast(args): islow = args[0] result_val = flex.int(388) for jfast in range(388): histo1 = histograms[islow * 388 + jfast, :]