<jupyter_start><jupyter_text>Fit a transiting planet signal with a trapezoid modelMonitoring the flux of a star might reveal the presence of a exoplanets when the planet "transits" across the front of the start as seen from our perspective. It causes a reduction of the apparent brightness of the star, and conducting large monitoring programs for the [transit method](https://en.wikipedia.org/wiki/Methods_of_detecting_exoplanetsTransit_photometry) has become one of the most successful methods to detect exoplanets.We will use a simple model to describe the transit signal: a symmetric trapezoid. While it is geometrically simple, it is a non-linear model, that means you canot write down a design matrix for it So we need a more general minimizer to fit any given data. By the end of this notebook you will have all you need to fit transit data.Write a function `read_data` that takes the object numer (e.g. 7016.01) as an argument and returns two arrays: `time` and `flux`, read from the data file ('data/7016.01.txt').<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import numpy as np<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.04929577464788732, 'fraction_numerical': 0.01056338028169014, 'mean_word_length': 5.179347826086956, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '476993', 'license': 'MIT', 'n_tokens_mistral': 311, 'n_tokens_neox': 296, 'n_words': 164, 'path': 'day4/transit/Transit.ipynb', 'repo_name': 'jsalmon-PU/usrp-sciprog', 'size': '1136'}