Changeset 1715
 Timestamp:
 Mar 16, 2015 2:17:24 PM (8 years ago)
 Location:
 trunk
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

trunk/GSASII.py
r1713 r1715 2097 2097 self.undofile = '' 2098 2098 self.TreeItemDelete = False 2099 # self.Offset = [0.0,0.0] 2100 # self.delOffset = .02 2101 # self.refOffset = 1.0 2102 # self.refDelt = .01 2099 self.plotStyle = {'qPlot':False,'dPlot':False,'sqrtPlot':False} 2103 2100 self.Weight = False 2104 2101 self.IfPlot = False 
trunk/GSASIIplot.py
r1694 r1715 955 955 if 'Offset' not in data[0] and plotType in ['PWDR','SASD']: #plot offset data 956 956 data[0].update({'Offset':[0.0,0.0],'delOffset':0.02,'refOffset':1.0, 957 'refDelt':0.01, 'qPlot':False,'dPlot':False,'sqrtPlot':False})957 'refDelt':0.01,}) 958 958 G2frame.PatternTree.SetItemPyData(G2frame.PickId,data) 959 959 #end patch … … 996 996 dlg.Destroy() 997 997 elif G2frame.SinglePlot: 998 Pattern[0]['sqrtPlot'] = not Pattern[0]['sqrtPlot']999 if Pattern[0]['sqrtPlot']:998 G2frame.plotStyle['sqrtPlot'] = not G2frame.plotStyle['sqrtPlot'] 999 if G2frame.plotStyle['sqrtPlot']: 1000 1000 Pattern[0]['delOffset'] = .002 1001 1001 Pattern[0]['refOffset'] = 1.0 … … 1034 1034 if 'PWDR' in plottype: 1035 1035 newPlot = True 1036 Pattern[0]['qPlot'] = not Pattern[0]['qPlot']1037 Pattern[0]['dPlot'] = False1036 G2frame.plotStyle['qPlot'] = not G2frame.plotStyle['qPlot'] 1037 G2frame.plotStyle['dPlot'] = False 1038 1038 elif 'SASD' in plottype: 1039 1039 newPlot = True 1040 G2frame. sqPlot = not G2frame.sqPlot1040 G2frame.plotStyle['sqPlot'] = not G2frame.plotStyle['sqPlot'] 1041 1041 elif event.key == 't' and 'PWDR' in plottype: 1042 Pattern[0]['dPlot'] = not Pattern[0]['dPlot']1043 Pattern[0]['qPlot'] = False1042 G2frame.plotStyle['dPlot'] = not G2frame.plotStyle['dPlot'] 1043 G2frame.plotStyle['qPlot'] = False 1044 1044 newPlot = True 1045 1045 elif event.key == 'm': 1046 Pattern[0]['sqrtPlot'] = False1046 G2frame.plotStyle['sqrtPlot'] = False 1047 1047 G2frame.SinglePlot = not G2frame.SinglePlot 1048 1048 newPlot = True … … 1074 1074 try: 1075 1075 Parms,Parms2 = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId, 'Instrument Parameters')) 1076 if Pattern[0]['qPlot'] and 'PWDR' in plottype:1076 if G2frame.plotStyle['qPlot'] and 'PWDR' in plottype: 1077 1077 q = xpos 1078 1078 dsp = 2.*np.pi/q … … 1084 1084 q = xpos 1085 1085 dsp = 2.*np.pi/q 1086 elif Pattern[0]['dPlot']:1086 elif G2frame.plotStyle['dPlot']: 1087 1087 dsp = xpos 1088 1088 q = 2.*np.pi/dsp … … 1103 1103 if 'C' in Parms['Type'][0]: 1104 1104 if 'PWDR' in plottype: 1105 if Pattern[0]['sqrtPlot']:1105 if G2frame.plotStyle['sqrtPlot']: 1106 1106 G2frame.G2plotNB.status.SetStatusText('2theta =%9.3f d =%9.5f q = %9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1) 1107 1107 else: … … 1110 1110 G2frame.G2plotNB.status.SetStatusText('q =%12.5g Intensity =%12.5g d =%9.1f'%(q,ypos,dsp),1) 1111 1111 else: 1112 if Pattern[0]['sqrtPlot']:1112 if G2frame.plotStyle['sqrtPlot']: 1113 1113 G2frame.G2plotNB.status.SetStatusText('TOF =%9.3f d =%9.5f q =%9.5f sqrt(Intensity) =%9.2f'%(xpos,dsp,q,ypos),1) 1114 1114 else: … … 1161 1161 if ind.all() != [0] and ObsLine[0].get_label() in str(pick): #picked a data point 1162 1162 data = G2frame.PatternTree.GetItemPyData(G2frame.PickId) 1163 if Pattern[0]['qPlot']: #qplot  convert back to 2theta1163 if G2frame.plotStyle['qPlot']: #qplot  convert back to 2theta 1164 1164 xy[0] = G2lat.Dsp2pos(Parms,2*np.pi/xy[0]) 1165 elif Pattern[0]['dPlot']: #dplot  convert back to 2theta1165 elif G2frame.plotStyle['dPlot']: #dplot  convert back to 2theta 1166 1166 xy[0] = G2lat.Dsp2pos(Parms,xy[0]) 1167 1167 XY = G2mth.setPeakparms(Parms,Parms2,xy[0],xy[1]) … … 1176 1176 LimitId = G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Limits') 1177 1177 data = G2frame.PatternTree.GetItemPyData(LimitId) 1178 if Pattern[0]['qPlot']: #qplot  convert back to 2theta1178 if G2frame.plotStyle['qPlot']: #qplot  convert back to 2theta 1179 1179 xy[0] = G2lat.Dsp2pos(Parms,2*np.pi/xy[0]) 1180 elif Pattern[0]['dPlot']: #dplot  convert back to 2theta1180 elif G2frame.plotStyle['dPlot']: #dplot  convert back to 2theta 1181 1181 xy[0] = G2lat.Dsp2pos(Parms,xy[0]) 1182 1182 if G2frame.ifGetExclude: … … 1239 1239 id = lineNo/2+1 1240 1240 id2 = lineNo%2 1241 if Pattern[0]['qPlot'] and 'PWDR' in plottype:1241 if G2frame.plotStyle['qPlot'] and 'PWDR' in plottype: 1242 1242 data[id][id2] = G2lat.Dsp2pos(Parms,2.*np.pi/xpos) 1243 elif Pattern[0]['dPlot'] and 'PWDR' in plottype:1243 elif G2frame.plotStyle['dPlot'] and 'PWDR' in plottype: 1244 1244 data[id][id2] = G2lat.Dsp2pos(Parms,xpos) 1245 1245 else: … … 1258 1258 del data['peaks'][lineNo2] 1259 1259 else: 1260 if Pattern[0]['qPlot']:1260 if G2frame.plotStyle['qPlot']: 1261 1261 data['peaks'][lineNo2][0] = G2lat.Dsp2pos(Parms,2.*np.pi/xpos) 1262 elif Pattern[0]['dPlot']:1262 elif G2frame.plotStyle['dPlot']: 1263 1263 data['peaks'][lineNo2][0] = G2lat.Dsp2pos(Parms,xpos) 1264 1264 else: … … 1429 1429 Title = 'log('+Title+')' 1430 1430 Plot.set_title(Title) 1431 if Pattern[0]['qPlot'] or 'SASD' in plottype and not G2frame.Contour:1431 if G2frame.plotStyle['qPlot'] or 'SASD' in plottype and not G2frame.Contour: 1432 1432 Plot.set_xlabel(r'$Q, \AA^{1}$',fontsize=16) 1433 elif Pattern[0]['dPlot'] and 'PWDR' in plottype and not G2frame.Contour:1433 elif G2frame.plotStyle['dPlot'] and 'PWDR' in plottype and not G2frame.Contour: 1434 1434 Plot.set_xlabel(r'$d, \AA$',fontsize=16) 1435 1435 else: … … 1449 1449 if 'C' in ParmList[0]['Type'][0]: 1450 1450 if 'PWDR' in plottype: 1451 if Pattern[0]['sqrtPlot']:1451 if G2frame.plotStyle['sqrtPlot']: 1452 1452 Plot.set_ylabel(r'$\sqrt{Intensity}$',fontsize=16) 1453 1453 else: … … 1459 1459 Plot.set_ylabel(r'$Intensity, cm^{1}$',fontsize=16) 1460 1460 else: 1461 if Pattern[0]['sqrtPlot']:1461 if G2frame.plotStyle['sqrtPlot']: 1462 1462 Plot.set_ylabel(r'$\sqrt{Normalized\ intensity}$',fontsize=16) 1463 1463 else: … … 1486 1486 for excl in excls: 1487 1487 xye[0] = ma.masked_inside(xye[0],excl[0],excl[1]) 1488 if Pattern[0]['qPlot'] and 'PWDR' in plottype:1488 if G2frame.plotStyle['qPlot'] and 'PWDR' in plottype: 1489 1489 Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root, Pattern[2]) 1490 1490 X = 2.*np.pi/G2lat.Pos2dsp(Parms,xye[0]) 1491 elif Pattern[0]['dPlot'] and 'PWDR' in plottype:1491 elif G2frame.plotStyle['dPlot'] and 'PWDR' in plottype: 1492 1492 Id = G2gd.GetPatternTreeItemId(G2frame,G2frame.root, Pattern[2]) 1493 1493 X = G2lat.Pos2dsp(Parms,xye[0]) … … 1497 1497 lenX = len(X) 1498 1498 if 'PWDR' in plottype: 1499 if Pattern[0]['sqrtPlot']:1499 if G2frame.plotStyle['sqrtPlot']: 1500 1500 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error 1501 1501 Y = np.where(xye[1]>=0.,np.sqrt(xye[1]),np.sqrt(xye[1])) … … 1512 1512 limits = np.array(G2frame.PatternTree.GetItemPyData(LimitId)) 1513 1513 lims = limits[1] 1514 if Pattern[0]['qPlot'] and 'PWDR' in plottype:1514 if G2frame.plotStyle['qPlot'] and 'PWDR' in plottype: 1515 1515 lims = 2.*np.pi/G2lat.Pos2dsp(Parms,lims) 1516 elif Pattern[0]['dPlot'] and 'PWDR' in plottype:1516 elif G2frame.plotStyle['dPlot'] and 'PWDR' in plottype: 1517 1517 lims = G2lat.Pos2dsp(Parms,lims) 1518 1518 Lines.append(Plot.axvline(lims[0],color='g',dashes=(5,5),picker=3.)) … … 1540 1540 DifLine = [''] 1541 1541 if ifpicked: 1542 if Pattern[0]['sqrtPlot']:1542 if G2frame.plotStyle['sqrtPlot']: 1543 1543 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error 1544 1544 Z = np.where(xye[3]>=0.,np.sqrt(xye[3]),np.sqrt(xye[3])) … … 1547 1547 Z = xye[3]+offsetY*N*Ymax/100.0 1548 1548 if 'PWDR' in plottype: 1549 if Pattern[0]['sqrtPlot']:1549 if G2frame.plotStyle['sqrtPlot']: 1550 1550 olderr = np.seterr(invalid='ignore') #get around sqrt(ve) error 1551 1551 W = np.where(xye[4]>=0.,np.sqrt(xye[4]),np.sqrt(xye[4])) … … 1636 1636 data = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,PatternId, 'Peak List')) 1637 1637 for item in data['peaks']: 1638 if Pattern[0]['qPlot']:1638 if G2frame.plotStyle['qPlot']: 1639 1639 Lines.append(Plot.axvline(2.*np.pi/G2lat.Pos2dsp(Parms,item[0]),color=colors[N%6],picker=2.)) 1640 elif Pattern[0]['dPlot']:1640 elif G2frame.plotStyle['dPlot']: 1641 1641 Lines.append(Plot.axvline(G2lat.Pos2dsp(Parms,item[0]),color=colors[N%6],picker=2.)) 1642 1642 else: … … 1669 1669 for peak in peaks[0]: 1670 1670 if peak[2]: 1671 if Pattern[0]['qPlot']:1671 if G2frame.plotStyle['qPlot']: 1672 1672 Plot.axvline(2.*np.pi/G2lat.Pos2dsp(Parms,peak[0]),color='b') 1673 if Pattern[0]['dPlot']:1673 if G2frame.plotStyle['dPlot']: 1674 1674 Plot.axvline(G2lat.Pos2dsp(Parms,peak[0]),color='b') 1675 1675 else: … … 1679 1679 if len(hkl) > 6 and hkl[3]: 1680 1680 clr = 'g' 1681 if Pattern[0]['qPlot']:1681 if G2frame.plotStyle['qPlot']: 1682 1682 Plot.axvline(2.*np.pi/G2lat.Pos2dsp(Parms,hkl[2]),color=clr,dashes=(5,5)) 1683 if Pattern[0]['dPlot']:1683 if G2frame.plotStyle['dPlot']: 1684 1684 Plot.axvline(G2lat.Pos2dsp(Parms,hkl[2]),color=clr,dashes=(5,5)) 1685 1685 else: … … 1701 1701 peak = np.array([[peak[4],peak[5]] for peak in peaks]) 1702 1702 pos = Pattern[0]['refOffset']pId*Ymax*Pattern[0]['refDelt']*np.ones_like(peak) 1703 if Pattern[0]['qPlot']:1703 if G2frame.plotStyle['qPlot']: 1704 1704 Plot.plot(2*np.pi/peak.T[0],pos,refColors[pId%6]+'',mew=1,ms=8,picker=3.,label=phase) 1705 elif Pattern[0]['dPlot']:1705 elif G2frame.plotStyle['dPlot']: 1706 1706 Plot.plot(peak.T[0],pos,refColors[pId%6]+'',mew=1,ms=8,picker=3.,label=phase) 1707 1707 else: 
trunk/GSASIIspc.py
r1709 r1715 1668 1668 CSI['Sadp'][0][i+6] = [0,0,0] 1669 1669 CSI['Sadp'][1][i+6] = [0.,0.,0.] 1670 else: 1671 1670 else: 1672 1671 for i in range(6): 1673 1672 if np.allclose(dU[i,i,:],dUT[i,i,:]*sdet):
Note: See TracChangeset
for help on using the changeset viewer.