Changeset 8698a0d in sasmodels for sasmodels/modelinfo.py
- Timestamp:
- Oct 17, 2017 9:53:01 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:
- 32f87a5
- Parents:
- becded3
- git-author:
- Paul Kienzle <pkienzle@…> (10/17/17 16:23:09)
- git-committer:
- Paul Kienzle <pkienzle@…> (10/17/17 21:53:01)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
ra85a569 r8698a0d 382 382 with vector parameter p sent as p[]. 383 383 384 * *iqxy_parameters* is the list of parameters to the Iqxy(qx, qy, ...)384 * [removed] *iqxy_parameters* is the list of parameters to the Iqxy(qx, qy, ...) 385 385 function, with vector parameter p sent as p[]. 386 386 … … 420 420 # type: (List[Parameter]) -> None 421 421 self.kernel_parameters = parameters 422 self._check_angles() 422 423 self._set_vector_lengths() 423 424 … … 438 439 self.iq_parameters = [p for p in self.kernel_parameters 439 440 if p.type not in ('orientation', 'magnetic')] 440 self.iqxy_parameters = [p for p in self.kernel_parameters 441 if p.type != 'magnetic'] 441 # note: orientation no longer sent to Iqxy, so its the same as 442 #self.iqxy_parameters = [p for p in self.kernel_parameters 443 # if p.type != 'magnetic'] 442 444 self.form_volume_parameters = [p for p in self.kernel_parameters 443 445 if p.type == 'volume'] … … 461 463 self.has_2d = any(p.type in ('orientation', 'magnetic') 462 464 for p in self.kernel_parameters) 465 self.is_asymmetric = any(p.name == 'psi' for p in self.kernel_parameters) 463 466 self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 464 467 if p.id.startswith('M0:')] … … 467 470 if p.polydisperse and p.type not in ('orientation', 'magnetic')) 468 471 self.pd_2d = set(p.name for p in self.call_parameters if p.polydisperse) 472 473 def _check_angles(self): 474 theta = phi = psi = -1 475 for k, p in enumerate(self.kernel_parameters): 476 if p.name == 'theta': 477 theta = k 478 if p.type != 'orientation': 479 raise TypeError("theta must be an orientation parameter") 480 elif p.name == 'phi': 481 phi = k 482 if p.type != 'orientation': 483 raise TypeError("phi must be an orientation parameter") 484 elif p.name == 'psi': 485 psi = k 486 if p.type != 'orientation': 487 raise TypeError("psi must be an orientation parameter") 488 if theta >= 0 and phi >= 0: 489 if phi != theta+1: 490 raise TypeError("phi must follow theta") 491 if psi >= 0 and psi != phi+1: 492 raise TypeError("psi must follow phi") 493 elif theta >= 0 or phi >= 0 or psi >= 0: 494 raise TypeError("oriented shapes must have both theta and phi and maybe psi") 469 495 470 496 def __getitem__(self, key):
Note: See TracChangeset
for help on using the changeset viewer.