afeinstein20 / eleanor

A tool for light curve extraction from the TESS FFIs.
MIT License
92 stars 39 forks source link

Unable to access Sector 36 data for a source #249

Closed vatsalpanwar closed 2 years ago

vatsalpanwar commented 2 years ago

Hi, new eleanor user here! I am trying to define and extract the light curves for a source (TIC 35516889) which was observed in both Sectors 9 and Sector 36. It is working fine for Sector 9 but when I run star = eleanor.Source(tic=35516889,sector = 36) I get the error message copied below which I guess means that eleanor can't find the source in Sector 36. I have already run eleanor.Update(sector=36) successfully before all this, so I am wondering why this might be happening?


IndexError                                Traceback (most recent call last)
<ipython-input-6-5a8407b50546> in <module>
----> 1 star = eleanor.Source(tic=35516889,sector = 36)

~/anaconda3/lib/python3.6/site-packages/eleanor-2.0.5-py3.6.egg/eleanor/source.py in __init__(self, tic, gaia, coords, name, fn, sector, fn_dir, tc, local, post_dir, pm_dir, metadata_path, tesscut_size, tm)
    256                 self.tess_mag = self.tess_mag[0]
    257 
--> 258             self.locate_on_tess()
    259             self.tesscut_size = tesscut_size
    260 

~/anaconda3/lib/python3.6/site-packages/eleanor-2.0.5-py3.6.egg/eleanor/source.py in locate_on_tess(self)
    298             # Handles cases where users can pass in their sector
    299             if type(self.usr_sec) == int:
--> 300                 arg = np.argwhere(sectors == self.usr_sec)[0]
    301                 if len(arg) > 0:
    302                     self.sector = sectors[arg][0]

IndexError: index 0 is out of bounds for axis 0 with size 0
benmontet commented 2 years ago

Hi Vatsal,

Not sure what's causing this but I have two guesses of possible explanations.

1) There's a file in your eleanor.__path__ called maxsector.py that lists the latest sector of data that eleanor will look for when making light curves. It's supposed to get updated when you call eleanor.Update() but occasionally for some users will fail (perhaps if you are running the code from a location where you don't have write permissions, for example). Check that file, and if the maxsector is less than 36, that's your problem, just manually update that value and you're good to go.

2) It could be an issue with tess-point, which is the tool being used behind the scenes to find your sector list and identify which sectors a target is observed in. If you have a very old version, before the position for Sector 36 was set, you might get this failure mode, so if you have an old version try upgrading tess-point via pip and trying again.

One other weird possibility, try running eleanor.multi_sectors(tic=yourtic, sectors='all'). I seem to remember something funky happening to the update script to someone once before when they tried to call a specific sector that was cleared up with a call to multi_sectors, so if the first two fail you give that a go and see what happens!

vatsalpanwar commented 2 years ago

Hi Ben, Thanks for the quick response! Indeed my tess-point wasn't up to date. I just upgraded it and I am able to get the light curves for Sector 36 as well.