pyfast_adt.main.fast_adt_func
Functions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this function for continuous tracking need both the tilt step and the tracking step, because it calculate the |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pets2 file writer to run it after the acquisition |
|
eadt file writer to run it after the acquisition, to finish |
|
i don't know where put it soo will stay here for now |
|
|
|
|
|
|
|
|
|
"FPS_function": ["678.62", "-0.943"], using this parameter of the self.cam_table, |
|
based on https://virtuelle-experimente.de/en/elektronenbeugung/wellenlaenge/de-broglie-relativistisch.php |
|
|
|
if you are in real space return pixelsize in nm, else in A-1 (Aperpixel) |
|
|
|
"from https://stackoverflow.com/questions/10097477/python-json-array-newlines?rq=3 |
|
|
|
the calibration in stem mode is handled differently wrt tem mode. here TIA is already providing the conversion |
|
|
|
|
|
|
|
sergi method to evaluate the tracking performances between 2 consecutive tracking acquisition. |
|
|
|
|
|
|
|
|
|
|
|
Calculate the maximum number of images that can be stored in memory for predefined resolutions and data type. |
|
|
automatic fine eucentric height from D.N. Mastronarde / Journal of Structural Biology 152 (2005) 36–51 |
|
script to perform the experiment of the 10/01/2025 for backlash characterization of the TEM goniometer |
|
|
Calculate the shift between a template and an image using OpenCV's matchTemplate. |
|
|
|
this function check for the 3 var for backlash correction x,y,z in the extra space. |
|
backlash correction can work in different ways as a function of the input parameters. |
script to perform the experiment of the 29/01/2025 for backlash characterization of the TEM goniometer. the main |
|
aaaa |
|
|
|
|
|
|
Linearly interpolates between consecutive tracking points and timestamps. |
Module Contents
- pyfast_adt.main.fast_adt_func.fake(self)
- pyfast_adt.main.fast_adt_func.go_to(self)
- pyfast_adt.main.fast_adt_func.undo(self)
- pyfast_adt.main.fast_adt_func.acquire_image(self, exposure, binning, processing)
- pyfast_adt.main.fast_adt_func.acquire_image_and_show(self, exposure, binning, processing)
- pyfast_adt.main.fast_adt_func.get_beam_intensity(self)
- pyfast_adt.main.fast_adt_func.set_image_setting(self)
- pyfast_adt.main.fast_adt_func.set_diff_setting(self)
- pyfast_adt.main.fast_adt_func.test_beam_shift(self)
- pyfast_adt.main.fast_adt_func.calibrate_beam_shift(self)
- pyfast_adt.main.fast_adt_func.acquire_tracking_images(self, tracking_path=None, custom_param=None)
this function for continuous tracking need both the tilt step and the tracking step, because it calculate the ratio between them to grab the images. the tilt step of the final acquisition determine the velocity of the stage. for the stepwise is not important, because the velocity parameter doesn’t exist. due to the fact that tilt step and exposure determine the velocity of the stage, to be consistent it’s better to use the same exposure and tilt step for
the final data acquisition, moreover don’t have a lot of mining expose for a long time because the image will be shitty!
- pyfast_adt.main.fast_adt_func.process_tracking_images(self, tracking_images, track_angles, method, visualization=False)
- pyfast_adt.main.fast_adt_func.reset_tracking_images(self)
- pyfast_adt.main.fast_adt_func.display_crystal_tracking(self, method)
- pyfast_adt.main.fast_adt_func.generate_tracking_file(self, method, text='tracking.txt', custom_param=None)
- pyfast_adt.main.fast_adt_func.load_tracking_file(self)
- pyfast_adt.main.fast_adt_func.initialize_beam_position(self)
- pyfast_adt.main.fast_adt_func.start_experiment(self)
- pyfast_adt.main.fast_adt_func.save_tracking_images(self, buffer, saving_dir)
- pyfast_adt.main.fast_adt_func.stop_experiment(self)
- pyfast_adt.main.fast_adt_func.write_report_experiment(self, path, add_val=None)
- pyfast_adt.main.fast_adt_func.write_pets_file(self, path, pets_default_values)
pets2 file writer to run it after the acquisition
- pyfast_adt.main.fast_adt_func.write_eadt_file(self, path, eadt_default_values)
eadt file writer to run it after the acquisition, to finish
- pyfast_adt.main.fast_adt_func.raster_scanning_userbeamshift(self, list_target=None)
i don’t know where put it soo will stay here for now
- pyfast_adt.main.fast_adt_func.read_tracking_file(self, text)
- pyfast_adt.main.fast_adt_func.write_tracking_file(self, text, start_angle, target_angle, tilt_step, rotation_speed, experiment_type, tracking_step, tracking_positions=None)
- pyfast_adt.main.fast_adt_func.retrieve_parameters_for_acquisition(self, mode='acquisition')
- pyfast_adt.main.fast_adt_func.set_parameters_gui(self, values)
- pyfast_adt.main.fast_adt_func.rotation_speed_value(self, mode='acquisition')
“FPS_function”: [“678.62”, “-0.943”], using this parameter of the self.cam_table, this calibration is an exponential fit of the FPS real vs exposure time(ms) (i.e 1/FPS theor). the value here come out in deg/s because compatible with fei
- pyfast_adt.main.fast_adt_func.calculate_wavelength(self, voltage, from_list=False)
based on https://virtuelle-experimente.de/en/elektronenbeugung/wellenlaenge/de-broglie-relativistisch.php constant took from google search, results match the relativistic wavelength in the JEOL website: https://www.jeol.com/words/emterms/20121023.071258.php#gsc.tab=0 input: voltage in kV, from_list = True if you want a table
- pyfast_adt.main.fast_adt_func.load_camera_table(self)
- pyfast_adt.main.fast_adt_func.image_pixelsize(self)
if you are in real space return pixelsize in nm, else in A-1 (Aperpixel)
- pyfast_adt.main.fast_adt_func.beam_shift_vs_image_calibration(self)
- pyfast_adt.main.fast_adt_func.load_initial_parameters_experiment(self)
- pyfast_adt.main.fast_adt_func.draw_circle_beam_shift(event, x, y, flags, param)
- pyfast_adt.main.fast_adt_func.to_json(self, o, level=0)
“from https://stackoverflow.com/questions/10097477/python-json-array-newlines?rq=3
- pyfast_adt.main.fast_adt_func.write_cam_table(self)
- pyfast_adt.main.fast_adt_func.list_pix_to_beamshift_stem(self, list_target_p=None)
the calibration in stem mode is handled differently wrt tem mode. here TIA is already providing the conversion between the beamshift function and the pixels in the haadf detector.
- pyfast_adt.main.fast_adt_func.stem_mode_imaging(self)
- pyfast_adt.main.fast_adt_func.evaluate_timings(self)
- pyfast_adt.main.fast_adt_func.tracking_precision_run(self, tracking_dict)
- pyfast_adt.main.fast_adt_func.evaluate_tracking_precision(self, saving, iteration, initial_tracking, second_tracking, input_param=None, output=None)
sergi method to evaluate the tracking performances between 2 consecutive tracking acquisition. if iteration 1 this means we are comparing initial_scan vs 1_scan, iter 2 is 1_scan vs 2_scan and so on.
- pyfast_adt.main.fast_adt_func.overall_tracking_precision(self, saving=None, output=None, output_method=None)
- pyfast_adt.main.fast_adt_func.re_evaluate_tracking_precision(self)
- pyfast_adt.main.fast_adt_func.re_evaluate_crystal_tracking_path(self)
- pyfast_adt.main.fast_adt_func.semi_manual_stepwise(self, exp_angle, exposure, binning, processing, img_buffer, root)
- pyfast_adt.main.fast_adt_func.display_image1(self, exposure, binning, processing)
- pyfast_adt.main.fast_adt_func.display_image2(self)
- pyfast_adt.main.fast_adt_func.display_image3(self, i, exp_angle)
- pyfast_adt.main.fast_adt_func.calculate_storage_capacity(data_type=np.uint16, available_memory_gb=16)
Calculate the maximum number of images that can be stored in memory for predefined resolutions and data type.
Parameters: - data_type (data-type): Data type of the images, e.g., np.uint16, np.uint8. - available_memory_gb (float): Amount of memory available for storage in GB.
Returns: - results (dict): Dictionary with pixels^2 as keys and a list [max_images storable, memory_per_image_mb] as values.
- pyfast_adt.main.fast_adt_func.get_available_memory_gb(self)
- pyfast_adt.main.fast_adt_func.automatic_eucentric_height(self)
automatic fine eucentric height from D.N. Mastronarde / Journal of Structural Biology 152 (2005) 36–51 collect eight images -24 to 24 deg. image shift in y is L.S. fitted to: y=(y0 + ys)*cos(alpha)-z0*sin(alpha)-y0 to determine both z0, the Z-height, and y0, the offset between tilt and optical axes, where ys is the image shift of the specimen at zero tilt. It will work only for modest Z-height disparities (up to 10 um) and may restart after adjusting Z-height if image shifts become too large.
- pyfast_adt.main.fast_adt_func.backlash_data_acquisition(self)
script to perform the experiment of the 10/01/2025 for backlash characterization of the TEM goniometer
- pyfast_adt.main.fast_adt_func.calculate_shift_with_opencv(self, template, image, ref_center, method=cv2.TM_CCOEFF_NORMED)
Calculate the shift between a template and an image using OpenCV’s matchTemplate.
- pyfast_adt.main.fast_adt_func.process_images_in_folder(self, image_folder, output_folder)
- pyfast_adt.main.fast_adt_func.re_evaluate_backlash_data(self)
- pyfast_adt.main.fast_adt_func.backlash_correction_single_axis(self, tracking_initial_pos=None, speed=1)
this function check for the 3 var for backlash correction x,y,z in the extra space. if one is ticked the backlash correction is performed for that axis, and iterate for the others. the correction is made at 0 deg alpha
- pyfast_adt.main.fast_adt_func.backlash_correction_alpha(self, exp_type, start_angle, final_angle, rotation_speed=0.7, rotation_speed_cred=0.3)
backlash correction can work in different ways as a function of the input parameters. 1) if stepwise is used, the correction is made by steps. instead in continuous the step is made in a single continuous step. 2) type can be chosen between ‘normal’ and ‘high precision’, this flag is chosen by a checkbox in the gui.
if not ticked, the normal mode is chosen, else high precision is selected and a fake rotation its added before the acquisition to increase the reproducibility of the goniometer.
- pyfast_adt.main.fast_adt_func.backlash_stage_acquisition(self)
script to perform the experiment of the 29/01/2025 for backlash characterization of the TEM goniometer. the main difference wrt backlash_data_acquisition function is that here the coordinates of the stage are used instead of reference images from detectors.
- pyfast_adt.main.fast_adt_func.evaluate_average_displacement_track_precision()
aaaa
- pyfast_adt.main.fast_adt_func.eucentric_height_z_scan(self)
- pyfast_adt.main.fast_adt_func.acquire_z_scan_tem_mode(self)
- pyfast_adt.main.fast_adt_func.linear_interpolation_tracking_path(self, tracking_points, tracking_timings, num_points=5)
Linearly interpolates between consecutive tracking points and timestamps.
- Parameters:
tracking_points (list of tuples) – List of (angle, x, y).
tracking_timings (list of float) – List of timestamps, same length as tracking_points.
num_points (int) – Number of interpolated points between each pair.
- Returns:
Interpolated (angle, x, y) points including originals. interpolated_timings (list of float): Corresponding interpolated timestamps.
- Return type:
interpolated_path (list of tuples)
- pyfast_adt.main.fast_adt_func.re_evaluate_manual_tracking_precision(self)
- pyfast_adt.main.fast_adt_func.fit_rigid_body_model_single_dataset(self)