Difference: StewartBoogertPhotometry20171009 (2 vs. 3)

Revision 312 Oct 2017 - LunaMarieBorella1

Line: 1 to 1

 META TOPICPARENT name="StewartBoogertPhotometry2017"

Dark Frames:

 Exposure time (s) Image Mean (sigma)
Line: 18 to 18

Deleted:
<
<

-- BekiChafer - 12 Oct 2017
\ No newline at end of file
>
>

Histogram Fitting Code/ test

```
from astropy.io import fits
import numpy as np
import matplotlib.pyplot as plt
from scipy.optimize import curve_fit
file = fits.open('300s_DarkFrame.fit')
file0 = file[0]
data1 = file0.data
#print(data1[0][:])
#print(np.shape(data1))
inten = data1.flatten()
#print(inten)
plt.close()
#hist = np.histogram(inten, bins = 'auto' )
plt.figure(1, facecolor = 'white')
h = plt.hist(inten, 100, (900, 1000), alpha=0.3, label = 'Histogram')
y = h[0]
xedge = h[1]
xcentre = (xedge + np.roll(xedge, -1))/2.0
x = xcentre[0:len(y)]
n = len(x) #the number of data
mean = sum(x)/n #note this correction
def func(x,a,x0,sigma):
<span style="white-space: pre;">   </span>return a*np.exp(-(x-x0)**2/(2*sigma**2))
print(len(y))
print(len(x))
#plt.figure(2)
#plt.plot(x, y)
popt, pcov = curve_fit(func, x, y, (1, mean, 1))
sx0 = str(round(popt[1],1))
ssigma = str(round((2*popt[2])**2,1))
plt.scatter(x, func(x, *popt), color = 'red', label = 'Fitted Gaussian \$y =\$'+ str(np.round(popt[0],1))+'\$e^{-(x - ' +sx0 +')^{2} / '+ ssigma +'}\$')
plt.legend()
plt.title('Constant temperature, Exposure ~300sec, Histogram fitted with Gaussian')
plt.xlabel('bins')
plt.ylabel('counts')
plt.axis([900, 1000, 0, 100000])
plt.show()

```

-- BekiChafer - 12 Oct 2017

 META FILEATTACHMENT attachment="HistogramFitGraphs.zip" attr="" comment="" date="1507846289" name="HistogramFitGraphs.zip" path="HistogramFitGraphs.zip" size="322642" user="zavc160" version="1"

Copyright © 2008-2022 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback