Changes in sasmodels/compare.py [5753e4e:e1ace4d] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
r5753e4e re1ace4d 130 130 if name == 'capped_cylinder' and pars['cap_radius'] < pars['radius']: 131 131 pars['radius'],pars['cap_radius'] = pars['cap_radius'],pars['radius'] 132 if name == 'barbell' and pars['bell_radius'] < pars['radius']: 133 pars['radius'],pars['bell_radius'] = pars['bell_radius'],pars['radius'] 134 135 # Limit guinier to an Rg such that Iq > 1e-30 (single precision cutoff) 136 if name == 'guinier': 137 #q_max = 0.2 # mid q maximum 138 q_max = 1.0 # high q maximum 139 rg_max = np.sqrt(90*np.log(10) + 3*np.log(pars['scale']))/q_max 140 pars['rg'] = min(pars['rg'],rg_max) 132 141 133 142 # These constraints are only needed for comparison to sasview … … 224 233 model_definition = core.load_model_definition(name) 225 234 226 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') 227 239 228 240 opt_values = dict(split … … 230 242 if len(split) == 2) 231 243 # Sort out data 232 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) 233 248 Nq = int(opt_values.get('-Nq', '128')) 234 249 res = float(opt_values.get('-res', '0')) … … 239 254 240 255 # modelling accuracy is determined by dtype and cutoff 241 dtype = 'double' if '-double' in opts else 'single' 256 dtype = ('longdouble' if '-quad' in opts 257 else 'double' if '-double' in opts 258 else 'single') 242 259 cutoff = float(opt_values.get('-cutoff','1e-5')) 243 260 … … 247 264 seed = int(opt_values['-random']) if '-random' in opt_values else None 248 265 pars, seed = randomize_model(pars, seed=seed) 249 constrain_pars(model_definition, pars)250 266 print "Randomize using -random=%i"%seed 251 267 pars.update(set_pars) # set value after random to control value 268 constrain_pars(model_definition, pars) 252 269 253 270 # parameter selection … … 362 379 363 380 -plot*/-noplot plots or suppress the plot of the model 364 -single*/-double uses doubleprecision for comparison381 -single*/-double/-quad use single/double/quad precision for comparison 365 382 -lowq*/-midq/-highq/-exq use q values up to 0.05, 0.2, 1.0, 10.0 366 383 -Nq=128 sets the number of Q points in the data set … … 386 403 NAME_OPTIONS = set([ 387 404 'plot','noplot', 388 'single','double', 405 'single','double','longdouble', 389 406 'lowq','midq','highq','exq', 390 407 '2d','1d',
Note: See TracChangeset
for help on using the changeset viewer.