noraeisner / LATTE

Lightcurve Analysis Tool for Transiting Exoplanet
GNU Lesser General Public License v3.0
39 stars 10 forks source link

Error with --new-data, i.e., when trying to download meta data for new sectors #16

Open orionlee opened 4 years ago

orionlee commented 4 years ago

I tried to download the additional sector 27/28 metadata (paths to lightcurve files, etc.), and got the following error.

$python -m LATTE --new-data
Store the times of the momentum dumps for each sector - only needed when looking at the FFIs
Traceback (most recent call last):
  File "C:\pkg\_winNonPortables\Anaconda3\envs\forLATTE\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\pkg\_winNonPortables\Anaconda3\envs\forLATTE\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\dev\_juypter\LATTE\LATTE\__main__.py", line 264, in <module>
    utils.momentum_dumps_info(indir)
  File "C:\dev\_juypter\LATTE\LATTE\LATTEutils.py", line 2316, in momentum_dumps_info
    first_sec = int(string[0:2])
ValueError: invalid literal for int() with base 10: '\n'
noraeisner commented 4 years ago

Hi, yes the initial LATTE was only designed to download the data from the nominal mission (from the first 26 from the first two years of TESS) I'm afraid. This will be fixed in the new LATTE release which has changed the way that the data is downloaded to make it faster and no longer require the data files (which is the reason that it is failing now). Test are being run on the new version now. As a quick fix, you can open the LATTEutils.py file and change all occurrences of "for sec in range(first_sec+1,27)" to "for sec in range(first_sec+1,50)" that should then allow you to download the necessary data. There are five occurrences of that line of code.

orionlee commented 4 years ago

The error occurred before the the line for sec in range(first_sec+1,27) that assumed there are only 26 sectors.

I think it has troubles in parsing the existing tess_mom_dumps.txt, for the use case that one tries to add meta data to pre-existing set.

It's the first_sec = int(string[0:2]) in the following code snippets. It's probably an easy fix.

        os.system('tail -n 1 {0}/data/tess_mom_dumps.txt > {0}/data/temp.txt'.format(indir))

        with open("{}/data/temp.txt".format(indir), 'r') as f:
            string = f.readlines()[-1]
            first_sec = int(string[0:2])
orionlee commented 4 years ago

The issue is resolved in LATTE-dev branch.