Skip to content

Commit

Permalink
metadata fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
Rama Vasudevan committed Jun 21, 2024
1 parent f8711e1 commit 535485c
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions SciFiReaders/readers/spectroscopy/neutron_reflectivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def read(self):
"""
self.file_path = self._input_file_path
metadata, headings, data = self._read_data()
self.headings = headings

# create the sidpy dataset
data_set = Dataset.from_array(data[:,1], name='Neutron Reflectivity')

Expand All @@ -38,11 +38,19 @@ def read(self):
units = str(headings[0][1]),
quantity=str(headings[0][0]),
dimension_type='spectral'))

metadata['column_headings'] = headings
metadata['raw_data'] = data

data_set.metadata = metadata

#get the metadata right
metadata_dict = {}

for line in metadata:
output = line.split(':')
if len(output)>1:
metadata_dict[output[0]] = output[1]

metadata_dict['header'] = metadata
metadata_dict['column_headings'] = headings
metadata_dict['raw_data'] = data
data_set.original_metadata = metadata_dict


def _read_data(self):
Expand Down

0 comments on commit 535485c

Please sign in to comment.