Changeset be43e39 in sasmodels for sasmodels/modelinfo.py


Ignore:
Timestamp:
Oct 19, 2018 5:49:12 PM (6 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
31fc4ad
Parents:
e44432d (diff), 353e899 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into beta_approx

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    re44432d rbe43e39  
    463463        self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 
    464464        self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 
    465                                 if p.id.startswith('M0:')] 
     465                                if p.id.endswith('_M0')] 
     466 
    466467        self.pd_1d = set(p.name for p in self.call_parameters 
    467468                         if p.polydisperse and p.type not in ('orientation', 'magnetic')) 
     
    582583        if self.nmagnetic > 0: 
    583584            full_list.extend([ 
    584                 Parameter('up:frac_i', '', 0., [0., 1.], 
     585                Parameter('up_frac_i', '', 0., [0., 1.], 
    585586                          'magnetic', 'fraction of spin up incident'), 
    586                 Parameter('up:frac_f', '', 0., [0., 1.], 
     587                Parameter('up_frac_f', '', 0., [0., 1.], 
    587588                          'magnetic', 'fraction of spin up final'), 
    588                 Parameter('up:angle', 'degrees', 0., [0., 360.], 
     589                Parameter('up_angle', 'degrees', 0., [0., 360.], 
    589590                          'magnetic', 'spin up angle'), 
    590591            ]) 
     
    592593            for p in slds: 
    593594                full_list.extend([ 
    594                     Parameter('M0:'+p.id, '1e-6/Ang^2', 0., [-np.inf, np.inf], 
     595                    Parameter(p.id+'_M0', '1e-6/Ang^2', 0., [-np.inf, np.inf], 
    595596                              'magnetic', 'magnetic amplitude for '+p.description), 
    596                     Parameter('mtheta:'+p.id, 'degrees', 0., [-90., 90.], 
     597                    Parameter(p.id+'_mtheta', 'degrees', 0., [-90., 90.], 
    597598                              'magnetic', 'magnetic latitude for '+p.description), 
    598                     Parameter('mphi:'+p.id, 'degrees', 0., [-180., 180.], 
     599                    Parameter(p.id+'_mphi', 'degrees', 0., [-180., 180.], 
    599600                              'magnetic', 'magnetic longitude for '+p.description), 
    600601                ]) 
     
    636637 
    637638        Parameters marked as sld will automatically have a set of associated 
    638         magnetic parameters (m0:p, mtheta:p, mphi:p), as well as polarization 
    639         information (up:theta, up:frac_i, up:frac_f). 
     639        magnetic parameters (p_M0, p_mtheta, p_mphi), as well as polarization 
     640        information (up_theta, up_frac_i, up_frac_f). 
    640641        """ 
    641642        # control parameters go first 
     
    664665            result.append(expanded_pars[name]) 
    665666            if is2d: 
    666                 for tag in 'M0:', 'mtheta:', 'mphi:': 
    667                     if tag+name in expanded_pars: 
    668                         result.append(expanded_pars[tag+name]) 
     667                for tag in '_M0', '_mtheta', '_mphi': 
     668                    if name+tag in expanded_pars: 
     669                        result.append(expanded_pars[name+tag]) 
    669670 
    670671        # Gather the user parameters in order 
     
    699700                append_group(p.id) 
    700701 
    701         if is2d and 'up:angle' in expanded_pars: 
     702        if is2d and 'up_angle' in expanded_pars: 
    702703            result.extend([ 
    703                 expanded_pars['up:frac_i'], 
    704                 expanded_pars['up:frac_f'], 
    705                 expanded_pars['up:angle'], 
     704                expanded_pars['up_frac_i'], 
     705                expanded_pars['up_frac_f'], 
     706                expanded_pars['up_angle'], 
    706707            ]) 
    707708 
     
    10231024                         for k in range(control+1, p.length+1) 
    10241025                         if p.length > 1) 
     1026            for p in self.parameters.kernel_parameters: 
     1027                if p.length > 1 and p.type == "sld": 
     1028                    for k in range(control+1, p.length+1): 
     1029                        base = p.id+str(k) 
     1030                        hidden.update((base+"_M0", base+"_mtheta", base+"_mphi")) 
    10251031        return hidden 
Note: See TracChangeset for help on using the changeset viewer.