Changeset 17695aa in sasmodels for sasmodels/modelinfo.py


Ignore:
Timestamp:
Oct 30, 2018 8:59:40 AM (5 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:
c1799d3
Parents:
6da1d76 (diff), c6084f1 (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 ticket-1157

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    r6da1d76 r17695aa  
    473473        self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 
    474474        self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 
    475                                 if p.id.startswith('M0:')] 
     475                                if p.id.endswith('_M0')] 
    476476 
    477477        self.pd_1d = set(p.name for p in self.call_parameters 
     
    604604        if self.nmagnetic > 0: 
    605605            full_list.extend([ 
    606                 Parameter('up:frac_i', '', 0., [0., 1.], 
     606                Parameter('up_frac_i', '', 0., [0., 1.], 
    607607                          'magnetic', 'fraction of spin up incident'), 
    608                 Parameter('up:frac_f', '', 0., [0., 1.], 
     608                Parameter('up_frac_f', '', 0., [0., 1.], 
    609609                          'magnetic', 'fraction of spin up final'), 
    610                 Parameter('up:angle', 'degrees', 0., [0., 360.], 
     610                Parameter('up_angle', 'degrees', 0., [0., 360.], 
    611611                          'magnetic', 'spin up angle'), 
    612612            ]) 
     
    614614            for p in slds: 
    615615                full_list.extend([ 
    616                     Parameter('M0:'+p.id, '1e-6/Ang^2', 0., [-np.inf, np.inf], 
     616                    Parameter(p.id+'_M0', '1e-6/Ang^2', 0., [-np.inf, np.inf], 
    617617                              'magnetic', 'magnetic amplitude for '+p.description), 
    618                     Parameter('mtheta:'+p.id, 'degrees', 0., [-90., 90.], 
     618                    Parameter(p.id+'_mtheta', 'degrees', 0., [-90., 90.], 
    619619                              'magnetic', 'magnetic latitude for '+p.description), 
    620                     Parameter('mphi:'+p.id, 'degrees', 0., [-180., 180.], 
     620                    Parameter(p.id+'_mphi', 'degrees', 0., [-180., 180.], 
    621621                              'magnetic', 'magnetic longitude for '+p.description), 
    622622                ]) 
     
    658658 
    659659        Parameters marked as sld will automatically have a set of associated 
    660         magnetic parameters (m0:p, mtheta:p, mphi:p), as well as polarization 
    661         information (up:theta, up:frac_i, up:frac_f). 
     660        magnetic parameters (p_M0, p_mtheta, p_mphi), as well as polarization 
     661        information (up_theta, up_frac_i, up_frac_f). 
    662662        """ 
    663663        # control parameters go first 
     
    686686            result.append(expanded_pars[name]) 
    687687            if is2d: 
    688                 for tag in 'M0:', 'mtheta:', 'mphi:': 
    689                     if tag+name in expanded_pars: 
    690                         result.append(expanded_pars[tag+name]) 
     688                for tag in '_M0', '_mtheta', '_mphi': 
     689                    if name+tag in expanded_pars: 
     690                        result.append(expanded_pars[name+tag]) 
    691691 
    692692        # Gather the user parameters in order 
     
    721721                append_group(p.id) 
    722722 
    723         if is2d and 'up:angle' in expanded_pars: 
     723        if is2d and 'up_angle' in expanded_pars: 
    724724            result.extend([ 
    725                 expanded_pars['up:frac_i'], 
    726                 expanded_pars['up:frac_f'], 
    727                 expanded_pars['up:angle'], 
     725                expanded_pars['up_frac_i'], 
     726                expanded_pars['up_frac_f'], 
     727                expanded_pars['up_angle'], 
    728728            ]) 
    729729 
     
    10471047                         for k in range(control+1, p.length+1) 
    10481048                         if p.length > 1) 
     1049            for p in self.parameters.kernel_parameters: 
     1050                if p.length > 1 and p.type == "sld": 
     1051                    for k in range(control+1, p.length+1): 
     1052                        base = p.id+str(k) 
     1053                        hidden.update((base+"_M0", base+"_mtheta", base+"_mphi")) 
    10491054        return hidden 
Note: See TracChangeset for help on using the changeset viewer.