Changeset 35b4c47 in sasmodels
- Timestamp:
- Mar 15, 2016 5:25:08 PM (9 years ago)
- 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:
- 667a6f2
- Parents:
- 754e27b
- Location:
- sasmodels
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
r17bbadd r35b4c47 366 366 composition_type, parts = model_info['composition'] 367 367 if composition_type == 'product': 368 from sas.models import MultiplicationModel368 from sas.models.MultiplicationModel import MultiplicationModel 369 369 P, S = [get_model(p) for p in model_info['oldname']] 370 370 model = MultiplicationModel(P, S) -
sasmodels/product.py
r17bbadd r35b4c47 100 100 num_p_pd = len(p_info['pd-2d']) 101 101 num_s_fixed = len(s_info['fixed-2d']) 102 num_s_pd = len(s_info['pd-2d']) 102 num_s_pd = len(s_info['pd-2d']) - 1 # exclude effect_radius 103 103 # volume parameters are amongst the pd pars for P, not S 104 104 vol_par_idx = [k for k,v in enumerate(p_info['pd-2d']) … … 108 108 num_p_pd = len(p_info['pd-1d']) 109 109 num_s_fixed = len(s_info['fixed-1d']) 110 num_s_pd = len(s_info['pd-1d']) 110 num_s_pd = len(s_info['pd-1d']) - 1 # exclude effect_radius 111 111 # volume parameters are amongst the pd pars for P, not S 112 112 vol_par_idx = [k for k,v in enumerate(p_info['pd-1d']) … … 118 118 # so borrow values from end of p_fixed. This makes volfraction the 119 119 # first S parameter. 120 start += num_p_fixed - 3120 start += num_p_fixed - 2 121 121 par_map['s_fixed'] = np.arange(start, start+num_s_fixed) 122 122 par_map['volfraction'] = num_p_fixed … … 126 126 par_map['p_pd'] = np.arange(start, start+num_p_pd) 127 127 start += num_p_pd 128 par_map['s_pd'] = np.arange(start, start+num_s_pd) # should be empty... 129 128 par_map['s_pd'] = np.arange(start-1, start+num_s_pd) # should be empty... 130 129 131 130 self.fixed_pars = model_info['partype']['fixed-' + dim] … … 146 145 s_pd = [pars[k] for k in self.par_map['s_pd']] 147 146 vol_pars = [pars[k] for k in self.par_map['vol_pars']] 148 p_pars = dict(list(zip(self.fixed_pars, p_fixed))149 +list(zip(self.pd_pars, p_pd)))150 147 151 148 effect_radius, vol_ratio = call_ER_VR(self.p_kernel.info, vol_pars) … … 155 152 s_fixed[SCALE] = scale 156 153 s_fixed[BACKGROUND] = 0.0 157 s_fixed[ EFFECT_RADIUS] = effect_radius158 s_ fixed[VOLFRACTION] = s_volfraction/vol_ratio154 s_fixed[2] = s_volfraction/vol_ratio 155 s_pd[0] = [effect_radius], [1.0] 159 156 160 157 p_res = self.p_kernel(p_fixed, p_pd) 161 158 s_res = self.s_kernel(s_fixed, s_pd) 159 #print s_fixed, s_pd, p_fixed, p_pd 162 160 163 161 return p_res*s_res + background
Note: See TracChangeset
for help on using the changeset viewer.