print("Shape of dataset: ", numz, numy, numx) ############################## # find motors values in .fio # ############################## tilt, grazing, inplane, outofplane = pru.motor_values(frames_logical, logfile, scan, setup_pre, follow_bragg=False) setup_post = exp.SetupPostprocessing(beamline=setup_pre.beamline, energy=setup_pre.energy, outofplane_angle=outofplane, inplane_angle=inplane, tilt_angle=tilt, rocking_angle=setup_pre.rocking_angle, grazing_angle=grazing, distance=setup_pre.distance, pixel_x=detector.pixelsize, pixel_y=detector.pixelsize) nb_frames = len(tilt) if numz != nb_frames: print('The loaded data has not the same shape as the raw data') sys.exit() ####################### # Find the Bragg peak # ####################### z0, y0, x0 = pru.find_bragg(data, peak_method=peak_method) z0 = np.rint(z0).astype(int)
bad_color = '1.0' # white background colormap = gu.Colormap(bad_color=bad_color) my_cmap = colormap.cmap #################################### # define the experimental geometry # #################################### pixel_size = pixel_size * binning[1] tilt_angle = tilt_angle * binning[0] if binning[1] != binning[2]: print('Binning size different for each detector direction - not yet implemented') sys.exit() setup = exp.SetupPostprocessing(beamline=beamline, energy=energy, outofplane_angle=outofplane_angle, inplane_angle=inplane_angle, tilt_angle=tilt_angle, rocking_angle=rocking_angle, grazing_angle=grazing_angle, distance=sdd, pixel_x=pixel_size, pixel_y=pixel_size) # setup.detector_hor = 'y+' # setup.detector_ver = 'z-' # setup.detector_hor = 'y+' # setup.detector_ver = 'z+' # setup.detector_hor = 'y-' # setup.detector_ver = 'z+' # setup.detector_hor = 'y-' # setup.detector_ver = 'z-'