Commit 8024fc15 authored by payno's avatar payno
Browse files

add getter for distance and with unit

parent 55516231
......@@ -32,6 +32,7 @@ import os
import logging
from typing import Union
from collections import OrderedDict
from .unitsystem.metricsystem import MetricSystem
logger = logging.getLogger(__name__)
......@@ -176,6 +177,17 @@ class TomoScanBase:
"""
raise NotImplementedError('Base class')
def get_distance(self, unit='m') -> Union[None, float]:
"""
:param Union[MetricSystem, str] unit: unit requested for the distance
:return: sample / detector distance with the requested unit
"""
if self.distance:
return self.distance / MetricSystem.from_value(unit).value
else:
return None
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