def pixmap(Isize1,Isize2,this_frame_phi_deg,pixel_size,size1,size2,spot_convention,procid): # returms a list of data points in a chunk of each image with info to calculate the h,k,l from spotfinder.applications.xfel import cxi_phil from iotbx.detectors.context.spot_xy_convention import spot_xy_convention SXYC = spot_xy_convention(pixel_size*size1,pixel_size*size2) from spotfinder.math_support import pixels_to_mmPos # for parallel running; calculate the range that will be worked on by this process chunksize = int(Isize2/nproc) if (Isize2 % nproc != 0): chunksize += 1 y1 = procid*chunksize y2 = y1 + chunksize if (y2>Isize2): y2=Isize2 # now walk through the pixels and create the list of data points raw_spot_input = flex.vec3_double() for y in xrange(y1,y2): # slow dimension for x in xrange(Isize1): # fast dimension mmPos = pixels_to_mmPos(x,y,pixel_size) rawspot = (mmPos[0],mmPos[1],this_frame_phi_deg) transpot = SXYC.select(rawspot,spot_convention) raw_spot_input.append(transpot) return raw_spot_input
def pixmap(Isize1,Isize2,this_frame_phi_deg,pixel_size,size1,size2,spot_convention,procid): # returms a list of data points in a chunk of each image with info to calculate the h,k,l from spotfinder.applications.xfel import cxi_phil from iotbx.detectors.context.spot_xy_convention import spot_xy_convention SXYC = spot_xy_convention(pixel_size*size1,pixel_size*size2) from spotfinder.math_support import pixels_to_mmPos # for parallel running; calculate the range that will be worked on by this process chunksize = int(Isize1/nproc) if (Isize1 % nproc != 0): chunksize += 1 x1 = procid*chunksize x2 = x1 + chunksize if (x2>Isize1): x2=Isize1 # now walk through the pixels and create the list of data points raw_spot_input = flex.vec3_double() for x in xrange(x1,x2): # slow dimension for y in xrange(Isize2): # fast dimension mmPos = pixels_to_mmPos(x,y,pixel_size) rawspot = (mmPos[0],mmPos[1],this_frame_phi_deg) transpot = SXYC.select(rawspot,spot_convention) raw_spot_input.append(transpot) return raw_spot_input