Changeset 857cc58 in sasview for src/sas/sascalc


Ignore:
Timestamp:
Apr 6, 2017 9:15:56 AM (8 years ago)
Author:
Adam Washington <adam.washington@…>
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.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, 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.