Changeset 89ab393 in sasmodels


Ignore:
Timestamp:
Mar 18, 2016 12:05:57 PM (9 years ago)
Author:
krzywon
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
c1c37d5
Parents:
9538fae
Message:

Moving unit conversion to sesans_reader instead of script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • example/sesansfit.py

    r170ea69 r89ab393  
    22from sasmodels import core, bumps_model, sesans 
    33from sas.sascalc.dataloader.loader import Loader 
    4  
    5 HAS_CONVERTER = True 
    6 try: 
    7     from sas.sascalc.data_util.nxsunit import Converter 
    8 except ImportError: 
    9     HAS_CONVERTER = False 
    10  
    114 
    125def get_bumps_model(model_name): 
     
    3023        data = loader.load(file) 
    3124        if data is None: raise IOError("Could not load file %r"%(file)) 
    32         if HAS_CONVERTER == True: 
    33             default_unit = "A" 
    34             data_conv_q = Converter(data._xunit) 
    35             for x in data.x: 
    36                 print x 
    37             data.x = data_conv_q(data.x, units=default_unit) 
    38             for x in data.x: 
    39                 print x 
    40             data._xunit = default_unit 
    4125 
    4226    except: 
Note: See TracChangeset for help on using the changeset viewer.