<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Create flatten light curve with a single transit
This corresponds to the data used in Sect. 5.4 of pyaneti II paper
O. Barragán, July 2021
Load the libraries
(You have to have citlalicue installed in your computer pip install citlalicue)
Step1:  Let us create the citlali (light curve) instance
Step2:  Time to add the transit signal
We will create one transit signal assuming we have one planet that orbits a star with a density $\rho_* = 1.4\, \mathrm{g\,cm^{-3}}$.
The first set of transit signals will be asigned to a planet with parameters
$$
T_0 = 10 d,
P  = 30 d,
b  = 0.5,
r_p = 0.025,
$$
where $T_0$ time of periastron, $P$ orbital period, $b$ impact parameter, $r_p$ planet radius scaled to the radius of the star.
The quadractic limb darkening coefficients of the star are
$$
u_{1,b1} = 0.25,
u_{2,b1} = 0,
$$
and the second
$$
u_{1,b2} = 0.50,
u_{2,b2} = 0.25.
$$
Let us create the parameters with all the values
Step3:  Add planet to the light curve
We will add the planet signal to our lc light curve.
Step4:  Time to add white noise
We will add white noise to our data. We will assume our data has error bars of 100 ppm. This can be done easily by calling the add_white_noise method for each citlali instance.
Step5:  Let us save the data in the lc_single.dat file
Let us save the light curves in a file containing time, flux, and error.
<ASSISTANT_TASK:>
Python Code:
#Load libraries
from __future__ import print_function, division, absolute_import
import numpy as np
import matplotlib.pyplot as plt
#Import the citlali class from citlalicue
#You can install citlalicue as pip install citlalicue
from citlalicue.citlalicue import citlali
#start a random seed number
seed = 28
np.random.seed(seed)
Explanation: Create flatten light curve with a single transit
This corresponds to the data used in Sect. 5.4 of pyaneti II paper
O. Barragán, July 2021
Load the libraries
(You have to have citlalicue installed in your computer pip install citlalicue)
End of explanation
#Let us create a citlali instance with a duration of 3 days and a cadence of 5 min
lc = citlali(tmin=9,tmax=11,cadence=5/60./24.) 
#as it is now, the lc instance corresponds to the light curve of a uniform disc star
#let us plot it to see this
lc.plot(fsx=20,fsy=5)
Explanation: Let us create the citlali (light curve) instance
End of explanation
#Stellar density
rho = 1.4
#Planet b parameters
T0b = 10.
Pb  = 30.
bb  = 0.5
rpb = 0.025
#Instrument b1 limb darkening coefficients
u1 = 0.25
u2 = 0
Explanation: Time to add the transit signal
We will create one transit signal assuming we have one planet that orbits a star with a density $\rho_* = 1.4\, \mathrm{g\,cm^{-3}}$.
The first set of transit signals will be asigned to a planet with parameters
$$
T_0 = 10 d,
P  = 30 d,
b  = 0.5,
r_p = 0.025,
$$
where $T_0$ time of periastron, $P$ orbital period, $b$ impact parameter, $r_p$ planet radius scaled to the radius of the star.
The quadractic limb darkening coefficients of the star are
$$
u_{1,b1} = 0.25,
u_{2,b1} = 0,
$$
and the second
$$
u_{1,b2} = 0.50,
u_{2,b2} = 0.25.
$$
Let us create the parameters with all the values
End of explanation
#We pass the parameters to cilatlicue as
#pars = [T0,P,b,rho,rp,u1,u2]
#Let us create a list with all the parameters for planet 
parsb = [T0b,Pb,bb,rho,rpb,u1,u2]
#Let us add the planet b by calling the add_transits method
lc.add_transits(planet_parameters=parsb,planet_name='b')
#re-plot the light curve to see the planets
lc.plot(fsx=20,fsy=5)
Explanation: Add planet to the light curve
We will add the planet signal to our lc light curve.
End of explanation
#Define the error bar that we want to add
error_bar = 100e-6
#Call the add_white_noise attribute
lc.add_white_noise(std=error_bar)
#and plot
lc.plot(20,5)
Explanation: Time to add white noise
We will add white noise to our data. We will assume our data has error bars of 100 ppm. This can be done easily by calling the add_white_noise method for each citlali instance.
End of explanation
fname = 'lc_single.dat'
with open(fname,'w') as f:
    for i in range(len(lc.time)):
        f.write("{} {} {}\n".format(lc.time[i],lc.flux[i],lc.error_bar))
Explanation: Let us save the data in the lc_single.dat file
Let us save the light curves in a file containing time, flux, and error.
End of explanation
<END_TASK>