exovetter 0.0.1__tar.gz → 0.0.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. exovetter-0.0.3/.bandit.yaml +2 -0
  2. exovetter-0.0.3/.github/workflows/ci_workflows.yml +74 -0
  3. exovetter-0.0.3/.github/workflows/publish.yml +38 -0
  4. exovetter-0.0.3/.readthedocs.yml +30 -0
  5. exovetter-0.0.3/PKG-INFO +89 -0
  6. {exovetter-0.0.1 → exovetter-0.0.3}/README.rst +13 -1
  7. {exovetter-0.0.1 → exovetter-0.0.3}/docs/index.rst +3 -1
  8. exovetter-0.0.3/docs/install.rst +52 -0
  9. exovetter-0.0.3/docs/utils.rst +23 -0
  10. exovetter-0.0.3/docs/vetters.rst +11 -0
  11. exovetter-0.0.3/docs/vetters_low_level.rst +40 -0
  12. exovetter-0.0.3/example_notebooks/Centorid_Vetting_Example.ipynb +222 -0
  13. exovetter-0.0.3/example_notebooks/Centroid_Vetting_Example.ipynb +570 -0
  14. exovetter-0.0.3/example_notebooks/TCE_example.ipynb +483 -0
  15. exovetter-0.0.3/example_notebooks/current_vetter_examples/._wasp18b_lc.fits +0 -0
  16. exovetter-0.0.3/example_notebooks/current_vetter_examples/centroid_example.ipynb +22169 -0
  17. exovetter-0.0.3/example_notebooks/current_vetter_examples/lpp_example.ipynb +2159 -0
  18. exovetter-0.0.3/example_notebooks/current_vetter_examples/modshift_example.ipynb +2178 -0
  19. exovetter-0.0.3/example_notebooks/current_vetter_examples/obtaining_a_TCE_and_lightcurve.ipynb +333 -0
  20. exovetter-0.0.3/example_notebooks/current_vetter_examples/odd_even_example.ipynb +2183 -0
  21. exovetter-0.0.3/example_notebooks/current_vetter_examples/sweet_example.ipynb +2170 -0
  22. exovetter-0.0.3/example_notebooks/current_vetter_examples/transit_events_testing.ipynb +383 -0
  23. exovetter-0.0.3/example_notebooks/current_vetter_examples/transit_phase_coverage_example.ipynb +2168 -0
  24. exovetter-0.0.3/example_notebooks/current_vetter_examples/viz_transits_example.ipynb +3169 -0
  25. exovetter-0.0.3/example_notebooks/current_vetter_examples/wasp18b_lc.fits +192 -0
  26. exovetter-0.0.3/example_notebooks/current_vetter_examples/wasp18b_tce +1 -0
  27. exovetter-0.0.3/example_notebooks/exovetter_centroid_and_plotting_example.ipynb +1036 -0
  28. exovetter-0.0.3/example_notebooks/exovetter_robovetting_example.ipynb +747 -0
  29. exovetter-0.0.3/example_notebooks/trapezoid_fit_simple.ipynb +351 -0
  30. {exovetter-0.0.1 → exovetter-0.0.3}/exovetter/__init__.py +4 -1
  31. exovetter-0.0.3/exovetter/centroid/__init__.py +1 -0
  32. exovetter-0.0.3/exovetter/centroid/centroid.py +310 -0
  33. exovetter-0.0.3/exovetter/centroid/covar.py +272 -0
  34. exovetter-0.0.3/exovetter/centroid/disp.py +157 -0
  35. exovetter-0.0.3/exovetter/centroid/fastpsffit.py +187 -0
  36. exovetter-0.0.3/exovetter/const.py +49 -0
  37. exovetter-0.0.3/exovetter/leo.py +226 -0
  38. exovetter-0.0.3/exovetter/lightkurve_utils.py +47 -0
  39. exovetter-0.0.3/exovetter/lpp.py +429 -0
  40. exovetter-0.0.3/exovetter/model.py +125 -0
  41. exovetter-0.0.3/exovetter/modshift/__init__.py +2 -0
  42. exovetter-0.0.3/exovetter/modshift/modshift.py +456 -0
  43. exovetter-0.0.3/exovetter/modshift/plotmodshift.py +97 -0
  44. exovetter-0.0.3/exovetter/odd_even.py +256 -0
  45. exovetter-0.0.3/exovetter/sweet.py +106 -0
  46. exovetter-0.0.3/exovetter/tce.py +230 -0
  47. exovetter-0.0.3/exovetter/transit_coverage.py +88 -0
  48. exovetter-0.0.3/exovetter/trapezoid_fit.py +934 -0
  49. exovetter-0.0.3/exovetter/utils.py +616 -0
  50. {exovetter-0.0.1 → exovetter-0.0.3}/exovetter/version.py +1 -1
  51. exovetter-0.0.3/exovetter/vetters.py +952 -0
  52. exovetter-0.0.3/exovetter/viz_transits.py +181 -0
  53. exovetter-0.0.3/exovetter.egg-info/PKG-INFO +89 -0
  54. exovetter-0.0.3/exovetter.egg-info/SOURCES.txt +74 -0
  55. exovetter-0.0.3/exovetter.egg-info/requires.txt +18 -0
  56. exovetter-0.0.3/licenses/DAVE_LICENSE +21 -0
  57. exovetter-0.0.3/new_example_notebooks/TCEs.ipynb +359 -0
  58. exovetter-0.0.3/new_example_notebooks/lightcurves.ipynb +33 -0
  59. exovetter-0.0.3/new_example_notebooks/wasp18b_tce +1 -0
  60. exovetter-0.0.3/requirements.txt +13 -0
  61. {exovetter-0.0.1 → exovetter-0.0.3}/setup.cfg +24 -3
  62. exovetter-0.0.1/.readthedocs.yml +0 -21
  63. exovetter-0.0.1/PKG-INFO +0 -64
  64. exovetter-0.0.1/conftest.py +0 -28
  65. exovetter-0.0.1/docs/api.rst +0 -5
  66. exovetter-0.0.1/docs/install.rst +0 -5
  67. exovetter-0.0.1/exovetter.egg-info/PKG-INFO +0 -64
  68. exovetter-0.0.1/exovetter.egg-info/SOURCES.txt +0 -26
  69. exovetter-0.0.1/exovetter.egg-info/requires.txt +0 -8
  70. {exovetter-0.0.1 → exovetter-0.0.3}/.gitignore +0 -0
  71. {exovetter-0.0.1 → exovetter-0.0.3}/CHANGES.rst +0 -0
  72. {exovetter-0.0.1 → exovetter-0.0.3}/LICENSE.rst +0 -0
  73. {exovetter-0.0.1 → exovetter-0.0.3}/MANIFEST.in +0 -0
  74. {exovetter-0.0.1 → exovetter-0.0.3}/docs/Makefile +0 -0
  75. {exovetter-0.0.1 → exovetter-0.0.3}/docs/conf.py +0 -0
  76. {exovetter-0.0.1 → exovetter-0.0.3}/docs/make.bat +0 -0
  77. {exovetter-0.0.1 → exovetter-0.0.3}/exovetter.egg-info/dependency_links.txt +0 -0
  78. {exovetter-0.0.1 → exovetter-0.0.3}/exovetter.egg-info/not-zip-safe +0 -0
  79. {exovetter-0.0.1 → exovetter-0.0.3}/exovetter.egg-info/top_level.txt +0 -0
  80. {exovetter-0.0.1 → exovetter-0.0.3}/licenses/README.rst +0 -0
  81. {exovetter-0.0.1 → exovetter-0.0.3}/licenses/TEMPLATE_LICENCE.rst +0 -0
  82. {exovetter-0.0.1 → exovetter-0.0.3}/pyproject.toml +0 -0
  83. {exovetter-0.0.1 → exovetter-0.0.3}/setup.py +0 -0
