eleanor icon indicating copy to clipboard operation
eleanor copied to clipboard

IndexError for specific sectors

Open Hawkmoon95 opened this issue 10 months ago • 1 comments

Hello, I am trying to run eleanor.Update for all sectors (haven't used Eleanor since 2019), and am running into the issue below when I reach sectors in the 50s:

Traceback (most recent call last):
  File "eleanor_astropy.py", line 44, in <module>
    eleanor.Update(sector=i)
  File "/opt/anaconda3/lib/python3.7/site-packages/eleanor/update.py", line 170, in __init__
    self.get_cbvs()
  File "/opt/anaconda3/lib/python3.7/site-packages/eleanor/update.py", line 229, in get_cbvs
    convolved[i, j] = np.mean(cbv[1].data[index][cads])
IndexError: index 19962 is out of bounds for axis 0 with size 19962

I was originally running into a similar issue described here https://github.com/afeinstein20/eleanor/issues/236 but I updated maxsector.py and my eleanor installation and that issue went away. After doing that, I was able to update the metadata for sectors in the 20s, 30s, and 40s, until this issue popped up. Any help is appreciated!

Hawkmoon95 avatar Apr 07 '24 16:04 Hawkmoon95

Hey, so it seems that if you download eleanor via pip, you actually don't get the newest version. So using the version on GitHub should fix the error. I had the same issue, and replacing the if statement in line 229 with the following worked for me!

if self.sector < 27: cads = np.arange(g-7, g+8, 1) elif self.sector < 56: # XXX: need to test when TESSCut becomes available cads = np.arange(g-2, g+3, 1) else: cads = np.arange(g - 5, g + 5, 1)

PaulSteimle avatar Apr 22 '24 23:04 PaulSteimle

Thanks Paul, this seems to have worked!

Hawkmoon95 avatar Apr 29 '24 18:04 Hawkmoon95

Well of course as soon as I say that, I get a new error at sector 61. The default maxsector in this version is 60 so I assume this has something to do with it. I updated maxsector.py to 75 and this error persists:

WARNING: NoResultsWarning: Missing sector information for input target. Cutout not performed. [astroquery.mast.tesscut]
Traceback (most recent call last):
  File "eleanor_astropy.py", line 44, in <module>
    eleanor.Update(sector=i)
  File "/opt/anaconda3/lib/python3.7/site-packages/eleanor-2.0.5-py3.7.egg/eleanor/update.py", line 155, in __init__
    self.cutout = fits.open(manifest['Local Path'][0],memmap=False)
  File "astropy/table/_column_mixins.pyx", line 74, in astropy.table._column_mixins._ColumnGetitemShim.__getitem__
  File "astropy/table/_column_mixins.pyx", line 57, in astropy.table._column_mixins.base_getitem
  File "astropy/table/_column_mixins.pyx", line 69, in astropy.table._column_mixins.column_getitem

Hawkmoon95 avatar Apr 29 '24 19:04 Hawkmoon95

This should now work for all sectors up to the present one, there was an issue with the update script for new sectors in the South in running the update script which is now sorted! Going to close the issue, if you still run into this please reopen it.

benmontet avatar Jun 06 '24 01:06 benmontet