Skip to content

Commit

Permalink
fit the NeXus NXsoecdata application definition
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed Jun 16, 2016
1 parent 5b3cf4e commit f355362
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/spec2nexus/writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def save(self, hdf_file, scan_list=[]):
# attributes
S1:NXentry
@default="data"
definition="NXspecdata"
# attributes and metadata fields
data:NXdata
@signal=<name of signal field>
Expand All @@ -77,6 +78,10 @@ def save(self, hdf_file, scan_list=[]):
pick_first_entry = True
for key in scan_list:
nxentry = eznx.makeGroup(root, 'S'+str(key), 'NXentry')
eznx.makeDataset(nxentry,
'definition',
'NXspecdata',
description='NeXus application definition')
self.save_scan(nxentry, self.spec.getScan(key))
if pick_first_entry:
pick_first_entry = False
Expand Down Expand Up @@ -112,7 +117,9 @@ def root_attributes(self):
SPEC_date = utils.iso8601(header0.date),
SPEC_comments = '\n'.join(header0.comments),
SPEC_num_headers = len(self.spec.headers),
h5py_version = h5py.__version__
h5py_version = h5py.__version__,
HDF5_Version = h5py.version.hdf5_version,
numpy_version = h5py.version.numpy,
)
try:
c = header0.comments[0]
Expand Down

0 comments on commit f355362

Please sign in to comment.