From c19f681cf3c64216a4845187807d887d1cb06c38 Mon Sep 17 00:00:00 2001 From: y8z Date: Fri, 28 Jun 2024 14:45:34 -0400 Subject: [PATCH] add in support for mts for sofq import --- addie/addiedriver.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addie/addiedriver.py b/addie/addiedriver.py index bdbd55c5..2271efa8 100644 --- a/addie/addiedriver.py +++ b/addie/addiedriver.py @@ -455,7 +455,7 @@ def load_sq(self, file_name): simpleapi.ConvertToPointData( InputWorkspace=sq_ws_name, OutputWorkspace=sq_ws_name) # TODO REMOVE THIS LINE - elif ext == 'DAT' or ext == 'txt': + elif ext == 'DAT' or ext == 'TXT': try: simpleapi.LoadAscii( Filename=file_name, @@ -468,6 +468,16 @@ def load_sq(self, file_name): # the workspace out_ws = AnalysisDataService.retrieve(sq_ws_name) out_ws += 1 + elif ext == 'SQ': + try: + simpleapi.LoadAscii( + Filename=file_name, + OutputWorkspace=sq_ws_name, + Unit='MomentumTransfer', + SkipNumLines=2) + except RuntimeError: + sq_ws_name, q_min, q_max = "InvalidInput", 0, 0 + return sq_ws_name, q_min, q_max assert AnalysisDataService.doesExist( sq_ws_name), 'Unable to load S(Q) file %s.' % file_name