Changeset 610ef23 in sasmodels for sasmodels/modelinfo.py
- Timestamp:
- Oct 3, 2018 12:07:52 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:
- e39202b, bd547d0
- Parents:
- a1ec908
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
rd321747 r610ef23 466 466 self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 467 467 self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 468 if p.id. startswith('M0:')]468 if p.id.endswith('_M0')] 469 469 470 470 self.pd_1d = set(p.name for p in self.call_parameters … … 586 586 if self.nmagnetic > 0: 587 587 full_list.extend([ 588 Parameter('up :frac_i', '', 0., [0., 1.],588 Parameter('up_frac_i', '', 0., [0., 1.], 589 589 'magnetic', 'fraction of spin up incident'), 590 Parameter('up :frac_f', '', 0., [0., 1.],590 Parameter('up_frac_f', '', 0., [0., 1.], 591 591 'magnetic', 'fraction of spin up final'), 592 Parameter('up :angle', 'degrees', 0., [0., 360.],592 Parameter('up_angle', 'degrees', 0., [0., 360.], 593 593 'magnetic', 'spin up angle'), 594 594 ]) … … 596 596 for p in slds: 597 597 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], 599 599 'magnetic', 'magnetic amplitude for '+p.description), 600 Parameter( 'mtheta:'+p.id, 'degrees', 0., [-90., 90.],600 Parameter(p.id+'_mtheta', 'degrees', 0., [-90., 90.], 601 601 'magnetic', 'magnetic latitude for '+p.description), 602 Parameter( 'mphi:'+p.id, 'degrees', 0., [-180., 180.],602 Parameter(p.id+'_mphi', 'degrees', 0., [-180., 180.], 603 603 'magnetic', 'magnetic longitude for '+p.description), 604 604 ]) … … 640 640 641 641 Parameters marked as sld will automatically have a set of associated 642 magnetic parameters ( m0:p, mtheta:p, mphi:p), as well as polarization643 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). 644 644 """ 645 645 # control parameters go first … … 668 668 result.append(expanded_pars[name]) 669 669 if is2d: 670 for tag in ' M0:', 'mtheta:', 'mphi:':671 if tag+namein 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]) 673 673 674 674 # Gather the user parameters in order … … 703 703 append_group(p.id) 704 704 705 if is2d and 'up :angle' in expanded_pars:705 if is2d and 'up_angle' in expanded_pars: 706 706 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'], 710 710 ]) 711 711
Note: See TracChangeset
for help on using the changeset viewer.