Changeset 5e906207 in sasview for src/sas/sascalc/file_converter


Ignore:
Timestamp:
Aug 23, 2016 12:06:09 PM (8 years ago)
Author:
lewis
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
b61bd57
Parents:
f00691d4
git-author:
Lewis O'Driscoll <lewis.o'driscoll@…> (08/23/16 11:45:23)
git-committer:
Lewis O'Driscoll <lewis.o'driscoll@…> (08/23/16 12:06:09)
Message:

Read all metadata from HDF5 files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/file_converter/nxcansas_writer.py

    r7fce2bc r5e906207  
    139139        if data_info.sample.details is not None\ 
    140140            and data_info.sample.details != []: 
    141             details = reduce(lambda x,y: x + "\n" + y, data_info.sample.details) 
    142             sample_entry['details'] = _h5_string(details) 
     141            details = None 
     142            if len(data_info.sample.details) > 1: 
     143                details = [np.string_(d) for d in data_info.sample.details] 
     144                details = np.array(details) 
     145            elif data_info.sample.details != []: 
     146                details = _h5_string(data_info.sample.details[0]) 
     147            if details is not None: 
     148                sample_entry.create_dataset('details', data=details) 
    143149 
    144150        # Instrumment metadata 
Note: See TracChangeset for help on using the changeset viewer.