Changeset 5edfe12 in sasmodels for sasmodels/compare.py


Ignore:
Timestamp:
Nov 24, 2015 6:13:15 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
7f7f99f
Parents:
92da231
Message:

support long double kernels for precision limited models

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/compare.py

    rb514adf r5edfe12  
    233233    model_definition = core.load_model_definition(name) 
    234234 
    235     view = 'linear' if '-linear' in opts else 'log' if '-log' in opts else 'q4' if '-q4' in opts else 'log' 
     235    view = ('linear' if '-linear' in opts 
     236            else 'log' if '-log' in opts 
     237            else 'q4' if '-q4' in opts 
     238            else 'log') 
    236239 
    237240    opt_values = dict(split 
     
    239242                      if len(split) == 2) 
    240243    # Sort out data 
    241     qmax = 10.0 if '-exq' in opts else 1.0 if '-highq' in opts else 0.2 if '-midq' in opts else 0.05 
     244    qmax = (10.0 if '-exq' in opts 
     245            else 1.0 if '-highq' in opts 
     246            else 0.2 if '-midq' in opts 
     247            else 0.05) 
    242248    Nq = int(opt_values.get('-Nq', '128')) 
    243249    res = float(opt_values.get('-res', '0')) 
     
    248254 
    249255    # modelling accuracy is determined by dtype and cutoff 
    250     dtype = 'double' if '-double' in opts else 'single' 
     256    dtype = ('longdouble' if '-longdouble' in opts 
     257             else 'double' if '-double' in opts 
     258             else 'single') 
    251259    cutoff = float(opt_values.get('-cutoff','1e-5')) 
    252260 
     
    371379 
    372380    -plot*/-noplot plots or suppress the plot of the model 
    373     -single*/-double uses double precision for comparison 
     381    -single*/-double/-longdouble uses double precision for comparison 
    374382    -lowq*/-midq/-highq/-exq use q values up to 0.05, 0.2, 1.0, 10.0 
    375383    -Nq=128 sets the number of Q points in the data set 
     
    395403NAME_OPTIONS = set([ 
    396404    'plot','noplot', 
    397     'single','double', 
     405    'single','double','longdouble', 
    398406    'lowq','midq','highq','exq', 
    399407    '2d','1d', 
Note: See TracChangeset for help on using the changeset viewer.