Changeset 8e0dcac in sasview


Ignore:
Timestamp:
Apr 6, 2017 9:13:06 AM (8 months ago)
Author:
Adam Washington <adam.washington@…>
Branches:
master, ESS_GUI, ESS_GUI_CategroyManager, ESS_GUI_Pr, ESS_GUI_cns, ESS_GUI_corf, ESS_GUI_py2_OLD, SVCC-1, SasView-664, costrafo411, docs, ticket-873, ticket-976, ticket-993, unittest-saveload
Children:
857cc58
Parents:
d01b55c
Message:

Handle missing columns in .ses format

The uncertainties on spin echo length and lambda aren't strictly
required, so we should handle files that do not have them. SasView?
seems to be unhappy with an uncertainty of zero, so we've put in a
small default value. If the user isn't happy with the default value,
then they should have measured the real one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sascalc/dataloader/readers/sesans_reader.py

    r0ac6e11 r8e0dcac  
    7171                raise RuntimeError("{} is empty".format(path)) 
    7272            x = data[:, headers.index("SpinEchoLength")] 
    73             dx = data[:, headers.index("SpinEchoLength_error")] 
     73            if "SpinEchoLength_error" in headers: 
     74                dx = data[:, headers.index("SpinEchoLength_error")] 
     75            else: 
     76                dx = x*0.05 
    7477            lam = data[:, headers.index("Wavelength")] 
    75             dlam = data[:, headers.index("Wavelength_error")] 
     78            if "Wavelength_error" in headers: 
     79                dlam = data[:, headers.index("Wavelength_error")] 
     80            else: 
     81                dlam = lam*0.05 
    7682            y = data[:, headers.index("Depolarisation")] 
    7783            dy = data[:, headers.index("Depolarisation_error")] 
Note: See TracChangeset for help on using the changeset viewer.