<jupyter_start><jupyter_text>Adding all the images in the frame to get a better contrast and reduce noise<jupyter_code>for II in range(frames.shape[0]):
    frame = frames[II]
    img_eq = (frame - np.amin(frame))/(np.amax(frame)-np.amin(frame))
    if II == 0:
        img_ave = img_eq
    else:
        img_ave = img_ave + img_eq
img_average = img_ave/frames.shape[0]
img_eq = (img_ave - np.amin(img_ave))/(np.amax(img_ave)-np.amin(img_ave))
plt.imshow(img_eq)
rows = img_eq.shape[0]
columns = img_eq.shape[1]
column_sum = []
for i in range(0,columns):
    column_sum.append(sum(img_eq[:,i]))
row_sum = []
for j in range(0,rows):
    row_sum.append(sum(img_eq[j,:]))
column_sum = [x * -1 for x in column_sum]
row_sum = [x * -1 for x in row_sum]
plt.plot(range(len(column_sum)),column_sum)
plt.xlabel('X-coordinate value')
plt.ylabel('Sum of pixel values over columns')
plt.plot(range(len(row_sum)),row_sum)
plt.xlabel('Y-coordinate value')
plt.ylabel('Sum of pixel values over rows')
column_troughs = find_peaks(column_sum,distance=10)
column_troughs = column_troughs[0]
row_troughs = find_peaks(row_sum,distance=10)
row_troughs = row_troughs[0]
X = []
Y = []
i = 0
j = 0
for i in range(0,8):
    for j in range(0,12):
        X.append(column_troughs[j])
        j = j + 1
        Y.append(row_troughs[i])
    i = i + 1
well_location = pd.DataFrame(list(zip(X, Y)),columns =['X', 'Y'])
# To easily access the X and Y coordinates
x = well_location['X']
y = well_location['Y']
well_location
plt.imshow(img_eq)
plt.scatter(x,y)
plate_x = x[4] + 7
plate_y = y[48]
plt.scatter(plate_x,plate_y)
# The above coordinates can be used to measure the temperature of the well plate assuming that
#he temperature is uniform all over the well plate.<jupyter_output><empty_output><jupyter_text>Finding pixel intensity in all the wells in each frame<jupyter_code>import irtemp

irtemp.centikelvin_to_celsius(30000)
# List to store lists of temperature at all the well in each frame.
temp = []
for i in range(96):
    # List to store temperature at a well in each frame.
    comp_temp = []
    for frame in frames:
        comp_temp.append(irtemp.centikelvin_to_celsius(frame[y[i]][x[i]]))
    temp.append(comp_temp)
plate_temp = []
for frame in frames:
    plate_temp.append(irtemp.centikelvin_to_celsius(frame[plate_y,plate_x]))
len(plate_temp)
# Temperature at each of 96 well plates can be accessed
# using the well plate number as the list index
len(temp)
# The length of the list gives the number of wells at which
# temperature is observed over a period of time.
# Each list in the list 'temp' gives the temperature
# at the required well in each frame
len(temp[1])<jupyter_output><empty_output><jupyter_text>Temperature of the wellplate  Plotting<jupyter_code>font = {
        'weight': 'normal',
        'size': 12,
        }
plt.plot(plate_temp,temp[12])
plt.ylabel('Temperature of the sample($^\circ$C)',fontdict=font)
plt.xlabel('Temperature of the well plate($^\circ$C)',fontdict=font)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.12512446067042815, 'fraction_numerical': 0.013939595087952207, 'mean_word_length': 4.676082862523541, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '382236', 'license': 'MIT', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1085, 'n_words': 295, 'path': 'scripts/Well_location_31.ipynb', 'repo_name': 'MariaPoliti/musical-robot', 'size': '3013'}