diff larch_artemis.py @ 1:84c8e04bc1a1 draft

planemo upload for repository https://github.com/MaterialsGalaxy/larch-tools/tree/main/larch_artemis commit 1cf6d7160497ba58fe16a51f00d088a20934eba6
author muon-spectroscopy-computational-project
date Wed, 06 Dec 2023 13:03:46 +0000
parents 2752b2dd7ad6
children 39ab361e6d59
line wrap: on
line diff
--- a/larch_artemis.py	Tue Nov 14 15:34:23 2023 +0000
+++ b/larch_artemis.py	Wed Dec 06 13:03:46 2023 +0000
@@ -5,20 +5,16 @@
 import os
 import sys
 
-from common import get_group
+from common import read_group
 
 from larch.fitting import guess, param, param_group
-from larch.io import read_athena
 from larch.symboltable import Group
 from larch.xafs import (
     FeffPathGroup,
     FeffitDataSet,
     TransformGroup,
-    autobk,
     feffit,
     feffit_report,
-    pre_edge,
-    xftf,
 )
 
 import matplotlib
@@ -39,14 +35,6 @@
     return csv_data
 
 
-def calc_with_defaults(xafs_group: Group) -> Group:
-    """Calculate pre_edge and background with default arguments"""
-    pre_edge(xafs_group)
-    autobk(xafs_group)
-    xftf(xafs_group)
-    return xafs_group
-
-
 def dict_to_gds(data_dict):
     dgs_group = param_group()
     for par_idx in data_dict:
@@ -209,12 +197,10 @@
     rmr_path = f"rmr/rmr{series_id}.png"
     chikr_path = f"chikr/chikr{series_id}.png"
 
-    athena_project = read_athena(prj_file)
-    athena_group = get_group(athena_project)
     # calc_with_defaults will hang indefinitely (>6 hours recorded) if the
     # data contains any NaNs - consider adding an early error here if this is
     # not fixed in Larch?
-    data_group = calc_with_defaults(athena_group)
+    data_group = read_group(prj_file)
 
     print(f"Fitting project from file {data_group.filename}")