Commit 93a23789 authored by payno's avatar payno
Browse files

add pixel size getter

parent 8024fc15
Pipeline #21845 failed with stages
in 59 seconds
......@@ -417,7 +417,7 @@ class EDFTomoScan(TomoScanBase):
return self.__energy
def _get_pixel_size(scan: str) -> Union[None, int]:
def _get_pixel_size(scan: str) -> Union[None, float]:
if os.path.isdir(scan) is False:
return None
value = EDFTomoScan.retrieve_information(scan=scan,
......@@ -142,9 +142,15 @@ class TomoScanBase:
raise NotImplementedError('Base class')
def pixel_size(self) -> Union[None, int]:
def pixel_size(self) -> Union[None, float]:
raise NotImplementedError('Base class')
def get_pixel_size(self, unit='m') -> Union[None, float]:
if self.pixel_size:
return self.pixel_size / MetricSystem.from_value(unit)
return None
def dim_1(self) -> Union[None, int]:
raise NotImplementedError('Base class')
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment