Changeset 17695aa in sasmodels for sasmodels/modelinfo.py
- Timestamp:
- Oct 30, 2018 8:59:40 AM (5 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
r6da1d76 r17695aa 473 473 self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 474 474 self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 475 if p.id. startswith('M0:')]475 if p.id.endswith('_M0')] 476 476 477 477 self.pd_1d = set(p.name for p in self.call_parameters … … 604 604 if self.nmagnetic > 0: 605 605 full_list.extend([ 606 Parameter('up :frac_i', '', 0., [0., 1.],606 Parameter('up_frac_i', '', 0., [0., 1.], 607 607 'magnetic', 'fraction of spin up incident'), 608 Parameter('up :frac_f', '', 0., [0., 1.],608 Parameter('up_frac_f', '', 0., [0., 1.], 609 609 'magnetic', 'fraction of spin up final'), 610 Parameter('up :angle', 'degrees', 0., [0., 360.],610 Parameter('up_angle', 'degrees', 0., [0., 360.], 611 611 'magnetic', 'spin up angle'), 612 612 ]) … … 614 614 for p in slds: 615 615 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], 617 617 'magnetic', 'magnetic amplitude for '+p.description), 618 Parameter( 'mtheta:'+p.id, 'degrees', 0., [-90., 90.],618 Parameter(p.id+'_mtheta', 'degrees', 0., [-90., 90.], 619 619 'magnetic', 'magnetic latitude for '+p.description), 620 Parameter( 'mphi:'+p.id, 'degrees', 0., [-180., 180.],620 Parameter(p.id+'_mphi', 'degrees', 0., [-180., 180.], 621 621 'magnetic', 'magnetic longitude for '+p.description), 622 622 ]) … … 658 658 659 659 Parameters marked as sld will automatically have a set of associated 660 magnetic parameters ( m0:p, mtheta:p, mphi:p), as well as polarization661 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). 662 662 """ 663 663 # control parameters go first … … 686 686 result.append(expanded_pars[name]) 687 687 if is2d: 688 for tag in ' M0:', 'mtheta:', 'mphi:':689 if tag+namein 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]) 691 691 692 692 # Gather the user parameters in order … … 721 721 append_group(p.id) 722 722 723 if is2d and 'up :angle' in expanded_pars:723 if is2d and 'up_angle' in expanded_pars: 724 724 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'], 728 728 ]) 729 729 … … 1047 1047 for k in range(control+1, p.length+1) 1048 1048 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")) 1049 1054 return hidden
Note: See TracChangeset
for help on using the changeset viewer.