Giter Club home page Giter Club logo

exovetter's People

Contributors

fergalm avatar m-dallas avatar mustaric avatar pllim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

exovetter's Issues

Vetter.run() should accept keyword argument plot

The current design of a vetter is

class Vetter:
    def run():
        pass

    def plot():
        pass 

The thinking was that computing metrics and plotting results were two separate operations. We've discovered that plotting typically happens deep inside the code wrapped by the class, and we had to store a lot of intermediate data in the vetter, violating the principle of encapsulation.

A better way to do things is to have

def run(self, tce, lc, plot=False):
     ...

The plot keyword can then be passed into the code executing the logic. We can then get rid of the plot method

Add comparision to catalog position for Centroid Vetting

Veselin pointed out that It might be worth adding to the code a difference image comparison between the measured In-Transit centroid and the catalog position of the target from e.g. Gaia instead of the IT vs OOT centroids. I’ve often noticed that the large TESS pixels and corresponding contamination from nearby field stars can make the IT vs OOT comparison highly challenging (or even downright meaningless). The downside for a comparison with Gaia is that the proper motion needs to be properly taken into account, but this would be a small price to pay.

Data handling

I think this was what we decided to do? Feel free to edit if I got it wrong.

  • Store data somewhere sanctioned by STScI. Also see this STScI style guide about storing data. OR we can simply grab it from the other repository currently holding it (SourceForge?).
  • Use astropy caching mechanism to handle its download and caching.
  • There should be a helper function to check if it is already cached. If so, use cached copy. If not, do the download from a pre-determined location and cache it; i.e., using astropy.utils.data.download_file(..., cache=True).
  • There will be no automatic cache invalidation. That is, if user wants to re-download, user needs to explicitly tells the function to do so; i.e., astropy.utils.data.download_file(..., cache='update') to force an update to the existing cache.

@mustaric will provide the data. @jbcurtin will implement the functionality.

BUG: LPP vetter needs to play nice with refactored Tce class

Follow up of #26 and #33 .

This needs fixing:

exovetter/exovetter/lpp.py

Lines 351 to 356 in c8b64ef

# FIXME: This looks more correct but fails the test.
# from exovetter import const as exo_const
# self.tzero = tce.get_epoch(
# getattr(exo_const, lc.time_format)).to_value(u.day)
self.tzero = tce['epoch'].to_value(u.day)

This test needs to be updated:

tzero = (54953.6193 + 2400000.5 - 2454833.0) * u.day

But I don't know what is going on with tzero in the test, so maybe @mustaric or @fergalm can fix it properly.

[model.py] Refactor to use astropy.modeling or at least a class

Currently, the instruction is to create two functions for each model (#26). Why can't we:

  1. Make each model a class with constructor taking fundamental inputs (arrays, etc) and a separate class method to take TCE?
  2. Inherit from astropy.modeling.models base class by taking advantage of its ability to specify custom models.
  3. And if we want to enable the machinery beyond boxcar and trapezoid, define an abstract base class for all models (existing and future).

Sweet vetter

Goal: Bring the sweet vetter into exovetter.
Submitted by: @mustaric (See below for details.)

https://github.com/exoplanetvetting/DAVE/blob/master/tessPipeline/sweet.py

It was written by @fergalm . The top function is runSweetTest which basically just runs computeSweetMetrics which returns a 3x3 array. I think we want exovetter to return that 3x3 array. We don’t need to keep the messages. As a result we also don’t need to input threshold_sigma.

The period, epoch and duration inputs can be replaced with the tce dictionary we created. And the time and flux should be input as a lightkurve object, like we did for lpp.

Set up CI

Probably GitHub Actions unless we need internal access. Blocked by #1.

BUG: vetter run methods return inconsistent results

From base class:

Returns
-------
result : dict
A dictionary of metric values.

Example implementation in ModShift (returns None):

self.modshift = metrics

Example implementation in Lpp (returns dict):

# TODO: Do we really need to return anything if everything is stored as
# instance attributes anyway?
return {
'raw_lpp': self.raw_lpp,
'norm_lpp': self.norm_lpp,
'plot_data': self.plot_data}

Add Phase Coverage vetter

Add a vetter that returns the fraction of the folded transit that contains data. Sparsely sampled transits end to be noise. This requires knowing the duration of the tce.

odd even phasing is wrong

The folding for the odd even test returns the wrong phase. This probably happened when we switched to only one way to fold at the period of the tce. It would be good to check the other phased tests are also at the correct phase.

Add odd/even test

Add a vetter that takes a light curve and tce and determine the difference between the depths of the odd and the even transits. It should return both depths and the errors. Usually a cut is made when significant depth differences are seen.

The astropy BLS code actually is one path forward for this test.

Define interface for TCE Class

As part of this find a way for users to input TCE information in natural Kepler units or in natural TESS units and then have the class convert these to the generic TCE inputs.
@fergalm

Add MJD to exo const

We should add the MJD offset to the exo const function.

mjd = bjd - 2_400_000.5. * u.day
"""MJD"""

ENH: Use astropy units and Quantity

astropy units and Quantity is useful because it keeps track of the units for you and works pretty well with Numpy arrays (except for some known issues). Things like trapezoid_fit (see also #14) could benefit from it.

Pros:

  • Automatic units bookkeeping. For example, we can get rid of warnings like "must pass in value as hours, not days" and reduce to risk of wrong calculations due to user error. You would be able to pass in either hours or days (or anything that can convert to them for that matter) and not have to worry about wrong results.
  • Works well with Numpy arrays.

Cons:

  • Extra computation overhead. There are some performance tips but some overhead is unavoidable. Units bookkeeping does not come for free.
  • Risk of introducing new bugs during refactoring. Some existing magic numbers need to be well understood and/or eliminated. For example, is that 1.0e6 used to convert units or for something else?
  • scipy.optimize cannot understand astropy units and Quantity, so the units still need to be stripped before that is called and then re-applied. It is important that we convert the Quantity to expected units before stripping the units.

Do the benefits outweigh the costs?

Improve Vetter Plots

VizTransits Folder
-- Getting negative phases
-- mark where the transit is supposed to be
-- change automatic selection of binning, so it always does some binning. Select based on whole lc not just in transit.
-- change dimensions of the folded light curve page size, should be wider.
VizTransits individual transits plot
-- increase distance between plots (2x depth or noise?) so they don't overlap.

ModShift is not working, why?

Add outlier rejection to light curve before creating the VizTransit plots.?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.