Пример #1
0
###################
# define colormap #
###################
bad_color = '1.0'  # white background
colormap = gu.Colormap(bad_color=bad_color)
my_cmap = colormap.cmap

################
# define setup #
################
setup = exp.Setup(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=original_sdd,
                  pixel_x=pixel_size,
                  pixel_y=pixel_size)

#########################
# load a reconstruction #
#########################
plt.ion()
root = tk.Tk()
root.withdraw()
file_path = filedialog.askopenfilename(initialdir=datadir,
                                       filetypes=[("NPZ", "*.npz")])
npzfile = np.load(file_path)
amp = npzfile['amp']
Пример #2
0
#######################
# Initialize detector #
#######################
kwargs = dict()  # create dictionnary
kwargs['is_series'] = is_series
kwargs['preprocessing_binning'] = preprocessing_binning
kwargs['nb_pixel_x'] = nb_pixel_x  # fix to declare a known detector but with less pixels (e.g. one tile HS)
kwargs['nb_pixel_y'] = nb_pixel_y  # fix to declare a known detector but with less pixels (e.g. one tile HS)

detector = exp.Detector(name=detector, roi=roi_detector, sum_roi=normalize_roi, binning=binning, **kwargs)

####################
# Initialize setup #
####################
setup = exp.Setup(beamline=beamline, energy=energy, rocking_angle=rocking_angle, distance=sdd, direct_beam=direct_beam,
                  custom_scan=custom_scan, custom_images=custom_images, custom_monitor=custom_monitor,
                  custom_motors=custom_motors)

########################################
# print the current setup and detector #
########################################
print('\n##############\nSetup instance\n##############')
print(setup)
print('\n#################\nDetector instance\n#################')
print(detector)

############################################
# Initialize values for callback functions #
############################################
detector_plane = False
flag_mask = False
Пример #3
0
#######################
# Initialize detector #
#######################
kwargs = dict()  # create dictionnary
kwargs['is_series'] = is_series
kwargs['nb_pixel_x'] = nb_pixel_x  # fix to declare a known detector but with less pixels (e.g. one tile HS)
kwargs['nb_pixel_y'] = nb_pixel_y  # fix to declare a known detector but with less pixels (e.g. one tile HS)

detector = exp.Detector(name=detector, template_imagefile=template_imagefile, roi=roi_detector,
                        binning=binning, **kwargs)

####################
# Initialize setup #
####################
setup = exp.Setup(beamline=beamline, rocking_angle=rocking_angle, custom_scan=custom_scan, custom_images=custom_images,
                  custom_monitor=custom_monitor, custom_motors=custom_motors, actuators=actuators)

########################################
# print the current setup and detector #
########################################
print('\n##############\nSetup instance\n##############')
print(setup)
print('\n#################\nDetector instance\n#################')
print(detector)

########################
# initialize the paths #
########################
setup.init_paths(detector=detector, sample_name=sample_name, scan_number=scan, root_folder=root_folder,
                 save_dir=save_dir, save_dirname=save_dirname, verbose=True, create_savedir=True,
                 specfile_name=specfile_name, template_imagefile=template_imagefile)
Пример #4
0
detector = exp.Detector(name=detector,
                        template_imagefile=template_imagefile,
                        binning=phasing_binning,
                        **kwargs)

####################################
# define the experimental geometry #
####################################
# correct the tilt_angle for binning
tilt_angle = tilt_angle * preprocessing_binning[0] * phasing_binning[0]
setup = exp.Setup(beamline=beamline,
                  energy=energy,
                  outofplane_angle=outofplane_angle,
                  inplane_angle=inplane_angle,
                  tilt_angle=tilt_angle,
                  rocking_angle=rocking_angle,
                  distance=sdd,
                  pixel_x=detector.pixelsize_x,
                  pixel_y=detector.pixelsize_y,
                  sample_offsets=sample_offsets,
                  actuators=actuators)

########################################
# Initialize the paths and the logfile #
########################################
setup.init_paths(detector=detector,
                 sample_name=sample_name,
                 scan_number=scan,
                 root_folder=root_folder,
                 save_dir=save_dir,
                 specfile_name=specfile_name,
Пример #5
0
kwargs = dict()  # create dictionnary
kwargs['is_series'] = is_series

detector = exp.Detector(name=detector,
                        template_imagefile=template_imagefile,
                        binning=(1, 1, 1),
                        preprocessing_binning=pre_binning)

####################
# Initialize setup #
####################
setup = exp.Setup(beamline=beamline,
                  energy=energy,
                  rocking_angle=rocking_angle,
                  distance=sdd,
                  beam_direction=beam_direction,
                  sample_inplane=sample_inplane,
                  sample_outofplane=sample_outofplane,
                  sample_offsets=sample_offsets,
                  actuators=actuators)

########################################
# Initialize the paths and the logfile #
########################################
setup.init_paths(detector=detector,
                 sample_name=sample_name,
                 scan_number=scan,
                 root_folder=root_folder,
                 save_dir=save_dir,
                 specfile_name=specfile_name,
                 template_imagefile=template_imagefile,
Пример #6
0
kwargs[
    'nb_pixel_y'] = nb_pixel_y  # fix to declare a known detector but with less pixels (e.g. one tile HS)
detector = exp.Detector(name=detector,
                        template_imagefile=template_imagefile,
                        roi=roi_detector,
                        **kwargs)

####################
# Initialize setup #
####################
setup = exp.Setup(beamline=beamline,
                  energy=energy,
                  rocking_angle=rocking_angle,
                  distance=sdd,
                  beam_direction=beam_direction,
                  custom_scan=custom_scan,
                  custom_images=custom_images,
                  custom_monitor=custom_monitor,
                  custom_motors=custom_motors,
                  pixel_x=detector.pixelsize_x,
                  pixel_y=detector.pixelsize_y)

########################################
# print the current setup and detector #
########################################
print('\n##############\nSetup instance\n##############')
print(setup)
print('\n#################\nDetector instance\n#################')
print(detector)

###############################################