How to use contaminante
¶
This tutorial will show you how to use contaminante
. If you’d like
to try it yourself, you can use contaminante
online, in the cloud,
for free! Click
here
to run contaminante
online using Google’s Colaboratory.
Using contaminante
on Kepler data¶
To demonstrate contaminante
we’ll first use Kepler data. First
we’ll need a target to try contaminante
on. I’ve chosen KIC
6804648. This target was observed during the prime Kepler mission,
and was flagged as a planet candidate. In fact, the target has a
contaminating eclipsing binary. This binary is only obvious in some of
the Kepler quarters.
Below we run the target through contaminante
. Running this cell
should take less than 5 minutes.
In [1]:
import contaminante
In [2]:
fig, result = contaminante.calculate_contamination(targetid='KIC {}'.format(6804648),
period=0.700606,
t0=131.59767,
duration=0.993/24,
mission='kepler')
Modeling TPFs: 100%|██████████| 18/18 [00:36<00:00, 2.03s/it]

Using contaminante
we can see two pieces of evidence that this
target is contaminated. 1. There is a significant offset between the
center of the target (green cross) in the image, and the source of
the transiting signal (red cross). 2. There is a significant
difference between the target phase curve (green phase curve) and
the source of the transiting signal phase curve (red phase curve).
The result dictionary contains the depth and positions of the target and the "contamintor", including errors. It also contains a flag for whether the target is "contaminated". The user is encouraged to 1) look at the phase curves 2) look at the positions and transit depths before claiming that a target is contaminated.
In [5]:
result
Out[5]:
{'target_depth': (2.437439290625676e-05, 1.4287201027303745e-06),
'target_ra': (298.4828991530856, 5.7953788757665565e-05),
'target_dec': (42.241117253820924, 3.2758717230643706e-05),
'target_lc': KeplerLightCurve(ID: 6804648),
'contaminator_depth': (0.0037489874455257644, 3.872165901816627e-06),
'contaminator_ra': (298.48535155210516, 0.0011172397969751028),
'contaminator_dec': (42.24132717783978, 0.001750973326888842),
'contaminator_lc': KeplerLightCurve(ID: 6804648),
'delta_transit_depth[sigma]': 902.4252541044372,
'contaminated': True}
To compare, we can look at a target that is a true, confirmed planet.
Below I run the parameters for Kepler-10 through contaminate
.
In [6]:
fig, result = contaminante.calculate_contamination(targetid='KIC {}'.format(11904151),
period=0.837491,
t0=2454964.57513 - 2454833,
duration=1.8076/24,
mission='kepler')
Modeling TPFs: 100%|██████████| 15/15 [00:36<00:00, 2.42s/it]

Sometimes there will be no significant transiting source that was not the target, and so there will be no red cross in the image, and no red phase curve in the phase curve diagram. Sometimes there will be a weak detection that there are other pixels that contain the transit, but there is frequently no significant shift if
- The two sources line up in the image
- There is no significant difference between the target aperture and the source aperture.
Cases such as this can suggest the aperture you are using may not be optimal to recover all of the transiting signal.
In [7]:
result
Out[7]:
{'target_depth': (0.0001585059932727173, 5.774540046382073e-07),
'target_ra': (285.67947911477347, 4.4847243013086534e-05),
'target_dec': (50.24221759254663, 3.907218782625415e-05),
'target_lc': KeplerLightCurve(ID: 11904151),
'contaminator_depth': (0.00015769371397011955, 5.777815686580617e-07),
'contaminator_ra': (285.68116034215626, 0.0020506936549865404),
'contaminator_dec': (50.24189275482509, 0.0012837499690906413),
'contaminator_lc': KeplerLightCurve(ID: 11904151),
'delta_transit_depth[sigma]': -0.9943741229438438,
'contaminated': False}
Using contaminante
on TESS Data¶
contaminante
works on TESS data too. The background scattered light
is removed using principle component analysis. For targets that are
available in the TESS pipeline TPF products, the TPFs will be used. If
no TPF is available, the data will be cut out of the FFI’s using the
TESSCut API from MAST.
In [13]:
fig, result = contaminante.calculate_contamination(targetid="TIC 267263253",
period=4.12688,
t0=2458325.78297 - 2457000,
duration=0.3, mission='tess', bin_points=100)
Modeling TPFs: 100%|██████████| 1/1 [00:05<00:00, 5.81s/it]

In [10]:
result
Out[10]:
{'target_depth': (0.005182381951214454, 1.6952457341447885e-05),
'target_ra': (7.327318046083178, 0.00012152131752412386),
'target_dec': (-76.29980287907736, 2.770077456958133e-05),
'target_lc': TessLightCurve(TICID: 267263253),
'contaminator_depth': (0.004565119721199884, 1.53809390750107e-05),
'contaminator_ra': (7.306743961884151, 0.003854842392685067),
'contaminator_dec': (-76.30100115401925, 0.0008164741588276988),
'contaminator_lc': TessLightCurve(TICID: 267263253),
'delta_transit_depth[sigma]': -26.966278229044057,
'contaminated': False}
Using contaminante
on K2 Data¶
contaminante
works on K2 data too. The motion noise is removed using
the same Self Flat Fielding technique used in lightkurve
. Because of
the K2 motion the results may be a little harder to interpret. For
example, below there is a slight shift in the centroid, but the light
curve from that target is not different from the main target. This is
likely due to the pipeline apertures for K2 being slightly too small.
In [14]:
fig, result = contaminante.calculate_contamination(targetid="EPIC 211732801",
period=2.1316925,
t0=2308.407161,
duration=0.3, mission='K2', bin_points=5)
Modeling TPFs: 100%|██████████| 3/3 [00:06<00:00, 2.15s/it]

In [15]:
result
Out[15]:
{'target_depth': (0.029339788514284426, 9.746534372220217e-07),
'target_ra': (129.46908172826042, 5.198237267478989e-05),
'target_dec': (16.365801390325778, 0.0006597234476580658),
'target_lc': KeplerLightCurve(ID: 211732801),
'contaminator_depth': (0.029254710203185708, 1.0110600747233652e-06),
'contaminator_ra': (129.4681920796461, 0.00033188657824217494),
'contaminator_dec': (16.365707859466685, 0.00031772586759459354),
'contaminator_lc': KeplerLightCurve(ID: 211732801),
'delta_transit_depth[sigma]': -60.58209476522818,
'contaminated': False}
Usage notes¶
- Different quarters, campaigns and sectors. If a target has multiple quarters, campaigns or sectors you can expect each dataset to have some slight offset, due to the target falling on different pixels.
- Shallower contaminator light curves.
Contaminante
looks at each pixel individually to see if there is a significant transit signal. Because faint pixels can contribute a transiting signal at a lower, less significant level, some faint pixels can be missed in contaminante. In the case that the contaminator light curve is shallower than the target light curve, it is likely that some faint pixels have been missed from the optimum aperture. This does not indicate that there is any contamination.