- Timestamp:
- Aug 7, 2018 5:14:59 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:
- 7b0abf8
- Parents:
- cdd676e (diff), 01c8d9e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent. - Location:
- explore/beta
- Files:
-
- 5 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
explore/beta/sasfit_compare.py
rcdd676e r502c7b8 3 3 import sys, os 4 4 BETA_DIR = os.path.dirname(os.path.realpath(__file__)) 5 SASMODELS_DIR = os.path.dirname(os.path.dirname(BETA_DIR)) 5 #SASMODELS_DIR = os.path.dirname(os.path.dirname(BETA_DIR)) 6 SASMODELS_DIR = r"C:\Source\sasmodels" 6 7 sys.path.insert(0, SASMODELS_DIR) 7 8 … … 61 62 calculator = DirectModel(data, model,cutoff=0) 62 63 calculator.pars = pars.copy() 63 calculator.pars.setdefault('background', 1e-3)64 calculator.pars.setdefault('background', 0) 64 65 return calculator 65 66 … … 231 232 # = F2/total_volume 232 233 IQD = F2/average_volume*1e-4*volfraction 234 F1 *= 1e-2 # Yun is using sld in 1/A^2, not 1e-6/A^2 235 F2 *= 1e-4 233 236 elif norm == 'yun': 234 237 F1 *= 1e-6 # Yun is using sld in 1/A^2, not 1e-6/A^2 … … 336 339 I = build_model(Pname+"@hardsphere", q) 337 340 Pq = P(**Ppars)*pars.get('volfraction', 1) 338 #Sq = S(**Spars)341 Sq = S(**Spars) 339 342 Iq = I(**Ipars) 340 343 #Iq = Pq*Sq*pars.get('volfraction', 1) 341 Sq = Iq/Pq 342 return Theory(Q=q, F1=None, F2=None, P=Pq, S=Sq, I=Iq, Seff=None, Ibeta=None) 344 #Sq = Iq/Pq 345 #Iq = None#= Sq = None 346 r=I._kernel.results 347 return Theory(Q=q, F1=None, F2=None, P=Pq, S=None, I=None, Seff=r[1], Ibeta=Iq) 343 348 344 349 def compare(title, target, actual, fields='F1 F2 P S I Seff Ibeta'): … … 400 405 radius_equatorial_pd=.1, radius_equatorial_pd_type=pd_type, 401 406 volfraction=0.15, 407 radius_effective=270.7543927018, 402 408 #radius_effective=12.59921049894873, 403 409 ) 404 target = sasmodels_theory(q, model, **pars)410 target = sasmodels_theory(q, model, beta_mode=1, **pars) 405 411 actual = ellipsoid_pe(q, norm='sasview', **pars) 406 412 title = " ".join(("sasmodels", model, pd_type)) … … 450 456 S = data[5] 451 457 Seff = data[6] 452 target = Theory(Q=Q, F1=F1, F2=F2,P=P, S=S, Seff=Seff)458 target = Theory(Q=Q, F1=F1, P=P, S=S, Seff=Seff) 453 459 actual = sphere_r(Q, norm='yun', **pars) 454 460 title = " ".join(("yun", "sphere", "10% dispersion 10% Vf")) … … 462 468 S = data[5] 463 469 Seff = data[6] 464 target = Theory(Q=Q, F1=F1, F2=F2,P=P, S=S, Seff=Seff)470 target = Theory(Q=Q, F1=F1, P=P, S=S, Seff=Seff) 465 471 actual = sphere_r(Q, norm='yun', **pars) 466 472 title = " ".join(("yun", "sphere", "15% dispersion 10% Vf"))
Note: See TracChangeset
for help on using the changeset viewer.