@@ -0,0 +1,2 @@
1
+ exclude_dirs:
2
+ - tests
@@ -0,0 +1,74 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+
11
+ jobs:
12
+ pep_and_audit:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: Checkout code
16
+ uses: actions/checkout@v4
17
+ - name: Set up Python
18
+ uses: actions/setup-python@v4
19
+ with:
20
+ python-version: '3.x'
21
+ - name: Lint with pyflakes
22
+ run: |
23
+ python -m pip install --upgrade pip pyflakes
24
+ pyflakes
25
+ # Make sure that packaging will work
26
+ - name: pep517 build
27
+ run: |
28
+ python -m pip install --upgrade setuptools build twine
29
+ python -m build --sdist .
30
+ twine check dist/*
31
+ # This test turned off for the moment
32
+ #- name: Security audit
33
+ # run: |
34
+ # python -m pip install --upgrade bandit
35
+ # bandit -r . -c .bandit.yaml
36
+
37
+ initial_tests:
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - name: Checkout code
41
+ uses: actions/checkout@v4
42
+ - name: Set up Python
43
+ uses: actions/setup-python@v4
44
+ with:
45
+ python-version: '3.11'
46
+ - name: Install and build
47
+ run: |
48
+ sudo apt-get install libxml2-utils
49
+ python -m pip install --upgrade pip setuptools
50
+ python -m pip install -e .[test,all]
51
+ - name: Test with stable deps and coverage
52
+ run: pytest --remote-data
53
+ # run: pytest --cov=./ --cov-report=xml --remote-data
54
+ # - name: Coverage report
55
+ # uses: codecov/codecov-action@v3
56
+
57
+ # dev_deps_tests:
58
+ # runs-on: ubuntu-latest
59
+ # steps:
60
+ # - name: Checkout code
61
+ # uses: actions/checkout@v4
62
+ # - name: Set up Python
63
+ # uses: actions/setup-python@v4
64
+ # with:
65
+ # python-version: '3.x'
66
+ # - name: Install and build
67
+ # run: |
68
+ # sudo apt-get install libxml2-utils
69
+ # python -m pip install --upgrade pip setuptools
70
+ # python -m pip install git+https://github.com/astropy/astropy.git@main#egg=astropy
71
+ # python -m pip install git+https://github.com/lightkurve/lightkurve.git@main#egg=lightkurve
72
+ # python -m pip install -e .[test,all]
73
+ # - name: Test with dev deps
74
+ # run: pytest --remote-data
@@ -0,0 +1,38 @@
1
+ name: Release
2
+
3
+ on:
4
+ release:
5
+ types: [released]
6
+
7
+ jobs:
8
+ build-n-publish:
9
+ name: Build and publish Python 🐍 distributions 📦 to PyPI
10
+ runs-on: ubuntu-latest
11
+ if: github.repository == 'spacetelescope/exovetter'
12
+
13
+ steps:
14
+ - uses: actions/checkout@v2
15
+ with:
16
+ fetch-depth: 0
17
+
18
+ - uses: actions/setup-python@v2
19
+ with:
20
+ python-version: 3.8
21
+
22
+ - name: Install python-build and twine
23
+ run: python -m pip install build "twine>=3.3"
24
+
25
+ - name: Build package
26
+ run: python -m build --sdist --wheel .
27
+
28
+ - name: List result
29
+ run: ls -l dist
30
+
31
+ - name: Check dist
32
+ run: python -m twine check --strict dist/*
33
+
34
+ - name: Publish distribution 📦 to PyPI
35
+ uses: pypa/gh-action-pypi-publish@master
36
+ with:
37
+ user: __token__
38
+ password: ${{ secrets.PYPI_TOKEN }}
@@ -0,0 +1,30 @@
1
+ # Read the Docs configuration file for Sphinx projects
2
+ # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3
+
4
+ # Required
5
+ version: 2
6
+
7
+ # Set the OS, Python version and other tools you might need
8
+ build:
9
+ os: ubuntu-22.04
10
+ apt_packages:
11
+ - graphviz
12
+ tools:
13
+ python: "3.11"
14
+
15
+ # Build documentation in the "docs/" directory with Sphinx
16
+ sphinx:
17
+ builder: html
18
+ configuration: docs/conf.py
19
+ fail_on_warning: true
20
+
21
+ python:
22
+ install:
23
+ - method: pip
24
+ path: .
25
+ extra_requirements:
26
+ - docs
27
+ - all
28
+
29
+ # Don't build any extra formats
30
+ formats: []
@@ -0,0 +1,89 @@
1
+ Metadata-Version: 2.1
2
+ Name: exovetter
3
+ Version: 0.0.3
4
+ Summary: Exoplanet vetting package
5
+ Home-page: https://github.com/spacetelescope/exovetter
6
+ Author: Susan Mullally et al.
7
+ Author-email: smullally@stsci.edu
8
+ License: BSD 3-Clause
9
+ Requires-Python: >=3.7
10
+ Description-Content-Type: text/x-rst
11
+ License-File: LICENSE.rst
12
+ Requires-Dist: numpy
13
+ Requires-Dist: astropy>=3
14
+ Requires-Dist: scipy
15
+ Provides-Extra: all
16
+ Requires-Dist: matplotlib; extra == "all"
17
+ Requires-Dist: scikit-learn; extra == "all"
18
+ Requires-Dist: lightkurve>=2; extra == "all"
19
+ Requires-Dist: lpproj; extra == "all"
20
+ Provides-Extra: test
21
+ Requires-Dist: pytest-cov; extra == "test"
22
+ Requires-Dist: pytest-remotedata; extra == "test"
23
+ Requires-Dist: pytest-doctestplus; extra == "test"
24
+ Provides-Extra: docs
25
+ Requires-Dist: sphinx-astropy; extra == "docs"
26
+ Requires-Dist: sphinx_rtd_theme; extra == "docs"
27
+
28
+ exovetter: Exoplanet Vetting
29
+ ============================
30
+
31
+ .. image:: https://readthedocs.org/projects/exovetter/badge/?version=latest
32
+ :target: https://exovetter.readthedocs.io/en/latest/?badge=latest
33
+ :alt: Documentation Status
34
+
35
+ .. image:: https://github.com/spacetelescope/exovetter/workflows/CI/badge.svg
36
+ :target: https://github.com/spacetelescope/exovetter/actions
37
+ :alt: Github Actions CI Status
38
+
39
+ .. image:: https://codecov.io/gh/spacetelescope/exovetter/branch/master/graph/badge.svg?token=H3UC4Q0H6R
40
+ :target: https://codecov.io/gh/spacetelescope/exovetter
41
+ :alt: Coverage report
42
+
43
+ .. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
44
+ :target: http://www.astropy.org
45
+ :alt: Powered by Astropy Badge
46
+
47
+ This is a Python package for exoplanet vetting.
48
+
49
+ License
50
+ -------
51
+
52
+ This project is Copyright (c) Space Telescope Science Institute and licensed
53
+ under the terms of the BSD 3-Clause license. This package is based upon
54
+ the `Astropy package template <https://github.com/astropy/package-template>`_
55
+ which is licensed under the BSD 3-clause license. See `LICENSE.rst` and
56
+ the licenses folder for more information.
57
+
58
+
59
+ Contributing
60
+ ------------
61
+
62
+ We love contributions! exovetter is open source,
63
+ built on open source, and we'd love to have you hang out in our community.
64
+
65
+ **Imposter syndrome disclaimer**: We want your help. No, really.
66
+
67
+ There may be a little voice inside your head that is telling you that you're not
68
+ ready to be an open source contributor; that your skills aren't nearly good
69
+ enough to contribute. What could you possibly offer a project like this one?
70
+
71
+ We assure you - the little voice in your head is wrong. If you can write code at
72
+ all, you can contribute code to open source. Contributing to open source
73
+ projects is a fantastic way to advance one's coding skills. Writing perfect code
74
+ isn't the measure of a good developer (that would disqualify all of us!); it's
75
+ trying to create something, making mistakes, and learning from those
76
+ mistakes. That's how we all improve, and we are happy to help others learn.
77
+
78
+ Being an open source contributor doesn't just mean writing code, either. You can
79
+ help out by writing documentation, tests, or even giving feedback about the
80
+ project (and yes - that includes giving feedback about the contribution
81
+ process). Some of these contributions may be the most valuable to the project as
82
+ a whole, because you're coming to the project with fresh eyes, so you can see
83
+ the errors and assumptions that seasoned contributors have glossed over.
84
+
85
+ Note: This disclaimer was originally written by
86
+ `Adrienne Lowe <https://github.com/adriennefriend>`_ for a
87
+ `PyCon talk <https://www.youtube.com/watch?v=6Uj746j9Heo>`_, and was adapted by
88
+ exovetter based on its use in the README file for the
89
+ `MetPy project <https://github.com/Unidata/MetPy>`_.
@@ -1,5 +1,17 @@
1
1
  exovetter: Exoplanet Vetting
2
- ----------------------------
2
+ ============================
3
+
4
+ .. image:: https://readthedocs.org/projects/exovetter/badge/?version=latest
5
+ :target: https://exovetter.readthedocs.io/en/latest/?badge=latest
6
+ :alt: Documentation Status
7
+
8
+ .. image:: https://github.com/spacetelescope/exovetter/workflows/CI/badge.svg
9
+ :target: https://github.com/spacetelescope/exovetter/actions
10
+ :alt: Github Actions CI Status
11
+
12
+ .. image:: https://codecov.io/gh/spacetelescope/exovetter/branch/master/graph/badge.svg?token=H3UC4Q0H6R
13
+ :target: https://codecov.io/gh/spacetelescope/exovetter
14
+ :alt: Coverage report
3
15
 
4
16
  .. image:: http://img.shields.io/badge/powered%20by-AstroPy-orange.svg?style=flat
5
17
  :target: http://www.astropy.org
@@ -8,4 +8,6 @@ exovetter
8
8
  :maxdepth: 2
9
9
 
10
10
  install
11
- api
11
+ vetters
12
+ vetters_low_level
13
+ utils
@@ -0,0 +1,52 @@
1
+ .. _install_instructions:
2
+
3
+ ============
4
+ Installation
5
+ ============
6
+
7
+ ``exovetter`` requires the following packages on install:
8
+
9
+ * numpy
10
+ * astropy
11
+ * scipy
12
+
13
+ We also recommend you have the following packages install to access all the
14
+ functionality that ``exovetter`` provides:
15
+
16
+ * matplotlib
17
+ * scikit-learn
18
+ * lightkurve
19
+ * lpproj
20
+
21
+ .. _install_stable:
22
+
23
+ Install the Stable Version
24
+ ==========================
25
+
26
+ .. warning:: Do not use the released version yet. This package is still in heavy development. See :ref:`install_dev` instead.
27
+
28
+ To install the released version from PyPI::
29
+
30
+ pip install exovetter[all]
31
+
32
+ .. _install_dev:
33
+
34
+ Install the Development Version
35
+ ===============================
36
+
37
+ First, clone this repository to your local machine::
38
+
39
+ git clone https://github.com/spacetelescope/exovetter.git
40
+
41
+ Then, in the source directory, do the following to install it as an
42
+ "editable" install, along with all the dependencies::
43
+
44
+ pip install -e .[test,docs,all]
45
+
46
+ Post-Install
47
+ ============
48
+
49
+ To see whether your installation is successful, you can try to import the
50
+ package in a Python session:
51
+
52
+ >>> import exovetter
@@ -0,0 +1,23 @@
1
+ .. _utils:
2
+
3
+ ===============
4
+ Utility Modules
5
+ ===============
6
+
7
+ These provide low-level functionality for ``exovetter``.
8
+
9
+ .. automodapi:: exovetter.const
10
+ :no-inheritance-diagram:
11
+ :include-all-objects:
12
+
13
+ .. automodapi:: exovetter.model
14
+ :no-inheritance-diagram:
15
+
16
+ .. automodapi:: exovetter.lightkurve_utils
17
+ :no-inheritance-diagram:
18
+
19
+ .. automodapi:: exovetter.trapezoid_fit
20
+ :no-inheritance-diagram:
21
+
22
+ .. automodapi:: exovetter.utils
23
+ :no-inheritance-diagram:
@@ -0,0 +1,11 @@
1
+ .. _vetters-main:
2
+
3
+ =======
4
+ Vetters
5
+ =======
6
+
7
+ ``exovetter`` provides the following vetters that are built upon
8
+ :ref:`vetters-building-blocks`.
9
+
10
+ .. automodapi:: exovetter.vetters
11
+ :no-main-docstr:
@@ -0,0 +1,40 @@
1
+ .. _vetters-building-blocks:
2
+
3
+ =======================
4
+ Vetters Building Blocks
5
+ =======================
6
+
7
+ The high-level vetter classes in :ref:`vetters-main` utilize lower level
8
+ implementations laid out in :ref:`vetters-low-level` and pass around a data
9
+ structure for Threshold Crossing Event (TCE) as documented in
10
+ :ref:`vetters_tce_data_structure`.
11
+
12
+
13
+ .. _vetters-low-level:
14
+
15
+ Low-Level Vetter API
16
+ ====================
17
+
18
+ .. automodapi:: exovetter.lpp
19
+ :no-inheritance-diagram:
20
+
21
+ .. automodapi:: exovetter.modshift
22
+ :no-inheritance-diagram:
23
+
24
+ .. automodapi:: exovetter.odd_even
25
+ :no-inheritance-diagram:
26
+
27
+ .. automodapi:: exovetter.sweet
28
+ :no-inheritance-diagram:
29
+
30
+ .. automodapi:: exovetter.transit_coverage
31
+ :no-inheritance-diagram:
32
+
33
+
34
+ .. _vetters_tce_data_structure:
35
+
36
+ Data Structure: Tce Class
37
+ =========================
38
+
39
+ .. automodapi:: exovetter.tce
40
+ :no-inheritance-diagram:
@@ -0,0 +1,222 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "id": "029ab771-1196-408e-a57b-520e813bb764",
6
+ "metadata": {},
7
+ "source": [
8
+ "# Example: Centroid Vetting.\n",
9
+ "### How to look for centroid offset between in and out of transit\n",
10
+ "In this example we show how to use the vetting module to visualize the transit and take the difference between the in transit and out of transit to determine if there is a centroid offset between the two."
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 1,
16
+ "id": "3c1ea491-efeb-4662-9f9f-84a5327229f3",
17
+ "metadata": {},
18
+ "outputs": [],
19
+ "source": [
20
+ "import numpy\n",
21
+ "import matplotlib\n",
22
+ "import exovetter as exo\n",
23
+ "from exovetter import const\n",
24
+ "from exovetter import utils\n",
25
+ "import exovetter.vetters as vet\n",
26
+ "import lightkurve as lk\n",
27
+ "import astropy.units as u"
28
+ ]
29
+ },
30
+ {
31
+ "cell_type": "code",
32
+ "execution_count": 2,
33
+ "id": "e6212cc7-f877-40fb-9d61-618d751f4df6",
34
+ "metadata": {},
35
+ "outputs": [],
36
+ "source": [
37
+ "#Name of our first TOI Example\n",
38
+ "candidate = \"TOI 1013.01\""
39
+ ]
40
+ },
41
+ {
42
+ "cell_type": "markdown",
43
+ "id": "d69d0c9d-ed1b-4a6c-a8cb-a62cf09b1bc3",
44
+ "metadata": {},
45
+ "source": [
46
+ "### Use a utility function get_mast_tce to get the properties of the candidate and put into a tce."
47
+ ]
48
+ },
49
+ {
50
+ "cell_type": "code",
51
+ "execution_count": 3,
52
+ "id": "9be9771e-7a96-4867-8df4-2b603e453ed3",
53
+ "metadata": {},
54
+ "outputs": [
55
+ {
56
+ "data": {
57
+ "text/plain": [
58
+ "[{'period': <Quantity 5.42555479 d>,\n",
59
+ " 'epoch': <Quantity 58493.86798 d>,\n",
60
+ " 'epoch_offset': <Quantity -2400000.5 d>,\n",
61
+ " 'depth': <Quantity 0.01493963>,\n",
62
+ " 'duration': <Quantity 0.15745833 d>,\n",
63
+ " 'target': 'TOI 1013.01'}]"
64
+ ]
65
+ },
66
+ "execution_count": 3,
67
+ "metadata": {},
68
+ "output_type": "execute_result"
69
+ }
70
+ ],
71
+ "source": [
72
+ "tce = utils.get_mast_tce(candidate)\n"
73
+ ]
74
+ },
75
+ {
76
+ "cell_type": "markdown",
77
+ "id": "4ba5953d-50f5-40ac-9973-4bce4927f039",
78
+ "metadata": {},
79
+ "source": [
80
+ "### Grab the light curve using lightkurve"
81
+ ]
82
+ },
83
+ {
84
+ "cell_type": "code",
85
+ "execution_count": null,
86
+ "id": "56e7d673-878b-4ebb-9d6d-71b442547a73",
87
+ "metadata": {},
88
+ "outputs": [],
89
+ "source": [
90
+ "lc = lk.search_lightcurve(candidate, sector=33, exptime=120).download()\n",
91
+ "lc.plot()"
92
+ ]
93
+ },
94
+ {
95
+ "cell_type": "code",
96
+ "execution_count": null,
97
+ "id": "254d0d3f-c1b3-4663-a2c2-38713c6dcb86",
98
+ "metadata": {},
99
+ "outputs": [],
100
+ "source": [
101
+ "#Visualize the transits\n",
102
+ "#Initiate the vetter\n",
103
+ "viz = vet.VizTransits()\n",
104
+ "\n",
105
+ "#Run the vetter on the tce and lightcurve of your choice.\n",
106
+ "viz.run(tce[0], lc, plot=True)"
107
+ ]
108
+ },
109
+ {
110
+ "cell_type": "markdown",
111
+ "id": "cc645b95-4488-45a1-ab74-a5105f0039ea",
112
+ "metadata": {},
113
+ "source": [
114
+ "## Run the Centroid Vetter\n",
115
+ "The Centroid Vetter is run in the same way. It returns the average offset and significance that it is on the target.\n",
116
+ "You get several plots showing the out of transits, in transit and difference image. The centroids of each are measured using a Gaussian.\n",
117
+ "For the OOT and In-Transit, the centroid is constrained to the central +/-1pixel in box row and column direction.\n",
118
+ "As input, the Centroid Vetter requires a Target Pixel File objects from lightkurve.\n",
119
+ "\n",
120
+ "This example shows no significant offset between the out of transit location and the difference image centroid."
121
+ ]
122
+ },
123
+ {
124
+ "cell_type": "code",
125
+ "execution_count": null,
126
+ "id": "85219b48-3ca3-42d2-a0c4-a6aabf2df99b",
127
+ "metadata": {},
128
+ "outputs": [],
129
+ "source": [
130
+ "\n",
131
+ "tpf = lk.search_targetpixelfile(candidate, sector=33, exptime=120).download()\n",
132
+ "cent = vet.Centroid()\n",
133
+ "cent.run(tce[0],tpf, plot=True)"
134
+ ]
135
+ },
136
+ {
137
+ "cell_type": "markdown",
138
+ "id": "d02f48c6-9c09-4d06-84cd-7f82ac711b64",
139
+ "metadata": {},
140
+ "source": [
141
+ "## Example 2. An example with a small put possible offset.\n",
142
+ "Here we will do the same thing on TOI 565.01"
143
+ ]
144
+ },
145
+ {
146
+ "cell_type": "code",
147
+ "execution_count": null,
148
+ "id": "26ac4dd8-600e-4eac-adf4-4536a8057dae",
149
+ "metadata": {},
150
+ "outputs": [],
151
+ "source": [
152
+ "candidate = \"TOI 565.01\"\n",
153
+ "tce = utils.get_mast_tce(candidate)\n",
154
+ "tce"
155
+ ]
156
+ },
157
+ {
158
+ "cell_type": "code",
159
+ "execution_count": null,
160
+ "id": "bb624aac-2c6f-4671-b879-766ab8e8e924",
161
+ "metadata": {},
162
+ "outputs": [],
163
+ "source": [
164
+ "lc = lk.search_lightcurve(candidate)[0].download()\n",
165
+ "lc.plot()"
166
+ ]
167
+ },
168
+ {
169
+ "cell_type": "code",
170
+ "execution_count": null,
171
+ "id": "f9b699d3-22b4-4f0d-a7df-c64421a40445",
172
+ "metadata": {},
173
+ "outputs": [],
174
+ "source": [
175
+ "viz = vet.VizTransits(max_transits=8)\n",
176
+ "viz.run(tce[0],lc, plot=True, )"
177
+ ]
178
+ },
179
+ {
180
+ "cell_type": "code",
181
+ "execution_count": null,
182
+ "id": "ce1e2dcc-2ec1-4e85-8278-38f40464541d",
183
+ "metadata": {},
184
+ "outputs": [],
185
+ "source": [
186
+ "#Examine difference images and measure centroids\n",
187
+ "tpf = lk.search_targetpixelfile(candidate)[0].download()\n",
188
+ "cent = vet.Centroid()\n",
189
+ "cent.run(tce[0],tpf,plot=True)"
190
+ ]
191
+ },
192
+ {
193
+ "cell_type": "code",
194
+ "execution_count": null,
195
+ "id": "c1451eae",
196
+ "metadata": {},
197
+ "outputs": [],
198
+ "source": []
199
+ }
200
+ ],
201
+ "metadata": {
202
+ "kernelspec": {
203
+ "display_name": "Python 3 (ipykernel)",
204
+ "language": "python",
205
+ "name": "python3"
206
+ },
207
+ "language_info": {
208
+ "codemirror_mode": {
209
+ "name": "ipython",
210
+ "version": 3
211
+ },
212
+ "file_extension": ".py",
213
+ "mimetype": "text/x-python",
214
+ "name": "python",
215
+ "nbconvert_exporter": "python",
216
+ "pygments_lexer": "ipython3",
217
+ "version": "3.11.3"
218
+ }
219
+ },
220
+ "nbformat": 4,
221
+ "nbformat_minor": 5
222
+ }