Changeset 0535624 in sasmodels for sasmodels/modelinfo.py
- Timestamp:
- Sep 27, 2018 9:53:30 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:
- 6da1d76
- Parents:
- 293fee5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
r1e420e6 r0535624 478 478 if p.polydisperse and p.type not in ('orientation', 'magnetic')) 479 479 self.pd_2d = set(p.name for p in self.call_parameters if p.polydisperse) 480 481 def set_zero_background(self): 482 """ 483 Set the default background to zero for this model. This is done for 484 structure factor models. 485 """ 486 # type: () -> None 487 # Make sure background is the second common parameter. 488 assert self.common_parameters[1].id == "background" 489 self.common_parameters[1].default = 0.0 490 self.defaults = self._get_defaults() 480 491 481 492 def check_angles(self): … … 787 798 structure_factor = getattr(kernel_module, 'structure_factor', False) 788 799 if structure_factor: 789 # Make sure background is the second common parameter. 790 assert parameters.common_parameters[1].id == "background" 791 parameters.common_parameters[1].default = 0.0 800 parameters.set_zero_background() 792 801 793 802 # TODO: remove demo parameters
Note: See TracChangeset
for help on using the changeset viewer.