Using Scherrer equation for calculating the grain size
<p>I'm trying to calculate the grain size by Scherrer equation but I have stuck in FWHM. </p>

<pre><code>import numpy as np
#import math

k = 0.94
wave_length = 1.5406e-10

data = np.genfromtxt("G3.txt")

indice = np.argmax(data[:,1])
peak = (data[indice, :])
#D = (k*wave_length) / (beta*cos((math.radian(theta))
</code></pre>

<p><a href="http://i.stack.imgur.com/1l5Pq.png" rel="nofollow"><img src="http://i.stack.imgur.com/1l5Pq.png" alt="Corresponding graphs looks likes as in the picture"></a></p>

<p>Information: <a href="https://en.wikipedia.org/wiki/Scherrer_equation" rel="nofollow">Scherrer equation</a>,  <a href="https://en.wikipedia.org/wiki/Full_width_at_half_maximum" rel="nofollow">Full width at half maximum</a>, <a href="http://stackoverflow.com/questions/29877427/python-find-fwhm-of-curve">Related question</a></p>

<p>I'm sorry for sharing this as an answer but comments does not provide me upload a picture to clarify the problem. So I've illustrated the problem with an image below (BTW, I can't edit or delete my comments which I wrote reluctantly).
I got this graph when I run your code
<a href="https://i.stack.imgur.com/wyIVm.png" rel="nofollow"><img src="https://i.stack.imgur.com/wyIVm.png" alt="I got this graph when I run your code"></a></p>

<p><a href="https://i.stack.imgur.com/sp820.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/sp820.jpg" alt="This is the graph what I&#39;m looking for"></a></p>

<p>This graph illustrates what I'm looking for</p>

python numpy physics