diff --git a/conversion_examples/Fe_XDIFiles/fe_xas_nexus.h5 b/conversion_examples/Fe_XDIFiles/fe_xas_nexus.h5 index c52c15e..faccc53 100644 Binary files a/conversion_examples/Fe_XDIFiles/fe_xas_nexus.h5 and b/conversion_examples/Fe_XDIFiles/fe_xas_nexus.h5 differ diff --git a/conversion_examples/Fe_XDIFiles/make_xas.py b/conversion_examples/Fe_XDIFiles/make_xas.py index ae3f7d4..d9f084c 100644 --- a/conversion_examples/Fe_XDIFiles/make_xas.py +++ b/conversion_examples/Fe_XDIFiles/make_xas.py @@ -67,7 +67,7 @@ def xdi2nexus(filename, nxroot, entry_name='entry', preline = f"({preline})*energy(-{dat.nvict})" proc = ["processing done with xraylarch version 0.9.80", - f" larch.xafs.pre_edge(data, {kwargs})", + f"larch.xafs.pre_edge(data, {kwargs})", "using 'data' from arrays in rawdata", "energy = data[:,0] # column 1: energy (eV)", "itrans = data[:, 2] # column 3: transmitted beam intensity", @@ -103,17 +103,20 @@ def xdi2nexus(filename, nxroot, entry_name='entry', root['process'] = nexus.NXprocess(program='xraylarch', version='0.9.80', notes=notes) - - # rawdata - root['rawdata'] = rawdata - root['rawdata'].attrs['column_labels'] = json.dumps(["energy", "intensity", "itrans", "i0"]) - root['rawdata'].attrs['data_collector'] = 'Matthew Newville' - root['rawdata'].attrs['filename'] = filename + array_labels = json.dumps(["energy", "intensity", "itrans", "i0"]) + root['rawdata'] = rawdata.T + root['rawdata'].attrs['array_labels'] = array_labels + + root['reference'] = 'None' # scan scan = root['scan'] = nexus.NXcollection() + scan.attrs['data_collector'] = 'Matthew Newville' + scan.attrs['filename'] = filename + + scan.headers = json.dumps(dat.attrs) for key, val in dat.attrs['scan'].items(): diff --git a/conversion_examples/KEK_PFdata/Fe_XAS_PF9A_nexus.h5 b/conversion_examples/KEK_PFdata/Fe_XAS_PF9A_nexus.h5 index e0224a7..909209c 100644 Binary files a/conversion_examples/KEK_PFdata/Fe_XAS_PF9A_nexus.h5 and b/conversion_examples/KEK_PFdata/Fe_XAS_PF9A_nexus.h5 differ diff --git a/conversion_examples/KEK_PFdata/make_xas.py b/conversion_examples/KEK_PFdata/make_xas.py index 67cf89c..b0c0314 100644 --- a/conversion_examples/KEK_PFdata/make_xas.py +++ b/conversion_examples/KEK_PFdata/make_xas.py @@ -8,8 +8,6 @@ from larch.utils import gformat - - PLANCK_HC = 12398.419843320027 DEG2RAD = 0.017453292519943295 @@ -94,7 +92,7 @@ def kekpf2nexus(filename, nxroot, entry_name='entry', metadata=None): preline = f"({preline})*energy(-{dat.nvict})" proc = ["processing done with xraylarch version 0.9.80", - f" larch.xafs.pre_edge(data, {kwargs})", + f"larch.xafs.pre_edge(data, {kwargs})", "energy = col1 # column 1: energy (eV)", "ifluor = col3 # column 3: fluorescence intensity", "i0 = col4 # column 4: incident beam intensity", @@ -144,15 +142,16 @@ def kekpf2nexus(filename, nxroot, entry_name='entry', metadata=None): notes=notes) # rawdata - root['rawdata'] = np.array(coldata) - root['rawdata'].attrs['column_labels'] = json.dumps(array_labels) - root['rawdata'].attrs['data_collector'] = 'KEK PF BL9A' - root['rawdata'].attrs['filename'] = filename + root['rawdata'] = np.array(coldata).T + root['rawdata'].attrs['array_labels'] = json.dumps(array_labels) + root['reference'] = 'None' # scan scan = root['scan'] = nexus.NXcollection() scan.headers = json.dumps(meta) + scan.data_collector = 'KEK PF BL9A' + scan.filename = filename if 'scan' in meta: for key, val in meta['scan'].items(): diff --git a/conversion_examples/MultiElementFluor/V_XANES_nexus.h5 b/conversion_examples/MultiElementFluor/V_XANES_nexus.h5 index 28e20ef..d8914dc 100644 Binary files a/conversion_examples/MultiElementFluor/V_XANES_nexus.h5 and b/conversion_examples/MultiElementFluor/V_XANES_nexus.h5 differ diff --git a/conversion_examples/MultiElementFluor/make_xas.py b/conversion_examples/MultiElementFluor/make_xas.py index 145346e..ce83a76 100644 --- a/conversion_examples/MultiElementFluor/make_xas.py +++ b/conversion_examples/MultiElementFluor/make_xas.py @@ -120,7 +120,7 @@ def xdi2nexus(filename, nxroot, entry_name='entry', dtc = "with deadtime corection from columns in the data" nd = len(coldata) proc = ["processing done with xraylarch version 0.9.80", - f" larch.xafs.pre_edge(data, {kwargs})", + f"larch.xafs.pre_edge(data, {kwargs})", f"using col1..col{nd} for {nd} from arrays in rawdata", "energy = col1 # column 1: energy (eV)", "i0 = col4 # column 4: incident beam intensity", @@ -171,15 +171,16 @@ def xdi2nexus(filename, nxroot, entry_name='entry', notes=notes) # rawdata - root['rawdata'] = np.array(coldata) - root['rawdata'].attrs['column_labels'] = json.dumps(array_labels) - root['rawdata'].attrs['data_collector'] = 'Matthew Newville' - root['rawdata'].attrs['filename'] = filename + root['rawdata'] = np.array(coldata).T + root['rawdata'].attrs['array_labels'] = json.dumps(array_labels) + root['reference'] = 'None' # scan scan = root['scan'] = nexus.NXcollection() scan.headers = json.dumps(meta) + scan.data_collector = 'Tony Lanzirotti' + scan.filename = filename for key, val in meta['scan'].items(): setattr(scan, key, val)