Changeset 3689302 in sasview for src/sas/sascalc/dataloader


Ignore:
Timestamp:
Mar 19, 2016 4:59:40 AM (8 years ago)
Author:
krzywon
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, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
05fb3d6b
Parents:
34e0c32
Message:

Move the unit conversion from the script to the data reader

File:
1 edited

Legend:

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

    r26d4864 r3689302  
    178178                output.sample.name = paramvals[1] 
    179179                output.sample.ID = paramvals[0] 
     180                zaccept_unit_split = paramnames[7].split("[") 
     181                zaccept_unit = zaccept_unit_split[1].replace("]","") 
     182                if zaccept_unit.strip() == '\AA^-1': 
     183                    zaccept_unit = "1/A" 
    180184                output.sample.zacceptance=float(paramvals[7]) 
     185                output.sample.zacceptance=self._unit_conversion(output.sample.zacceptance, 
     186                                                                zaccept_unit, "1/" + default_z_unit) 
    181187                output.vars=varheader 
    182188 
Note: See TracChangeset for help on using the changeset viewer.