-
Notifications
You must be signed in to change notification settings - Fork 0
/
Batman_parameters.py
350 lines (227 loc) · 11.3 KB
/
Batman_parameters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 13 16:22:07 2021
@author: luciescharre
"""
# planet size
import batman
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import (MultipleLocator, FormatStrFormatter, AutoMinorLocator)
import matplotlib.ticker as ticker
plt.rcParams["font.family"] = "serif"
params = batman.TransitParams()
params.t0 = 0.
params.a = 8.240983371 #semi-major axis (in units of stellar radii)
params.w = 90. #longitude of periastron (in degrees)
params.limb_dark = "quadratic" #limb darkening model
params.u = [0.525,0.188] #limb darkening coefficients [u1, u2, u3, u4]
params.inc = 84.7 #orbital inclination (in degrees)
params.ecc = 0.121 #eccentricity
params.rp = 0.135
params.per = 2.152060692723822
t = np.linspace(-0.05, 0.05, 100)
m = batman.TransitModel(params, t) #initializes model
flux1 = m.light_curve(params) #calculates light curve
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux1, color='tomato')
plt.title("Literature values transit curve")
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()
#params = batman.TransitParams()
#params.t0 = 0. #time of inferior conjunction
#params.per = 0.5 #orbital period days
#params.a = 8.240983371 #semi-major axis (in units of stellar radii)
#params.w = 0. #longitude of periastron (in degrees)
#params.limb_dark = "nonlinear" #limb darkening model
#params.u = []
#params.u = [0.5, 0.1, 0.1, -0.1] #limb darkening coefficients [u1, u2, u3, u4]
#params.rp = 0.5 #planet radius (in units of stellar radii)
#t = np.linspace(-0.05, 0.05, 100)
#params.inc = 90 #orbital inclination (in degrees)
#params.ecc = 0 #eccentricity
#params.rp = 0.1
#params.per = 2.152060692723822 #orbital period days
#params.a = 8.240983371 #semi-major axis (in units of stellar radii)
m = batman.TransitModel(params, t) #initializes model
flux1 = m.light_curve(params) #calculates light curve
params.rp = 0.2
#params.per = 2.152060692723822 #orbital period days
#params.a = 8.240983371 #semi-major axis (in units of stellar radii)
m = batman.TransitModel(params, t) #initializes model
flux2 = m.light_curve(params) #calculates light curve
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux1, label="Rp = 0.135",color='tomato')
plt.plot(t, flux2, label="Rp = 0.2")
#plt.plot(t, flux3, label="ecc: 0.5", color = "tomato")
#plt.plot(t, flux4, label="ecc: 0.8", color = "teal")
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()
# semi major axis
params = batman.TransitParams()
params.t0 = 0.
params.a = 8.240983371 #semi-major axis (in units of stellar radii)
params.w = 90. #longitude of periastron (in degrees)
params.limb_dark = "quadratic" #limb darkening model
params.u = [0.525,0.188] #limb darkening coefficients [u1, u2, u3, u4]
params.inc = 84.7 #orbital inclination (in degrees)
params.ecc = 0.121 #eccentricity
params.rp = 0.135
params.per = 2.152060692723822
t = np.linspace(-0.05, 0.05, 100)
#params.inc = 90 #orbital inclination (in degrees)
#params.per = 2.152060692723822 #orbital period days
#params.a = 8.240983371 #semi-major axis (in units of stellar radii)
m = batman.TransitModel(params, t) #initializes model
flux3 = m.light_curve(params) #calculates light curve
#params.per = 2.15 #orbital period days
params.a = 10 #semi-major axis (in units of stellar radii)
m = batman.TransitModel(params, t) #initializes model
flux4 = m.light_curve(params) #calculates light curve
params = batman.TransitParams()
params.t0 = 0.
params.a = 7.7 #semi-major axis (in units of stellar radii)
params.w = 90. #longitude of periastron (in degrees)
params.limb_dark = "quadratic" #limb darkening model
params.u = [0.525,0.188] #limb darkening coefficients [u1, u2, u3, u4]
params.inc = 84.7 #orbital inclination (in degrees)
params.ecc = 0.121 #eccentricity
params.rp = 0.135
params.per = 2.152060692723822
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux3, label="a = 7.7", color = "tomato")
plt.plot(t, flux4, label="a = 10")
#plt.plot(t, flux3, label="ecc: 0.5", color = "tomato")
#plt.plot(t, flux4, label="ecc: 0.8", color = "teal")
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()
params.w = 0 #orbital inclination (in degrees)
params.ecc = 0 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux1 = m.light_curve(params) #calculates light curve
params.ecc = 0.121 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux2 = m.light_curve(params) #calculates light curve
params.ecc = 0.5 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux3 = m.light_curve(params) #calculates light curve
params.ecc = 0.3 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux4 = m.light_curve(params) #calculates light curve
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux1, label="ecc = 0, circular orbit", color = "green")
plt.plot(t, flux2, label="ecc = 0.121",color='tomato')
plt.plot(t, flux4, label="ecc: 0.3")
plt.plot(t, flux3, label="ecc = 0.5")
#plt.title("Longitude of periastron "+ '\u03C9'+'\u0305'+ "= 0")
plt.vlines(0,1,0.982)
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()
params.w = 90 #orbital inclination (in degrees)
params.ecc = 0 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux1 = m.light_curve(params) #calculates light curve
params.ecc = 0.121 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux2 = m.light_curve(params) #calculates light curve
params.ecc = 0.5 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux3 = m.light_curve(params) #calculates light curve
params.ecc = 0.3 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux4 = m.light_curve(params) #calculates light curve
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux1, label="e = 0, circular orbit", color = "green")
plt.plot(t, flux2, label="e = 0.121",color='tomato')
plt.plot(t, flux4, label="e = 0.3")
plt.plot(t, flux3, label="e = 0.5")
#plt.plot(t, flux4, label="ecc: 0.8", color = "teal")
#plt.title("Longitude of periastron "+ '\u03C9'+'\u0305'+ "= 90")
plt.vlines(0,1,0.982)
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()
params = batman.TransitParams()
params.t0 = 0.
params.a = 8.240983371 #semi-major axis (in units of stellar radii)
params.w = 90. #longitude of periastron (in degrees)
params.limb_dark = "quadratic" #limb darkening model
params.u = [0.525,0.188] #limb darkening coefficients [u1, u2, u3, u4]
params.inc = 84.7 #orbital inclination (in degrees)
params.ecc = 0.121 #eccentricity
params.rp = 0.135
params.per = 2.152060692723822
#params.w = 90 #orbital inclination (in degrees)
m = batman.TransitModel(params, t) #initializes model
flux1 = m.light_curve(params) #calculates light curve
params.inc = 90 #eccentricity
m = batman.TransitModel(params, t) #initializes model
flux2 = m.light_curve(params) #calculates light curve
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux1, label="i = 84.7°", color = "tomato")
plt.plot(t, flux2, label="i = 90°")
#plt.plot(t, flux4, label="ecc: 0.8", color = "teal")
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()
params = batman.TransitParams()
params.t0 = 0.
params.a = 8.240983371 #semi-major axis (in units of stellar radii)
params.w = 90. #longitude of periastron (in degrees)
params.limb_dark = "quadratic" #limb darkening model
params.u = [0.525,0.188] #limb darkening coefficients [u1, u2, u3, u4]
params.inc = 84.7 #orbital inclination (in degrees)
params.ecc = 0.121 #eccentricity
params.rp = 0.135
params.per = 2.152060692723822
#params.w = 90 #orbital inclination (in degrees)
m = batman.TransitModel(params, t) #initializes model
flux1 = m.light_curve(params) #calculates light curve
params.limb_dark = "linear" #limb darkening model
params.u = [0.525] #limb darkening coefficients [u1, u2, u3, u4]
m = batman.TransitModel(params, t) #initializes model
flux2 = m.light_curve(params) #calculates light curve
params.limb_dark = "uniform" #limb darkening model
params.u = [] #limb darkening coefficients [u1, u2, u3, u4]
m = batman.TransitModel(params, t) #initializes model
flux3 = m.light_curve(params) #calculates light curve
plt.minorticks_on()
plt.tick_params(which='major', direction='in', length=6, width=2, colors='black', top=True, right=True)
plt.tick_params(which='minor', length=4, direction='in', top=True, right=True)
plt.plot(t, flux3, label="uniform")
plt.plot(t, flux2, label="linear")
plt.plot(t, flux1, label="quadratic")
plt.xlabel("Time since transit [days]")
plt.ylabel("Relative flux")
#plt.title()
plt.legend(bbox_to_anchor=(1, 1), loc='upper left')
plt.show()