Changeset a14fa99 in sasview


Ignore:
Timestamp:
Aug 19, 2016 7:21:33 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:
bec6cb8
Parents:
346d56e
Message:

Ensure Idev is set correctly on 1D data when writing to NXcanSAS

File:
1 edited

Legend:

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

    r346d56e ra14fa99  
    6161            if len(data_info.run_name) > 0: 
    6262                run_name = data_info.run_name[run_number] 
    63  
    64         import pdb; pdb.set_trace() 
    6563 
    6664        f = h5py.File(filename, 'w') 
     
    156154        data_entry.attrs['I_uncertainties'] = 'Idev' 
    157155        data_entry.attrs['Q_indicies'] = 0 
     156 
     157        dI = data_obj.dy 
     158        if dI is None: 
     159            dI = np.zeros((data_obj.y.shape)) 
     160 
    158161        data_entry.create_dataset('Q', data=data_obj.x) 
    159162        data_entry.create_dataset('I', data=data_obj.y) 
    160         data_entry.create_dataset('Idev', data=data_obj.dy) 
     163        data_entry.create_dataset('Idev', data=dI) 
    161164 
    162165    def _write_2d_data(self, data, data_entry): 
Note: See TracChangeset for help on using the changeset viewer.