Vetting TOI 175 new 4th transiting candidate

TOI-175 is a system composed of at least four planets: three of them are transiting their stellar disk (Kostov et al. ,2019) and one additional non-transiting planet was detected from Radial Velocities (RV) measurements (Demangeon et al. ,2021). A search on this system quickly leads to the finding of a 4th candidate signal of 1.04 days.

Whenever we find a new promising signal in space-based missions data we will have to carry a proper vetting of the data. This is the standard practice by the Science Processing Operations Center (SPOC) with their Data Validation (DV) Reports presented by Twicken et al. (2018) and Li et al. (2018) for the Kepler and TESS missions. In our case, we tried to replicate their DV checks with some oversimplifications. In the vetting execution, watson will check for 1) Odd-even transit shapes, 2) Transit SNR for the different available cadences, 3) Signal harmonic and subharmonic SNRs, 4) Transit source offset from TPFs (both with differential imaging and a watson new algorithm based on BLS phase folding of the TPF per-pixel data), 5) Centroids shift from centroids and motion data, 6) Single transits assessment.

Let’s install watson and go to the execution.

! python3 -m pip install dearwatson
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: dearwatson in /home/martin/.local/lib/python3.8/site-packages (0.4.12)
Requirement already satisfied: cython==0.29.21 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (0.29.21)
Requirement already satisfied: matplotlib==3.5.2 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (3.5.2)
Requirement already satisfied: imageio==2.9.0 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (2.9.0)
Requirement already satisfied: pyparsing==2.4.7 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (2.4.7)
Requirement already satisfied: pyyaml==5.4.1 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (5.4.1)
Requirement already satisfied: lcbuilder==0.10.4 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (0.10.4)
Requirement already satisfied: setuptools>=41.0.0 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (56.0.0)
Requirement already satisfied: bokeh==2.4.2 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (2.4.2)
Requirement already satisfied: configparser==5.0.1 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (5.0.1)
Requirement already satisfied: extension-helpers==0.1 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (0.1)
Requirement already satisfied: reportlab==3.5.59 in /home/martin/.local/lib/python3.8/site-packages (from dearwatson) (3.5.59)
Requirement already satisfied: Jinja2>=2.9 in /home/martin/.local/lib/python3.8/site-packages (from bokeh==2.4.2->dearwatson) (3.1.2)
Requirement already satisfied: packaging>=16.8 in /home/martin/.local/lib/python3.8/site-packages (from bokeh==2.4.2->dearwatson) (23.0)
Requirement already satisfied: numpy>=1.11.3 in /home/martin/.local/lib/python3.8/site-packages (from bokeh==2.4.2->dearwatson) (1.22.4)
Requirement already satisfied: tornado>=5.1 in /home/martin/.local/lib/python3.8/site-packages (from bokeh==2.4.2->dearwatson) (6.2)
Requirement already satisfied: typing-extensions>=3.10.0 in /home/martin/.local/lib/python3.8/site-packages (from bokeh==2.4.2->dearwatson) (4.3.0)
Requirement already satisfied: pillow>=7.1.0 in /home/martin/.local/lib/python3.8/site-packages (from bokeh==2.4.2->dearwatson) (8.1.0)
Requirement already satisfied: wotan==1.9 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.9)
Requirement already satisfied: scipy==1.8.0 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.8.0)
Requirement already satisfied: lightkurve==2.2.0 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (2.2.0)
Requirement already satisfied: statsmodels==0.12.2 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (0.12.2)
Requirement already satisfied: urllib3==1.26.13 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.26.13)
Requirement already satisfied: tess-point==0.6.1 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (0.6.1)
Requirement already satisfied: foldedleastsquares==1.0.36 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.0.36)
Requirement already satisfied: photutils==1.0.2 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.0.2)
Requirement already satisfied: pandas==1.3.1 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.3.1)
Requirement already satisfied: astropy==5.0.4 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (5.0.4)
Requirement already satisfied: everest-pipeline==2.0.12 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (2.0.12)
Requirement already satisfied: torch==1.9.0 in /home/martin/.local/lib/python3.8/site-packages (from lcbuilder==0.10.4->dearwatson) (1.9.0)
Requirement already satisfied: python-dateutil>=2.7 in /home/martin/.local/lib/python3.8/site-packages (from matplotlib==3.5.2->dearwatson) (2.8.1)
Requirement already satisfied: fonttools>=4.22.0 in /home/martin/.local/lib/python3.8/site-packages (from matplotlib==3.5.2->dearwatson) (4.33.2)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/martin/.local/lib/python3.8/site-packages (from matplotlib==3.5.2->dearwatson) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /home/martin/.local/lib/python3.8/site-packages (from matplotlib==3.5.2->dearwatson) (0.10.0)
Requirement already satisfied: pyerfa>=2.0 in /home/martin/.local/lib/python3.8/site-packages (from astropy==5.0.4->lcbuilder==0.10.4->dearwatson) (2.0.0.1)
Requirement already satisfied: george>=0.2.1 in /home/martin/.local/lib/python3.8/site-packages (from everest-pipeline==2.0.12->lcbuilder==0.10.4->dearwatson) (0.4.0)
Requirement already satisfied: pysyzygy>=0.0.2 in /home/martin/.local/lib/python3.8/site-packages (from everest-pipeline==2.0.12->lcbuilder==0.10.4->dearwatson) (0.0.2)
Requirement already satisfied: PyPDF2 in /home/martin/.local/lib/python3.8/site-packages (from everest-pipeline==2.0.12->lcbuilder==0.10.4->dearwatson) (3.0.1)
Requirement already satisfied: six in /home/martin/.local/lib/python3.8/site-packages (from everest-pipeline==2.0.12->lcbuilder==0.10.4->dearwatson) (1.16.0)
Requirement already satisfied: k2plr>=0.2.9 in /home/martin/.local/lib/python3.8/site-packages (from everest-pipeline==2.0.12->lcbuilder==0.10.4->dearwatson) (0.2.9)
Requirement already satisfied: numba in /home/martin/.local/lib/python3.8/site-packages (from foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (0.53.0)
Requirement already satisfied: tqdm in /home/martin/.local/lib/python3.8/site-packages (from foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (4.56.2)
Collecting argparse
  Using cached argparse-1.4.0-py2.py3-none-any.whl (23 kB)
Requirement already satisfied: batman-package in /home/martin/.local/lib/python3.8/site-packages (from foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (2.4.7)
Requirement already satisfied: astroquery>=0.3.9 in /home/martin/.local/lib/python3.8/site-packages (from foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (0.4.6)
Requirement already satisfied: requests>=2.22.0 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (2.25.1)
Requirement already satisfied: memoization>=0.3.1 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (0.3.2)
Requirement already satisfied: uncertainties>=3.1.4 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (3.1.5)
Requirement already satisfied: fbpca>=1.0 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (1.0)
Requirement already satisfied: patsy>=0.5.0 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (0.5.1)
Requirement already satisfied: beautifulsoup4>=4.6.0 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (4.9.3)
Requirement already satisfied: scikit-learn>=0.24.0 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (0.24.1)
Requirement already satisfied: oktopus>=0.1.2 in /home/martin/.local/lib/python3.8/site-packages (from lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (0.1.2)
Requirement already satisfied: pytz>=2017.3 in /home/martin/.local/lib/python3.8/site-packages (from pandas==1.3.1->lcbuilder==0.10.4->dearwatson) (2022.7.1)
Requirement already satisfied: MarkupSafe>=2.0 in /home/martin/.local/lib/python3.8/site-packages (from Jinja2>=2.9->bokeh==2.4.2->dearwatson) (2.1.1)
Requirement already satisfied: pyvo>=1.1 in /home/martin/.local/lib/python3.8/site-packages (from astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (1.3)
Requirement already satisfied: keyring>=4.0 in /home/martin/.local/lib/python3.8/site-packages (from astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (22.0.1)
Requirement already satisfied: html5lib>=0.999 in /home/martin/.local/lib/python3.8/site-packages (from astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (1.1)
Requirement already satisfied: soupsieve>1.2 in /home/martin/.local/lib/python3.8/site-packages (from beautifulsoup4>=4.6.0->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (2.3.2.post1)
Requirement already satisfied: autograd in /home/martin/.local/lib/python3.8/site-packages (from oktopus>=0.1.2->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (1.3)
Requirement already satisfied: certifi>=2017.4.17 in /home/martin/.local/lib/python3.8/site-packages (from requests>=2.22.0->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (2020.12.5)
Requirement already satisfied: chardet<5,>=3.0.2 in /home/martin/.local/lib/python3.8/site-packages (from requests>=2.22.0->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (4.0.0)
Requirement already satisfied: idna<3,>=2.5 in /home/martin/.local/lib/python3.8/site-packages (from requests>=2.22.0->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (2.10)
Requirement already satisfied: joblib>=0.11 in /home/martin/.local/lib/python3.8/site-packages (from scikit-learn>=0.24.0->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (1.0.1)
Requirement already satisfied: threadpoolctl>=2.0.0 in /home/martin/.local/lib/python3.8/site-packages (from scikit-learn>=0.24.0->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (3.1.0)
Requirement already satisfied: future in /home/martin/.local/lib/python3.8/site-packages (from uncertainties>=3.1.4->lightkurve==2.2.0->lcbuilder==0.10.4->dearwatson) (0.18.2)
Requirement already satisfied: llvmlite<0.37,>=0.36.0rc1 in /home/martin/.local/lib/python3.8/site-packages (from numba->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (0.36.0)
Requirement already satisfied: webencodings in /home/martin/.local/lib/python3.8/site-packages (from html5lib>=0.999->astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (0.5.1)
Requirement already satisfied: SecretStorage>=3.2 in /home/martin/.local/lib/python3.8/site-packages (from keyring>=4.0->astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (3.3.0)
Requirement already satisfied: jeepney>=0.4.2 in /home/martin/.local/lib/python3.8/site-packages (from keyring>=4.0->astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (0.6.0)
Requirement already satisfied: cryptography>=2.0 in /home/martin/.local/lib/python3.8/site-packages (from SecretStorage>=3.2->keyring>=4.0->astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (3.3.1)
Requirement already satisfied: cffi>=1.12 in /home/martin/.local/lib/python3.8/site-packages (from cryptography>=2.0->SecretStorage>=3.2->keyring>=4.0->astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (1.14.5)
Requirement already satisfied: pycparser in /home/martin/.local/lib/python3.8/site-packages (from cffi>=1.12->cryptography>=2.0->SecretStorage>=3.2->keyring>=4.0->astroquery>=0.3.9->foldedleastsquares==1.0.36->lcbuilder==0.10.4->dearwatson) (2.21)
Installing collected packages: argparse
Successfully installed argparse-1.4.0

[notice] A new release of pip available: 22.3.1 -> 23.0
[notice] To update, run: python3.8 -m pip install --upgrade pip

Once we have watson installed, can execute it as follows. To run the vetting for our new signal:

  • We define the candidate parameters (period, epoch, duration, depth, radius planet/radius star, semi-major axis/radius star.

  • Define the star coordinates

  • Select the candidate signal cadence that we want to use as source for the computation of all the metrics.

  • Prepare all the known transiting exoplanets data to be masked so they do not interfere in the analysis of the signal. In the case of TOI-175, there are three known transiting exoplanets that we need to mask by using their period, epoch and duration.

import os
from watson.watson import Watson


period = 1.0491800670761966
epoch = 1354.7155898963902
duration_mins = 54
depth_ppts = 0.158
sectors = 'all'
rp_rstar = 0.01205
a_rstar = 9 
ra = 124.531756290083
dec = -68.3129998725044
known_transits_mask = [{'P': 3.6906682312153136, 'T0': 1356.20298505518, 'D': 56}, 
                 {'P': 2.2531273092040185, 'T0': 1354.9020729263193, 'D': 45}, 
                 {'P': 7.450690528437917, 'T0': 1355.2917484673462, 'D': 69}]
your_execution_dir = os.getcwd() 
object_dir = your_execution_dir + '/results'
if not os.path.exists(object_dir):
    os.mkdir(object_dir)
Watson(object_dir).vetting("TIC 307210830", period, epoch, duration_mins, depth_ppts, sectors, rp_rstar,
                                       a_rstar=a_rstar, cadence=120,
                                       cpus=os.cpu_count() // 2,
                                       transits_list=None, ra=ra,
                                       dec=dec, clean=True, transits_mask=known_transits_mask)

The output of the vetting generated by watson consists on two PDF reports (a complete and a summary one) and a few csvs stored for reproducibility. In order to explore the resulting PDF page by page in this notebook we will need the pdf2image module.

! python3.10 -m pip install pdf2image
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pdf2image in /home/martin/.local/lib/python3.8/site-packages (1.16.2)
Requirement already satisfied: pillow in /home/martin/.local/lib/python3.8/site-packages (from pdf2image) (8.1.0)

[notice] A new release of pip available: 22.3.1 -> 23.0
[notice] To update, run: python3.8 -m pip install --upgrade pip

Now that it is installed, let’s begin with the report. We will load the summary PDF and convert it into a set of images (one image per page).

from pdf2image import convert_from_path
from IPython.display import Image
import os 

# Store Pdf with convert_from_path function
images = convert_from_path(your_execution_dir + '/TIC 307210830_transits_validation_report_summary.pdf')

Time to look into the first page. It shows a header with Table 1 and Table 2, which are self-descriptive. Then we can find the Table 3. This table contains several coloured metrics: green ones are metrics that passed the defined sherlock thresholds, red ones are problematic metrics that should be eye-inspected and yellow ones are inconclusive metrics that will probably also need eye inspection. One by one the metrics are:

  • fast_snr: SNR of the transit model in the folded original fast-cadence curve. Passes if > 3.

  • short_snr: SNR of the transit model in the folded original short-cadence curve. Passes if > 3.

  • long_snr: SNR of the transit model in the folded original long-cadence curve. Passes if > 3.

  • folded_cadences_snr: The Standard Deviation of the fast_snr, short_snr and long_snr is computed and divided by their mean. Passes if < 0.3.

  • snr_p_t0: SNR of the transit model in the Period folded sherlock selected processed curve. Represents the main transit events. Passes if > 3.

  • snr_p_2t0: SNR of the transit model in the Period folded sherlock selected processed curve centered on T0 + Period / 2. Represents the occultation transit events. Passes if < 3.

  • snr_2p_t0: SNR of the transit model in the 2 * Period folded sherlock selected processed curve centered on T0. Represents the odd transits. Passes if > 3.

  • snr_2p_2t0: SNR of the transit model in the 2 * Period folded sherlock selected processed curve centered on T0 + Period. Represents the even transits. Passes if > 3.

  • snr_p2_t0: SNR of the transit model in the Period / 2 folded sherlock selected processed curve centered on T0, and the original signal being masked. Represents the occultation transit events and reports the same values than snr_p_2t0. Passes if < 3.

  • snr_p2_t02: SNR of the transit model in the Period / 2 folded sherlock selected processed curve centered on T0 + Period / 2, and the original signal being masked. Passes if < 3.

  • transit_offset_ra: The distance between the transit source offset position and the star in the Right Ascension axis, in degrees. Passes if < mission_pixel_size (20.25’’ for TESS and 4’’ for Kepler)

  • transit_offset_dec: The distance between the transit source offset position and the star in the Declination axis, in degrees. Passes if < mission_pixel_size

  • transit_offset_err: The transit source offset error in degrees. Passes if < 3 * mission_pixel_size

  • transit_offset_pos: The absolute distance from the transit source and the star position in the sky, in degrees. Passes if < offset_err

  • core_flux_snr: The computed aperture flux SNR with the transit model. Passes if > 3

  • halo_flux_snr: The computed aperture flux with a ring aperture over the core aperture with the transit model. Passes if > 3.

  • og_score: The relationship halo_flux_snr / core_flux_snr. Passes if og_score < 1 and core_flux_snr > 3

  • centroids_ra_snr: The SNR of the transit model on the Period folded (centroids - motion) Right Ascension curve. Passes if < 3.

  • centroids_dec_snr: The SNR of the transit model on the Period folded (centroids - motion) Declination curve. Passes if < 3.

Ok, now that we know the kind of metrics that we will find in the first page, let’s take a look into it:

images[0]
../_images/b529ed007b25b2ecb4ca1185b5b2c20e5793a0d5fd2f65290ea562da6e2093d1.png

It seems that our very promising candidate turnes out to be showing problematic metrics! snr_p_2t0 (occultations), snr_p2_t0 (same metric for occultations) and hence snr_p_score and snr_p2_score also are red. In addition, transit_offset_ra and transit_offset_dec are red, which leads to transit_offset_pos being also rejected. Finally, we can also see that the og_score and the centroids_ra_snr and centroids_dec_snr are also rejected. This might seem as if there was some occultation effect and some transit source located outside of our target would be causing it. But for that, we need to get a closer look to the next pages.

Page 2 contains the Figure 1, which shows the folded curves for the different available cadences (fast, short and long). These metrics were passed so we will just show the page without further insight:

images[1]
../_images/9e2622079cc208496411c426df797b4a0727b5585f52370c4d1fc35970becdbe.png

Page 3 contains the Figure 2, showing the plots related (from top-left to bottom-right) to the snr_p_t0, snr_p_2t0, snr_2p_t0, snr_2p_2t0, snr_p2_t0, snr_p2_t02 metrics, that showed to be problematic. You can see the SNRs reported in each plot title.

images[2]
../_images/f01b8f6d16bacd1cac6a7c613ea072b9bb9d91e5aa9e78a27798cdc6fe71fc27.png

Page 4 will show the Figure 3, which plots the transit source position together to the target position and the centroids and optical ghost (core and halo flux) folded curves at the bottom. The transit source position seems to be approximately two pixels far from the target and its uncertainty seems to constrain it still outside the target. That would mean that the transit is probably originated from a nearby star. But wait because that is not the only evidente. Looking into the centroids shift plot we can see both a drift in the RA and DEC with a transit shape, being much deeper in the Dec curve. Finally, the core flux transit shape is much shallower than the halo flux one, which also points to confirm the hypothesis: the transit might be caused by nearby sources.

images[3]
../_images/5f112f0236e661e671996504f295d2502cbd1e5b76b9b40cc186618734730d6a.png

The next pages from page 5 to 12 will plot each of the Target Pixel Files pixels folded curves with the signal period and T0. We will only plot the folded TPF for the sector 28. You will observe that the BLS fits for each pixel show clearly that there is a deep transit signal exactly at the same spot where the Figure 4 was pointing the transit source. Both the Per-Pixel BLS SNR map and Differential image SNR map point to the same place, showing a good agreement between both methods.

images[4]
../_images/dfdfd8d9c85a5fc4c4e52ffec5feda8ea78766f588eea89f47ad14e4ffc84829.png

If you wanted, you could also inspect each of the single-transits to see if they fell into data gaps or might have been caused by momentum dumps or background flux fluctuations. In this case, we have enough evidence for this candidate to be rejected and claim that it is caused by a Nearby Eclipsing Binary (NEB).