Changeset fa79f5c in sasmodels for example/sesansfit.py
- Timestamp:
- Nov 29, 2017 8:43:12 AM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- a839b22
- Parents:
- 32398dc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
example/sesansfit.py
r9217ef8 rfa79f5c 1 import logging 2 1 3 from bumps.names import * 2 4 from sasmodels import core, bumps_model, sesans … … 8 10 return model 9 11 10 def sesans_fit(file, model, initial_vals={}, custom_params={}, param_range=[], acceptance_angle=None): 12 def sesans_fit(file, model, initial_vals={}, custom_params={}, param_range=[], 13 acceptance_angle=None): 11 14 """ 12 15 … … 19 22 @return: FitProblem for Bumps usage 20 23 """ 24 logging.basicConfig() 25 21 26 initial_vals['background'] = 0.0 22 27 try: 23 28 loader = Loader() 24 data = loader.load(file) 25 if data is None: raise IOError("Could not load file %r"%(file)) 29 data = loader.load(file)[0] 30 if data is None: 31 raise IOError("Could not load file %r"%(file)) 26 32 27 except: 33 except Exception: 34 raise 28 35 # If no loadable data file, generate random data 29 36 SElength = np.linspace(0, 2400, 61) # [A] … … 50 57 data.Rmax = 30*radius # [A] 51 58 52 if isinstance(model, basestring):59 if isinstance(model, str): 53 60 model = get_bumps_model(model) 54 61
Note: See TracChangeset
for help on using the changeset viewer.