Skip to content
Snippets Groups Projects
Commit 4a0ae205 authored by payno's avatar payno
Browse files

fluoscan: improve error messages

parent 436763ef
No related branches found
No related tags found
1 merge request!248WIP: Add handling of 2D XRFDATA. Angles in 2D still to handle
Pipeline #216242 passed
......@@ -116,6 +116,8 @@ class FluoTomoScanBase:
raise RuntimeError("Detectors not initialized")
def get_metadata_from_h5_file(self):
if len(self.detected_folders) == 0:
raise ValueError("No detector found, unable to load metadata")
h5_path = os.path.join(self.scan, self.detected_folders[0])
h5_files = glob.glob1(h5_path, "*.h5")
if len(h5_files) > 1:
......@@ -145,6 +147,8 @@ class FluoTomoScanBase:
)
def detect_detectors(self):
if len(self.detected_folders) == 0:
raise ValueError("No detector found, unable to detect detectors")
proj_1_dir = os.path.join(self.scan, "fluofit", self.detected_folders[0])
detected_detectors = []
file_names = glob.glob1(proj_1_dir, "IMG_*area_density_ngmm2.tif")
......@@ -155,6 +159,8 @@ class FluoTomoScanBase:
return detected_detectors
def detect_elements(self):
if len(self.detected_folders) == 0:
raise ValueError("No detector found, unable to detect elements")
proj_1_dir = os.path.join(self.scan, "fluofit", self.detected_folders[0])
detector = self.detectors[0]
file_names = glob.glob1(proj_1_dir, f"IMG_{detector}*area_density_ngmm2.tif")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment