summed += (x-xbar)**2
    sigma = np.sqrt(summed/(n))
    SNR = np.mean(norm_flux_continuum) / sigma
    S_N = SNR
    list_data[6] = S_N

             # attempt to format table properly
t = Table(rows=data_rows, names=('Object', 'RA', 'Dec', 'Spectral Type', 'UT Date', 'J mag, flux(1.25 microns)', 'S/N', 'Total Exp. Time (s)', 'A0Vstandard', 'Teff', 'log(g)'), meta={'Spex': 'Young Stars'}, dtype=('str', 'str', 'str', 'str', 'str', 'f', 'i', 'f', 'str', 'str', 'str') )


t.write(docname, format='latex')
#print t
#print t.colnames
#print t.more()
#---------------------------------------ADDED---------------------------
t.close()
#------------------------------------------------------------------

# SNR VS EXP Time plot
plt.plot(t['Total Exp. Time (s)'], t['S/N'], 'ro')
plt.xlabel('Total Integration Time')
plt.ylabel('SNR')
plt.show()


'''
# commands to fill in table data
# print object name   RA   Dec
# already did x_ = 0 through x_ = 26
x_ = 27
print t[x_][0] + '   ' + t[x_]['RA'] + '   ' + t[x_]['Dec']