From 8945a6d639509f797bf796040a358a21643fc514 Mon Sep 17 00:00:00 2001 From: Xiaopeng Wu Date: Mon, 14 Oct 2024 22:03:21 +0100 Subject: [PATCH] Fix scan_step_size in ImporterDM4 --- FourDExplorer/lib/ImporterDM4.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/FourDExplorer/lib/ImporterDM4.py b/FourDExplorer/lib/ImporterDM4.py index eddc27a..63c5ad9 100644 --- a/FourDExplorer/lib/ImporterDM4.py +++ b/FourDExplorer/lib/ImporterDM4.py @@ -412,12 +412,16 @@ def __init__(self, item_name: str, item_parent_path: str, parent: QObject = None '/Acquisition/Camera/pixel_number_j': 1024, '/Acquisition/Camera/pixel_size_i': 15e-6, '/Acquisition/Camera/pixel_size_j': 15e-6, + '/Acquisition/Camera/accelerating_voltage': 300000, + '/Acquisition/Camera/camera_length': 0.0, + '/Acquisition/Camera/step_size_i': 1.0, + '/Acquisition/Camera/step_size_j': 1.0, '/Calibration/Space/dp_i': 1024, '/Calibration/Space/dp_j': 1024, '/Calibration/Space/du_i': 1.0, '/Calibration/Space/du_j': 1.0, - '/Calibration/Space/du_dr_i': 1.0, - '/Calibration/Space/du_dr_j': 1.0, + '/Calibration/Space/scan_dr_i': 1.0, + '/Calibration/Space/scan_dr_j': 1.0, } @property @@ -513,12 +517,16 @@ def parseDM4(self, dm4_path: str): self.meta['/Acquisition/Camera/pixel_number_j'] = active_size[1] self.meta['/Acquisition/Camera/pixel_size_i'] = camera_pixel_size[0] * 1e-6 self.meta['/Acquisition/Camera/pixel_size_j'] = camera_pixel_size[1] * 1e-6 + self.meta['/Acquisition/Camera/accelerating_voltage'] = voltage + self.meta['/Acquisition/Camera/camera_length'] = camera_length + self.meta['/Acquisition/Camera/step_size_i'] = horizontal_spacing * 1e-9 + self.meta['/Acquisition/Camera/step_size_j'] = vertical_spacing * 1e-9 self.meta['/Calibration/Space/dp_i'] = self._dp_i self.meta['/Calibration/Space/dp_j'] = self._dp_j self.meta['/Calibration/Space/du_i'] = camera_pixel_size[0] * 1e-6 / (camera_length * 1e-3 * wavelength) self.meta['/Calibration/Space/du_j'] = camera_pixel_size[1] * 1e-6 / (camera_length * 1e-3 * wavelength) - self.meta['/Calibration/Space/du_dr_i'] = horizontal_spacing * 1e-9 - self.meta['/Calibration/Space/du_dr_j'] = vertical_spacing * 1e-9 + self.meta['/Calibration/Space/scan_dr_i'] = horizontal_spacing * 1e-9 + self.meta['/Calibration/Space/scan_dr_j'] = vertical_spacing * 1e-9 def loadData(self): """