Changeset be43e39 in sasmodels for sasmodels/modelinfo.py
- Timestamp:
- Oct 19, 2018 5:49:12 PM (6 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
re44432d rbe43e39 463 463 self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 464 464 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 466 467 self.pd_1d = set(p.name for p in self.call_parameters 467 468 if p.polydisperse and p.type not in ('orientation', 'magnetic')) … … 582 583 if self.nmagnetic > 0: 583 584 full_list.extend([ 584 Parameter('up :frac_i', '', 0., [0., 1.],585 Parameter('up_frac_i', '', 0., [0., 1.], 585 586 'magnetic', 'fraction of spin up incident'), 586 Parameter('up :frac_f', '', 0., [0., 1.],587 Parameter('up_frac_f', '', 0., [0., 1.], 587 588 'magnetic', 'fraction of spin up final'), 588 Parameter('up :angle', 'degrees', 0., [0., 360.],589 Parameter('up_angle', 'degrees', 0., [0., 360.], 589 590 'magnetic', 'spin up angle'), 590 591 ]) … … 592 593 for p in slds: 593 594 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], 595 596 'magnetic', 'magnetic amplitude for '+p.description), 596 Parameter( 'mtheta:'+p.id, 'degrees', 0., [-90., 90.],597 Parameter(p.id+'_mtheta', 'degrees', 0., [-90., 90.], 597 598 'magnetic', 'magnetic latitude for '+p.description), 598 Parameter( 'mphi:'+p.id, 'degrees', 0., [-180., 180.],599 Parameter(p.id+'_mphi', 'degrees', 0., [-180., 180.], 599 600 'magnetic', 'magnetic longitude for '+p.description), 600 601 ]) … … 636 637 637 638 Parameters marked as sld will automatically have a set of associated 638 magnetic parameters ( m0:p, mtheta:p, mphi:p), as well as polarization639 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). 640 641 """ 641 642 # control parameters go first … … 664 665 result.append(expanded_pars[name]) 665 666 if is2d: 666 for tag in ' M0:', 'mtheta:', 'mphi:':667 if tag+namein 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]) 669 670 670 671 # Gather the user parameters in order … … 699 700 append_group(p.id) 700 701 701 if is2d and 'up :angle' in expanded_pars:702 if is2d and 'up_angle' in expanded_pars: 702 703 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'], 706 707 ]) 707 708 … … 1023 1024 for k in range(control+1, p.length+1) 1024 1025 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")) 1025 1031 return hidden
Note: See TracChangeset
for help on using the changeset viewer.