Changeset 59e537a in sasmodels


Ignore:
Timestamp:
Oct 23, 2017 12:40:45 PM (5 years ago)
Author:
Paul Kienzle <pkienzle@…>
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
Message:

add size a,b,c to explore/jitter.py command line options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explore/jitter.py

    raa6989b r59e537a  
    386386    return calculator 
    387387 
    388 def select_calculator(model_name, n=150): 
     388def select_calculator(model_name, n=150, size=(10,40,100)): 
    389389    """ 
    390390    Create a model calculator for the given shape. 
     
    399399    for details on the returned calculator. 
    400400    """ 
    401     a, b, c = 10, 40, 100 
     401    a, b, c = size 
    402402    if model_name == 'sphere': 
    403403        calculator = build_model('sphere', n=n, radius=c) 
     
    426426    return calculator, (a, b, c) 
    427427 
    428 def main(model_name='parallelepiped'): 
     428def main(model_name='parallelepiped', size=(10, 40, 100)): 
    429429    """ 
    430430    Show an interactive orientation and jitter demo. 
     
    433433    """ 
    434434    # set up calculator 
    435     calculator, size = select_calculator(model_name, n=150) 
     435    calculator, size = select_calculator(model_name, n=150, size=size) 
    436436 
    437437    ## uncomment to set an independent the colour range for every view 
     
    512512if __name__ == "__main__": 
    513513    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.