diff --git a/ubermagtable/table.py b/ubermagtable/table.py index 8c4ffbc..6ab6113 100644 --- a/ubermagtable/table.py +++ b/ubermagtable/table.py @@ -272,11 +272,7 @@ def fromfile(cls, filename, /, x=None, rename=True): >>> table = ut.Table.fromfile(odtfile, x='t') """ - # MagnetoElastic OOMMF extension adds energy twice to data. The - # following lines are just a way to fix that in the data. cols = uu.columns(filename, rename=rename) - if 'MEL_E' in cols: - cols.insert(cols.index('E'), 'E') return cls(data=pd.DataFrame(uu.data(filename), columns=cols), units=uu.units(filename, rename=rename), x=x) diff --git a/ubermagtable/util/util.py b/ubermagtable/util/util.py index 0c0d7b2..38bef9b 100644 --- a/ubermagtable/util/util.py +++ b/ubermagtable/util/util.py @@ -43,8 +43,8 @@ 'CGEvolve::Cycle count': 'cycle_count', 'CGEvolve::Cycle sub count': 'cycle_sub_count', 'CGEvolve::Energy calc count': 'energy_calc_count', - 'CGEvolve:evolver:Energy calc count YY_FixedMEL::Energy': - 'MEL_E', + 'FixedMEL::Energy': 'MEL_E', + 'FixedMEL:magnetoelastic:Energy': 'MEL_E', 'SpinTEvolve:evolver:Total energy': 'E', 'SpinTEvolve:evolver:Energy calc count': 'E_calc_count', 'SpinTEvolve:evolver:Max dm/dt': 'max_dmdt', @@ -195,7 +195,7 @@ def columns(filename, rename=True): if lines[0].startswith('# ODT'): # OOMMF odt file cline = list(filter(lambda l: l.startswith('# Columns:'), lines))[0] - cline = re.split(r'Oxs_|Anv_|Southampton_|My_|UHH_|Xf_', cline)[1:] + cline = re.split(r'Oxs_|Anv_|Southampton_|My_|YY_|UHH_|Xf_', cline)[1:] cline = list(map(lambda col: re.sub(r'[{}]', '', col), cline)) cols = list(map(lambda s: s.strip(), cline)) cols_dict = oommf_dict