question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add aperture_mask as a class attribute to LightCurve

See original GitHub issue

The aperture mask is a part of the provenance of any Kepler/K2/TESS lightcurve procured through conventional aperture photometry conducted with pre-defined or custom-specified apertures. Storing the aperture mask as a piece of lightcurve metadata seems fair, or even natural, to enable the inter-comparison of lightcurves generated through different means.

Issue #265 revealed a strategy for how to store an optional aperture_mask metadata blob:

All the data written by LightCurve.to_fits() are currently stored as class attributes. I think we’ll want the same with aperture_mask, i.e. I think we’ll want aperture_mask to become an optional attribute that can be passed to the constructor of LightCurve? If set, to_fits would then write self.aperture_mask as an optional extension.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
barentsencommented, Nov 19, 2018

My recommendation is to add aperture_mask as an optional argument of lc.to_fits() for now.

I don’t think we want to add it as a class attribute right now. As you point out: it is not clear that an lc.aperture_mask attribute is useful without provenance information.

I think we should focus on our immediate goal of adding a “Save Lightcurve” button to interact, which allows someone to capture the lightcurve and mask in a single fits file. This would be enabled in a very simple and effective way by accepting the mask as an optional argument in to_fits().

It would be too ambitious for Lightkurve v1.0 to provide deep reproducibility features, which is why I think it’s fine to take a pragmatic shortcut here!

0reactions
gullycommented, Dec 7, 2018

After a long discussion we all agreed we do not want to add aperture_mask as an attribute to LightCurve objects. The reason for not including this attribute is resides in the complexity to maintain an optional feature— not all LightCurve objects were created using aperture photometry, and eventually ground-based lightcurves may have different apertures altogether, so the aperture mask meaning is lost, and maybe even misleading. The aperture may also lose meaning when referring to non-standardized data products like TESS Cutout TPFs. KeplerLightCurveFiles on the other hand, are associated with apertures, and already have ways to access their default pipeline masks. Those access methods may be inconvenient (using klcf.hdu[-1].data ==3 doesn’t roll off the tongue), but they’re possible.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add aperture_mask as a class attribute to LightCurve · Issue #341 ...
The aperture mask is a part of the provenance of any Kepler/K2/TESS lightcurve procured through conventional aperture photometry conducted with pre-defined ...
Read more >
Creating your own light curves using custom aperture ...
Understand how to use aperture photometry to turn a series of two-dimensional images into a one-dimensional time series. Be able to determine the...
Read more >
LightCurve objects - TESS Science Support Center - HEASARC
Aperture Photometry is the act of summing up the values of all the pixels in a pre-defined aperture as a function of time....
Read more >
FlareLightCurve — AltaiPony 2.0.0 documentation
Flare light curve class that unifies properties of K2SC -de-trended and Kepler's lightkurve.KeplerLightCurve . Attributes:.
Read more >
eleanor Documentation - Adina Feinstein
Extracts a light curve using the given aperture and TPF. Can pass a user-defined aperture mask, otherwise determines which of a set of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found