Skip to content

Commit d0a68da

Browse files
authored
Update xrd.py
1 parent 6e403be commit d0a68da

File tree

1 file changed

+15
-0
lines changed
  • jarvis/analysis/diffraction

1 file changed

+15
-0
lines changed

jarvis/analysis/diffraction/xrd.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,21 @@ def processed(x, y, x_range=[0, 90], intvl=0.1, sigma=.05,recast=True,tol=0.1,ba
272272

273273
return x_new, y_sharp
274274

275+
def smooth_xrd(atoms=None,thetas=[0, 90],intvl=0.5):
276+
a, b, c = XRD(thetas=thetas).simulate(atoms=atoms)
277+
a = np.array(a)
278+
c = np.array(c)
279+
c=c/np.max(c)
280+
a, c = recast_array(
281+
x_original=a,
282+
y_original=c,
283+
x_new=np.arange(thetas[0], thetas[1], intvl),
284+
)
285+
c=c/np.max(c)
286+
#c_str = "\n".join(["{0:.3f}".format(x) for x in c])
287+
c_str = "\n".join(["{0:.2f}".format(x) for x in c])
288+
289+
return c_str,c
275290

276291
"""
277292
if __name__ == "__main__":

0 commit comments

Comments
 (0)