Commit 73d0094e authored by payno's avatar payno
Browse files

[TomoScanBase] add distance property

parent 5f840528
......@@ -390,6 +390,20 @@ class EDFTomoScan(TomoScanBase):
return d1, d2
@property
@docstring(TomoScanBase.distance)
def distance(self) -> Union[None, float]:
if self.__distance is None:
self.__distance = EDFTomoScan.retrieve_information(self.path,
None, "Distance",
type_=float,
key_aliases=('distance', )
)
if self.__distance is None:
return None
else:
return self.__distance
@staticmethod
def _get_pixel_size(scan: str) -> Union[None, int]:
if os.path.isdir(scan) is False:
......
......@@ -160,6 +160,14 @@ class TomoScanBase:
def scan_range(self) -> Union[None, int]:
raise NotImplementedError('Base class')
@property
def distance(self) -> Union[None, float]:
"""
:return: sample / detector distance in meter
"""
raise NotImplementedError('Base class')
def update(self) -> None:
"""Parse the root folder and files to update informations"""
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