예제 #1
0
 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}
예제 #2
0
 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}
예제 #3
0
  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)
예제 #4
0
    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, :]