I am trying to read in a file 'BASTIFeH.txt' with astropy.ascii, that has more files embedded in it. Those embedded files get called my_ISOFILE1 or my_ISOFILE2. There seems to be no issue with this, it's when I start working with those that I seem to get issues. Here is the relevant snippet of my code:
isochrone = ascii.read(r'C:\Users\raeas\ThesisResearch\BastiFeH.txt')
for i in range(len(isochrone)):
if BASTIFEH1 == isochrone['col2'][i]:
my_ISOFILE1 = isochrone['col3'][i]
if BASTIFEH2 == isochrone['col2'][i]:
my_ISOFILE2 = isochrone['col3'][i]
TEMPTEFF = np.log10(Teff)
for j in range(len(my_ISOFILE1)):
if my_ISOFILE1['col4'][j] < TEMPTEFF and (my_ISOFILE1['col1'][450] < my_ISOFILE1['col1'][j] < my_ISOFILE1['col1'][1189] or my_ISOFILE1['col1'][2065] < my_ISOFILE1['col1'][j] < my_ISOFILE1['col1'][2249]):
LOGL1 = my_ISOFILE1['col3'][j]
MV1 = my_ISOFILE1['col5'][j]
MASS1 = my_ISOFILE1['col2'][j]
NEWLOGG1 = 4.44 + np.log10(MASS1) - LOGL1 + 4*np.log10(Teff/5777)
break
The specific line that I am getting that error on is:
if my_ISOFILE1['col4'][j] < TEMPTEFF and (my_ISOFILE1['col1'][450] < my_ISOFILE1['col1'][j] < my_ISOFILE1['col1'][1189] or my_ISOFILE1['col1'][2065] < my_ISOFILE1['col1'][j] < my_ISOFILE1['col1'][2249]):
The thing that is confusing me so much is that that same syntax didn't bother it before this, only when I get here.
Thanks.