Changeset 3263
- Timestamp:
- Feb 6, 2018 1:04:54 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIIdataGUI.py
r3258 r3263 7095 7095 G2frame.GPXtree.SetItemPyData(GetGPXtreeItemId(G2frame,item,'Limits'), 7096 7096 [(Tmin,Tmax),[Tmin,Tmax]]) 7097 UpdatePWHKPlot(G2frame,kind,item) # redisplay data screen7097 wx.CallAfter(UpdatePWHKPlot,G2frame,kind,item) # redisplay data screen 7098 7098 7099 7099 def OnPlot3DHKL(event): -
trunk/GSASIIplot.py
r3262 r3263 1482 1482 if not Id: return 1483 1483 Parms,Parms2 = G2frame.GPXtree.GetItemPyData(Id) 1484 limx = Plot.get_xlim() 1485 dT = tolerance = np.fabs(limx[1]-limx[0])/100. 1484 1486 if G2frame.plotStyle['qPlot'] and 'PWDR' in plottype: 1485 1487 q = xpos 1486 dsp = 2.*np.pi/q 1488 if q <= 0: 1489 G2frame.G2plotNB.status.SetStatusText('q = %9.5f'%q) 1490 return 1487 1491 try: 1488 xpos = G2lat.Dsp2pos(Parms,2.0*np.pi/xpos) 1492 dsp = 2.*np.pi/q 1493 xpos = G2lat.Dsp2pos(Parms,2.0*np.pi/q) 1489 1494 except ValueError: #avoid bad value in asin beyond upper limit 1495 G2frame.G2plotNB.status.SetStatusText('q = %9.5f'%q) 1490 1496 return 1491 limx = Plot.get_xlim() 1492 try: 1493 xmin = G2lat.Dsp2pos(Parms,2.0*np.pi/limx[0]) 1494 except ValueError: #fix bad value in asin beyond upper limit 1495 #if 'C' in Parms['Type'][0]: # how to handle TOF? 1496 xmin = 0. 1497 try: 1498 xmax = G2lat.Dsp2pos(Parms,2.0*np.pi/limx[1]) 1499 except ValueError: #fix bad value in asin beyond upper limit 1500 #if 'C' in Parms['Type'][0]: # how to handle TOF? 1501 xmin = 180. 1502 wid = np.fabs(xmax - xmin) 1497 if 'C' in Parms['Type'][0] or 'PKS' in Parms['Type'][0]: 1498 wave = G2mth.getWave(Parms) 1499 dT = tolerance*wave*90./(np.pi**2*cosd(xpos/2)) 1500 else: # TOF 1501 dT = Parms['difC'][1] * 2 * np.pi * tolerance / q**2 1503 1502 elif plottype in ['SASD','REFD']: 1504 1503 q = xpos 1504 if q <= 0: 1505 G2frame.G2plotNB.status.SetStatusText('q = %9.5f'%q) 1506 return 1505 1507 dsp = 2.*np.pi/q 1506 limx = Plot.get_xlim()1507 wid = np.fabs(2.*np.pi/limx[1] - 2.*np.pi/limx[0])1508 1508 elif G2frame.plotStyle['dPlot']: 1509 1509 dsp = xpos 1510 q = 2.*np.pi/dsp 1511 xpos = G2lat.Dsp2pos(Parms,xpos) 1512 limx = Plot.get_xlim() 1513 wid = np.fabs(2.*np.pi/limx[1] - 2.*np.pi/limx[0]) 1510 if dsp <= 0: 1511 G2frame.G2plotNB.status.SetStatusText('d = %9.5f'%dsp) 1512 return 1513 try: 1514 q = 2.*np.pi/dsp 1515 xpos = G2lat.Dsp2pos(Parms,dsp) 1516 except ValueError: #avoid bad value 1517 G2frame.G2plotNB.status.SetStatusText('d = %9.5f'%dsp) 1518 return 1519 dT = tolerance*xpos/dsp 1514 1520 elif G2frame.Contour and 'T' in Parms['Type'][0]: 1515 1521 xpos = X[int(xpos)] 1516 1522 dsp = G2lat.Pos2dsp(Parms,xpos) 1517 1523 q = 2.*np.pi/dsp 1518 limx = Plot.get_xlim()1519 wid = np.fabs(limx[1]-limx[0])1520 1524 else: 1521 1525 dsp = G2lat.Pos2dsp(Parms,xpos) 1522 1526 q = 2.*np.pi/dsp 1523 limx = Plot.get_xlim()1524 wid = np.fabs(limx[1]-limx[0])1525 1527 if G2frame.Contour: #PWDR only 1526 1528 if 'C' in Parms['Type'][0]: … … 1555 1557 if pickIdText in ['Index Peak List','Unit Cells List',]: 1556 1558 indx = -2 1557 found = G2frame.HKL[np.where(np.fabs(G2frame.HKL.T[indx]-xpos) < 0.005*wid)] # finds reflections within 1% of plot range 1559 # finds reflections within 1% of plot range in units of plot 1560 found = G2frame.HKL[np.where(np.fabs(G2frame.HKL.T[indx]-xpos) < dT/2.)] 1558 1561 if len(found): 1559 1562 if len(found[0]) > 6: #SS reflections
Note: See TracChangeset
for help on using the changeset viewer.