Skip to content

Commit

Permalink
better retain datatype when reading column frame data
Browse files Browse the repository at this point in the history
  • Loading branch information
newville committed Nov 23, 2024
1 parent dc2700f commit 7807b4d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions larch/wxlib/columnframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -606,22 +606,23 @@ def __init__(self, parent, filename=None, groupname=None, config=None,
en_units = 'eV'
has_energy = True

# print("C : ", has_energy, self.workgroup.datatype, config)

if self.workgroup.datatype in (None, 'unknown'):
self.workgroup.datatype = 'xas' if has_energy else 'xydata'

datatype = config.pop('datatype', None)
if datatype is not None:
self.workgroup.datatype = datatype

en_units = 'eV' if self.workgroup.datatype == 'xas' else 'unknown'

self.read_ok_cb = read_ok_cb
self.config = dict(xarr=None, yarr1=None, yarr2=None, yop='/',
ypop='', monod=3.1355316, en_units=en_units,
yerr_op='constant', yerr_val=1, yerr_arr=None,
yrpop='', yrop='/', yref1='', yref2='',
has_yref=False, dtc_config={}, multicol_config={})
has_yref=False, dtc_config={}, multicol_config={},
datattype=self.workgroup.datatype)
if config is not None:
if 'datatype' in config:
config.pop('datatype')
self.config.update(config)

if self.config['yarr2'] is None and 'i0' in self.array_labels:
Expand Down

0 comments on commit 7807b4d

Please sign in to comment.