Changeset d5ba841 in sasmodels


Ignore:
Timestamp:
Mar 18, 2016 9:00:13 AM (9 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
5852c86
Parents:
7c391dd
Message:

product model now works with sphere

Location:
sasmodels
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/core.py

    r02e70ff rd5ba841  
    170170    """ 
    171171    value, weight = zip(*pars) 
    172     if len(value) > 1: 
    173         value = [v.flatten() for v in np.meshgrid(*value)] 
    174         weight = np.vstack([v.flatten() for v in np.meshgrid(*weight)]) 
    175         weight = np.prod(weight, axis=0) 
     172    value = [v.flatten() for v in np.meshgrid(*value)] 
     173    weight = np.vstack([v.flatten() for v in np.meshgrid(*weight)]) 
     174    weight = np.prod(weight, axis=0) 
    176175    return value, weight 
    177176 
  • sasmodels/product.py

    r3bcd03d rd5ba841  
    124124        # so borrow values from end of p_fixed.  This makes volfraction the 
    125125        # first S parameter. 
    126         start += num_p_fixed - 2 
    127         par_map['s_fixed'] = np.arange(start, start+num_s_fixed) 
     126        start += num_p_fixed 
     127        par_map['s_fixed'] = np.hstack(([start,start], 
     128                                        np.arange(start, start+num_s_fixed-2))) 
    128129        par_map['volfraction'] = num_p_fixed 
    129         start += num_s_fixed 
     130        start += num_s_fixed-2 
    130131        # vol pars offset from the start of pd pars 
    131132        par_map['vol_pars'] = [start+k for k in vol_par_idx] 
    132133        par_map['p_pd'] = np.arange(start, start+num_p_pd) 
    133         start += num_p_pd 
    134         par_map['s_pd'] = np.arange(start-1, start+num_s_pd)  # should be empty... 
     134        start += num_p_pd-1 
     135        par_map['s_pd'] = np.hstack((start, 
     136                                     np.arange(start, start+num_s_pd-1))) 
    135137 
    136138        self.fixed_pars = model_info['partype']['fixed-' + dim] 
Note: See TracChangeset for help on using the changeset viewer.