Changeset 2355 for trunk/GSASIIpwd.py
 Timestamp:
 Jun 30, 2016 8:36:29 AM (7 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASIIpwd.py
r2334 r2355 300 300 XY[0] = npT2q(XY[0],wave) 301 301 # Qdata = np.nan_to_num(si.griddata(XY[0],XY[1],Qpoints,method='linear')) #only OK for scipy 0.9! 302 T = si.interp1d(XY[0],XY[1],bounds_error=False,fill_value= 0.0) #OK for scipy 0.8302 T = si.interp1d(XY[0],XY[1],bounds_error=False,fill_value=XY[1][0]) #OK for scipy 0.8 303 303 Qdata = T(Qpoints) 304 Qdata = np.min(Qdata)*data['BackRatio'] 304 305 305 306 qLimits = data['QScaleLim'] … … 313 314 xydata['IofQ'][1] = newdata 314 315 315 316 316 xydata['SofQ'] = copy.deepcopy(xydata['IofQ']) 317 317 FFSq,SqFF,CF = GetAsfMean(ElList,(xydata['SofQ'][1][0]/(4.0*np.pi))**2) #these are <f^2>,<f>^2,Cf … … 327 327 scale = len(xydata['SofQ'][1][1][minQ:maxQ])/np.sum(xydata['SofQ'][1][1][minQ:maxQ]) 328 328 xydata['SofQ'][1][1] *= scale 329 329 # if data.get('sinDamp',False): #not the right thing but leave as place holder 330 # sinDamp = np.sin(np.pi*xydata['SofQ'][1][0]/qLimits[1]) 331 # xydata['SofQ'][1][1] *= sinDamp 330 332 xydata['FofQ'] = copy.deepcopy(xydata['SofQ']) 331 333 xydata['FofQ'][1][1] = xydata['FofQ'][1][0]*(xydata['SofQ'][1][1]1.0) 332 334 if data['Lorch']: 333 xydata['FofQ'][1][1] *= LorchWeight(Q) 334 335 xydata['FofQ'][1][1] *= LorchWeight(Q) 335 336 xydata['GofR'] = copy.deepcopy(xydata['FofQ']) 336 337 nR = len(xydata['GofR'][1][1]) 337 338 xydata['GofR'][1][1] = dq*np.imag(ft.fft(xydata['FofQ'][1][1],4*nR)[:nR]) 338 339 xydata['GofR'][1][0] = 0.5*np.pi*np.linspace(0,nR,nR)/qLimits[1] 339 340 return auxPlot 341 342 def MakeRDF(RDFcontrols,background,inst,pwddata,xydata): 343 # GSASIIpath.IPyBreak() 344 auxPlot = [] 345 if 'C' in inst['Type'][0]: 346 Tth = pwddata[0] 347 hc = 12.397639 348 wave = G2mth.getWave(inst) 349 keV = hc/wave 350 minQ = npT2q(Tth[0],wave) 351 maxQ = npT2q(Tth[1],wave) 340 352 353 354 elif 'T' in inst['Type'][0]: 355 TOF = pwddata[0] 356 difC = inst['difC'][1] 357 minQ = 2.*np.pi*difC/TOF[1] 358 maxQ = 2.*np.pi*difC/TOF[0] 359 360 Qpoints = np.linspace(0.,maxQ,len(pwddata[0]),endpoint=True) 361 dq = Qpoints[1]Qpoints[0] 362 T = si.interp1d(pwddata[0],pwddata[1],bounds_error=False,fill_value=0.0,kind=RDFcontrols['Smooth']) #OK for scipy 0.8 363 Qdata = T(Qpoints) 364 auxPlot.append([Qpoints,Qdata,'interp1d:'+RDFcontrols['Smooth']]) 341 365 return auxPlot 366 print 'make RDF' 342 367 343 368 ################################################################################ … … 1420 1445 ptstr += ptfmt % (back) 1421 1446 if Background[0][1]: 1422 sigstr += ptfmt % (sigDict['Back;'+str(i)]) 1447 prm = 'Back;'+str(i) 1448 if prm in sigDict: 1449 sigstr += ptfmt % (sigDict[prm]) 1450 else: 1451 sigstr += " "*12 1423 1452 if len(ptstr) > 75: 1424 1453 print ptstr … … 1441 1470 if name+str(term) in sigDict: 1442 1471 line += ptfmt%(sigDict[name+str(term)]) 1472 else: 1473 line += " "*12 1443 1474 print line 1444 1475 if Background[1]['nPeaks']:
Note: See TracChangeset
for help on using the changeset viewer.