Notebook Presentation
Detection of Exoplanets
Страница автоматически собрана из Colab-ноутбука: текст, код и графики.
Detection of Exoplanet Transit Signals in TESS Photometric Data
Project goal
The goal of this project is to analyze publicly available NASA TESS photometric data for WASP-18 and identify periodic brightness decreases caused by the transiting exoplanet WASP-18 b.
The project uses Python, Lightkurve, and the Box Least Squares method to:
- download TESS light curve data
- clean and normalize the light curve
- detect a periodic transit signal
- fold the light curve at the detected orbital period
- estimate the transit depth
- compare the result with published values
Importing libraries
!pip install lightkurve -q
import numpy as np
import matplotlib.pyplot as plt
from lightkurve import search_lightcurvePreparing metadata (setup.py) ... [?25l[?25hdone [?25l [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m0.0/41.2 kB[0m [31m?[0m eta [36m-:--:--[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m41.2/41.2 kB[0m [31m2.2 MB/s[0m eta [36m0:00:00[0m [?25h Preparing metadata (setup.py) ... [?25l[?25hdone [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m261.1/261.1 kB[0m [31m12.3 MB/s[0m eta [36m0:00:00[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m11.1/11.1 MB[0m [31m72.2 MB/s[0m eta [36m0:00:00[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m203.4/203.4 kB[0m [31m12.5 MB/s[0m eta [36m0:00:00[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m60.1/60.1 kB[0m [31m4.1 MB/s[0m eta [36m0:00:00[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m89.5/89.5 kB[0m [31m7.5 MB/s[0m eta [36m0:00:00[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m1.1/1.1 MB[0m [31m49.6 MB/s[0m eta [36m0:00:00[0m [2K [90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━[0m [32m15.0/15.0 MB[0m [31m80.7 MB/s[0m eta [36m0:00:00[0m [?25h Building wheel for fbpca (setup.py) ... [?25l[?25hdone Building wheel for memoization (setup.py) ... [?25l[?25hdone [31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. gcsfs 2025.3.0 requires fsspec==2025.3.0, but you have fsspec 2026.4.0 which is incompatible. datasets 4.0.0 requires fsspec[http]<=2025.3.0,>=2023.1.0, but you have fsspec 2026.4.0 which is incompatible.[0m[31m [0m
/usr/local/lib/python3.12/dist-packages/lightkurve/prf/__init__.py:7: UserWarning: Warning: the tpfmodel submodule is not available without oktopus installed, which requires a current version of autograd. See #1452 for details. warnings.warn(
Downloading and ploting the light curve
I download one available TESS light curve for WASP-18 and plot the raw flux data.
The raw light curve shows the measured stellar flux over time. The repeated downward dips are potential transit events.
The data also contains noise, observational gaps, and instrumental trends. These effects must be reduced before period analysis.
search_result = search_lightcurve("WASP-18", mission="TESS")
search_result
lc = search_result.download()
lc.plot()
plt.title("Raw TESS Light Curve for WASP-18")
plt.show()/usr/local/lib/python3.12/dist-packages/lightkurve/search.py:421: LightkurveWarning: Warning: 37 files available to download. Only the first file has been downloaded. Please use `download_all()` or specify additional criteria (e.g. quarter, campaign, or sector) to limit your search. warnings.warn(
<Figure size 848.5x400 with 1 Axes>
Cleaning and normalizing the light curve
The light curve is cleaned by:
- normalizing the flux so the baseline brightness is close to 1.0
- removing missing values
- removing strong outliers
- flattening slow trends in the data
This makes the transit signal easier to identify.
lc_clean = (
lc
.normalize()
.remove_nans()
.remove_outliers(sigma=5)
.flatten(window_length=101)
)
lc_clean.scatter(marker='.', s=2)
plt.title("Cleaned and Normalized TESS Light Curve for WASP-18")
plt.show()<Figure size 848.5x400 with 1 Axes>
Searching for the orbital period using BLS
To find the repeating transit signal, I use the Box Least Squares method.
BLS is designed to detect periodic box-shaped drops in brightness, which makes it suitable for exoplanet transit searches.
The highest peak in the BLS periodogram gives the strongest candidate orbital period.
In this analysis, the detected period is close to 0.94 days. This is consistent with the published orbital period of WASP-18 b, which is approximately 0.94 days.
The other peaks are likely harmonics of the main period.
bls = lc_clean.to_periodogram(
method="bls",
period=np.linspace(0.5, 5, 10000)
)
best_period = bls.period_at_max_power
print("Detected orbital period:", best_period)
bls.plot()
plt.title("BLS Periodogram for WASP-18")
plt.show()Detected orbital period: 0.9414941494149414 d
<Figure size 848.5x400 with 1 Axes>
The detected orbital period from this analysis is compared with the published value for WASP-18 
Published orbital period: approximately 0.94 days
Detected orbital period: shown below from the BLS analysis
https://exoplanet.eu/catalog/wasp_18_ab--577/
Folding the light curve
Next, I fold the light curve using the detected orbital period.
Folding means stacking multiple orbital cycles on top of each other. This improves the visibility of the transit shape because repeated transits align in phase.
The folded light curve shows a clear U-shaped dip. This is characteristic of an exoplanet transit.
During the transit, the planet passes in front of its host star and blocks a small fraction of the star's light. This causes the normalized flux to decrease below 1.0.
The U-shaped profile supports the interpretation that the signal is caused by a transiting planet rather than random noise.
folded = lc_clean.fold(period=best_period)
plt.figure(figsize=(9, 4))
plt.scatter(
folded.time.value,
folded.flux.value,
s=3,
alpha=0.6
)
plt.xlabel("Phase [days]")
plt.ylabel("Normalized Flux")
plt.title("Folded TESS Light Curve for WASP-18")
plt.ylim(0.987, 1.006)
plt.show()<Figure size 900x400 with 1 Axes>
Estimating transit depth
min_flux = np.nanmin(folded_zoom.flux.value)
transit_depth = 1 - min_flux
print("Minimum normalized flux:", min_flux)
print("Estimated transit depth:", transit_depth)
print("Estimated transit depth (%):", transit_depth * 100)Minimum normalized flux: 0.9880077439838397 Estimated transit depth: 0.011992256016160274 Estimated transit depth (%): 1.1992256016160274
Transit depth is the fractional decrease in stellar brightness during the transit.
A simple estimate can be calculated as:
Transit depth = 1 - minimum normalized flux
This is an approximate estimate because the project uses a simplified method rather than full transit model fitting.
Results
The analysis detected a strong periodic transit signal in TESS photometric data for WASP-18.
Main results:
- A periodic transit signal was identified using Box Least Squares analysis.
- The detected orbital period was close to 0.94 days.
- The folded light curve showed a clear U-shaped transit profile.
- The estimated transit depth was approximately 1 percent.
- The detected period was broadly consistent with the published value for WASP-18 b.
These results show that the analysis pipeline successfully reproduces a known exoplanet transit signal using public astronomical data.
Limitations
This project uses a simplified analysis pipeline.
Main limitations:
- The transit depth estimate is approximate and is based on the minimum observed flux.
- The folded light curve may show small phase offsets because the detected period is not fitted with professional transit modeling tools.
- The analysis uses one selected TESS light curve rather than combining all available sectors.
- Noise, instrumental artifacts, and gaps in observations can affect the shape of the folded transit.
- A full scientific analysis would require model fitting, uncertainty estimates, and comparison across multiple sectors.
Despite these limitations, the project demonstrates the core method used in transit-based exoplanet detection.
Cell 26, Markdown
Conclusion
This project analyzed NASA TESS photometric observations of WASP-18 and reproduced the known transit signal of WASP-18 b.
Using Python and Lightkurve, I cleaned the light curve, applied Box Least Squares period analysis, folded the light curve at the detected period, and estimated the transit depth.
The detected orbital period was close to the published value of approximately 0.94 days, supporting the validity of the analysis.
This project demonstrates how real astronomical data can be used to identify and study exoplanet transits.
Cell 27, Markdown