Changeset 346d56e in sasview for src/sas/sascalc/file_converter


Ignore:
Timestamp:
Aug 19, 2016 6:43:06 AM (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:
a14fa99
Parents:
995f4eb
Message:

Allow adding metadata to 2d files and ensure it's written correctly

File:
1 edited

Legend:

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

    r9f4d891 r346d56e  
    6262                run_name = data_info.run_name[run_number] 
    6363 
     64        import pdb; pdb.set_trace() 
     65 
    6466        f = h5py.File(filename, 'w') 
    6567        sasentry = f.create_group('sasentry01') 
     
    9092            if getattr(data_info.sample, key) is not None: 
    9193                sample_entry.create_dataset(key, 
    92                     data=np.array([getattr(data_info.sample, key)])) 
     94                    data=_h5_float(getattr(data_info.sample, key))) 
    9395 
    9496        instrument_entry = sasentry.create_group('sasinstrument') 
     
    183185        I = np.reshape(data.data, (n_rows, n_cols)) 
    184186        dI = np.zeros((n_rows, n_cols)) 
    185         # import pdb; pdb.set_trace() 
    186187        if not all(data.err_data == [None]): 
    187188            dI = np.reshape(data.err_data, (n_rows, n_cols)) 
    188189        qx =  np.reshape(data.qx_data, (n_rows, n_cols)) 
    189190        qy = np.reshape(data.qy_data, (n_rows, n_cols)) 
     191 
    190192        I_entry = data_entry.create_dataset('I', data=I) 
    191193        I_entry.attrs['units'] = data.I_unit 
Note: See TracChangeset for help on using the changeset viewer.