Skip to content

Commit

Permalink
refactor: use fabio.open to read detector data in FMBSAXSWAXSScanParser
Browse files Browse the repository at this point in the history
Allow use of .tiff _or_ .cbf detector file formats (or others) for FMB
SAXS/WAXS data.
  • Loading branch information
keara-soloway committed Feb 13, 2024
1 parent 490a730 commit a368ee0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions CHAP/utils/scanparsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,10 +671,11 @@ def get_detector_data_file(self, detector_prefix, scan_step_index:int):
self.detector_data_path, detector_files[scan_step_index])

def get_detector_data(self, detector_prefix, scan_step_index:int):
import fabio
image_file = self.get_detector_data_file(detector_prefix,
scan_step_index)
with TiffFile(image_file) as tiff_file:
image_data = tiff_file.asarray()
with fabio.open(image_file) as det_file:
image_data = det_file.data
return image_data


Expand Down

0 comments on commit a368ee0

Please sign in to comment.