Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[LATTE-dev] Vetting in FFI mode hits AttributeError: 'TessTargetPixelFile' object has no attribute 'data' #33

Open
orionlee opened this issue Oct 31, 2020 · 1 comment

Comments

@orionlee
Copy link

orionlee commented Oct 31, 2020

With the same input as reported in #31, after I applied a candidate fix to get around the error there, I hit another error:

Aperture size plots... done.
Downloading https://skyview.gsfc.nasa.gov/tempspace/fits/skv2260287077344.fits
|===========================================| 371k/371k (100.00%)         0s
Traceback (most recent call last):
  File "C:\pkg\_winNonPortables\Anaconda3\envs\LATTE-dev\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\pkg\_winNonPortables\Anaconda3\envs\LATTE-dev\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\dev\_juypter\LATTE\LATTE\__main__.py", line 544, in <module>
    utils.interact_LATTE_FFI(tic, indir, syspath, sectors_all, sectors, ra, dec, args)
  File "C:\dev\_juypter\LATTE\LATTE\LATTEutils.py", line 2111, in interact_LATTE_FFI
    brew.brew_LATTE_FFI(tic, indir, syspath, transit_list, simple, BLS, model, save, DV, sectors, sectors_all, alltime0, allflux_list, allflux_small, allflux0, all_md, allfbkg, allfbkg_t, start_sec, end_sec, in_sec, X1_list, X4_list, apmask_list, arrshape_list, tpf_filt_list, t_list, bkg_list, tpf_list, ra, dec, args)
  File "C:\dev\_juypter\LATTE\LATTE\LATTEbrew.py", line 558, in brew_LATTE_FFI
    tessmag, teff, srad, mstar,vmag, logg, plx, c_id = utils.plot_TESS_stars(tic,indir, transit_sec, tpf_list, args)
  File "C:\dev\_juypter\LATTE\LATTE\LATTEutils.py", line 5179, in plot_TESS_stars
    tup = (np.nanmean(tpf[1].data['FLUX'], axis=0),tpf_wcs)
AttributeError: 'TessTargetPixelFile' object has no attribute 'data'

Versions:

  • LATTE: LATTE-dev latest with candidate fix
  • Lightkurve: v1.11.1
  • numpy: 1.19.2
  • platform: Windows
@orionlee
Copy link
Author

orionlee commented Oct 31, 2020

The line that failed:

tup = (np.nanmean(tpf[1].data['FLUX'], axis=0),tpf_wcs)

If it's reverted back to the older commit, it'd work:

    tup = (np.nanmean(tpf[1].flux, axis=0),tpf_wcs)

If the intent is to get the FITS files' raw flux without any Lightkurve processing, it would be:

    tup = (np.nanmean(tpf[1].hdu[1].data['FLUX'], axis=0),tpf_wcs)

The commit 859a8cc has made similar changes in other parts of the codebase.

It looks like

  • in some case (e.g., interactive, no FFI), tpf[1] is of type BinTableHDU. Accessing flux with .data['FLUX'] would work
  • in some case (e.g., FFI), tpf[1] is of type TessTargetPixelFile. Accessing flux would need to be .flux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant