Skip to content

Commit cd6a5f3

Browse files
committed
Add warning id negative 2-thetas used for RDF calcs.
1 parent 74a8b45 commit cd6a5f3

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

GSASII/GSASIIpwdGUI.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,16 +1838,19 @@ def OnMakeRDF(event):
18381838
pwddata = G2frame.GPXtree.GetItemPyData(PatternId)[1]
18391839
xmin = np.searchsorted(pwddata[0,:],limits[0])
18401840
xmax = np.searchsorted(pwddata[0,:],limits[1])
1841-
auxPlot = G2pwd.MakeRDF(RDFcontrols,background,inst,pwddata[:,xmin:xmax])
1842-
for plot in auxPlot:
1843-
XY = np.array(plot[:2])
1844-
if 'D(R)' in plot[2]:
1845-
xlabel = r'$R, \AA$'
1846-
ylabel = r'$D(R), arb. units$'
1847-
else:
1848-
xlabel = r'$Q,\AA$'+superMinusOne
1849-
ylabel = r'$I(Q)$'
1850-
G2plt.PlotXY(G2frame,[XY,],Title=plot[2],labelX=xlabel,labelY=ylabel,lines=True)
1841+
if pwddata[0,xmin] > 0:
1842+
auxPlot = G2pwd.MakeRDF(RDFcontrols,background,inst,pwddata[:,xmin:xmax])
1843+
for plot in auxPlot:
1844+
XY = np.array(plot[:2])
1845+
if 'D(R)' in plot[2]:
1846+
xlabel = r'$R, \AA$'
1847+
ylabel = r'$D(R), arb. units$'
1848+
else:
1849+
xlabel = r'$Q,\AA$'+superMinusOne
1850+
ylabel = r'$I(Q)$'
1851+
G2plt.PlotXY(G2frame,[XY,],Title=plot[2],labelX=xlabel,labelY=ylabel,lines=True)
1852+
else:
1853+
G2frame.ErrorDialog('RDF calculation failure','Negative 2-thetas/TOF; choose better limits')
18511854

18521855
def BackSizer():
18531856

0 commit comments

Comments
 (0)