Changeset 59e537a in sasmodels for explore/jitter.py
- Timestamp:
- Oct 23, 2017 12:40:45 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 36b3154
- Parents:
- 34823bc
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
explore/jitter.py
raa6989b r59e537a 386 386 return calculator 387 387 388 def select_calculator(model_name, n=150 ):388 def select_calculator(model_name, n=150, size=(10,40,100)): 389 389 """ 390 390 Create a model calculator for the given shape. … … 399 399 for details on the returned calculator. 400 400 """ 401 a, b, c = 10, 40, 100401 a, b, c = size 402 402 if model_name == 'sphere': 403 403 calculator = build_model('sphere', n=n, radius=c) … … 426 426 return calculator, (a, b, c) 427 427 428 def main(model_name='parallelepiped' ):428 def main(model_name='parallelepiped', size=(10, 40, 100)): 429 429 """ 430 430 Show an interactive orientation and jitter demo. … … 433 433 """ 434 434 # set up calculator 435 calculator, size = select_calculator(model_name, n=150 )435 calculator, size = select_calculator(model_name, n=150, size=size) 436 436 437 437 ## uncomment to set an independent the colour range for every view … … 512 512 if __name__ == "__main__": 513 513 model_name = sys.argv[1] if len(sys.argv) > 1 else 'parallelepiped' 514 main(model_name) 514 size = tuple(int(v) for v in sys.argv[2].split(',')) if len(sys.argv) > 2 else (10, 40, 100) 515 main(model_name, size)
Note: See TracChangeset
for help on using the changeset viewer.