Changes in sasmodels/modelinfo.py [d321747:bd547d0] in sasmodels


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/modelinfo.py

    rd321747 rbd547d0  
    466466        self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 
    467467        self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 
    468                                 if p.id.startswith('M0:')] 
     468                                if p.id.endswith('_M0')] 
    469469 
    470470        self.pd_1d = set(p.name for p in self.call_parameters 
     
    586586        if self.nmagnetic > 0: 
    587587            full_list.extend([ 
    588                 Parameter('up:frac_i', '', 0., [0., 1.], 
     588                Parameter('up_frac_i', '', 0., [0., 1.], 
    589589                          'magnetic', 'fraction of spin up incident'), 
    590                 Parameter('up:frac_f', '', 0., [0., 1.], 
     590                Parameter('up_frac_f', '', 0., [0., 1.], 
    591591                          'magnetic', 'fraction of spin up final'), 
    592                 Parameter('up:angle', 'degrees', 0., [0., 360.], 
     592                Parameter('up_angle', 'degrees', 0., [0., 360.], 
    593593                          'magnetic', 'spin up angle'), 
    594594            ]) 
     
    596596            for p in slds: 
    597597                full_list.extend([ 
    598                     Parameter('M0:'+p.id, '1e-6/Ang^2', 0., [-np.inf, np.inf], 
     598                    Parameter(p.id+'_M0', '1e-6/Ang^2', 0., [-np.inf, np.inf], 
    599599                              'magnetic', 'magnetic amplitude for '+p.description), 
    600                     Parameter('mtheta:'+p.id, 'degrees', 0., [-90., 90.], 
     600                    Parameter(p.id+'_mtheta', 'degrees', 0., [-90., 90.], 
    601601                              'magnetic', 'magnetic latitude for '+p.description), 
    602                     Parameter('mphi:'+p.id, 'degrees', 0., [-180., 180.], 
     602                    Parameter(p.id+'_mphi', 'degrees', 0., [-180., 180.], 
    603603                              'magnetic', 'magnetic longitude for '+p.description), 
    604604                ]) 
     
    640640 
    641641        Parameters marked as sld will automatically have a set of associated 
    642         magnetic parameters (m0:p, mtheta:p, mphi:p), as well as polarization 
    643         information (up:theta, up:frac_i, up:frac_f). 
     642        magnetic parameters (p_M0, p_mtheta, p_mphi), as well as polarization 
     643        information (up_theta, up_frac_i, up_frac_f). 
    644644        """ 
    645645        # control parameters go first 
     
    668668            result.append(expanded_pars[name]) 
    669669            if is2d: 
    670                 for tag in 'M0:', 'mtheta:', 'mphi:': 
    671                     if tag+name in expanded_pars: 
    672                         result.append(expanded_pars[tag+name]) 
     670                for tag in '_M0', '_mtheta', '_mphi': 
     671                    if name+tag in expanded_pars: 
     672                        result.append(expanded_pars[name+tag]) 
    673673 
    674674        # Gather the user parameters in order 
     
    703703                append_group(p.id) 
    704704 
    705         if is2d and 'up:angle' in expanded_pars: 
     705        if is2d and 'up_angle' in expanded_pars: 
    706706            result.extend([ 
    707                 expanded_pars['up:frac_i'], 
    708                 expanded_pars['up:frac_f'], 
    709                 expanded_pars['up:angle'], 
     707                expanded_pars['up_frac_i'], 
     708                expanded_pars['up_frac_f'], 
     709                expanded_pars['up_angle'], 
    710710            ]) 
    711711 
     
    10161016                         for k in range(control+1, p.length+1) 
    10171017                         if p.length > 1) 
     1018            for p in self.parameters.kernel_parameters: 
     1019                if p.length > 1 and p.type == "sld": 
     1020                    for k in range(control+1, p.length+1): 
     1021                        base = p.id+str(k) 
     1022                        hidden.update((base+"_M0", base+"_mtheta", base+"_mphi")) 
    10181023        return hidden 
Note: See TracChangeset for help on using the changeset viewer.