Changeset 857cc58 in sasview


Ignore:
Timestamp:
Apr 6, 2017 9:15:56 AM (7 months ago)
Author:
Adam Washington <adam.washington@…>
Branches:
master, ESS_GUI, ESS_GUI_SasView245, costrafo411, py3, ticket-853-fit-gui-to-calc, ticket-869, ticket-887-reorg, ticket-915, ticket-947-sasmodels-docs, ticket-976, unittest-saveload
Children:
cc47336
Parents:
8e0dcac
Message:

Fix unit conversion in sesans reader

File:
1 edited

Legend:

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

    r8e0dcac r857cc58  
    108108            output.sample.name = params["Sample"] 
    109109            output.sample.ID = params["DataFileTitle"] 
    110             output.sample.thickness = float( 
    111                 self._unit_conversion( 
    112                     params["Thickness"], "cm", self._unit_fetch("Thickness"))[0]) 
     110            output.sample.thickness = self._unit_conversion( 
     111                float(params["Thickness"]), "cm", 
     112                self._unit_fetch("Thickness"))[0] 
    113113 
    114114            output.sample.zacceptance = ( 
     
    133133        # (float, string, string) -> float 
    134134        if has_converter and value_unit != default_unit: 
    135             data_conv_q = Converter(value_unit) 
    136             value = data_conv_q(value, units=default_unit) 
     135            data_conv_q = Converter(default_unit) 
     136            value = data_conv_q(value, units=value_unit) 
    137137            new_unit = default_unit 
    138138        else: 
Note: See TracChangeset for help on using the changeset viewer.