示例#1
0
hyperpars = [2.69e-4, 0.4868]  # Initial hyper parameters.
for lc in koi.get_light_curves(short_cadence=True):
    data = lc.read()
    m = data["SAP_QUALITY"] == 0

    if lc.sci_archive_class == "CLC":
        texp = kplr.EXPOSURE_TIMES[1]
    else:
        texp = kplr.EXPOSURE_TIMES[0]

    data = GPLightCurve(
        data["TIME"][m], data["SAP_FLUX"][m], data["SAP_FLUX_ERR"][m], hyperpars, texp=texp, jitter=1e-4
    )

    if lc.sci_archive_class == "CLC":
        lcs += data.active_window([period], [t0], [dt]).autosplit()
    else:
        scs += data.active_window([period], [t0], [dts]).autosplit(ttol=1.0)

print("Building initial model")

# Build the initial model.
mu1, mu2 = kplr.ld.get_quad_coeffs(6331.0, logg=4.195, feh=0.165)
if "-e" in sys.argv:
    star = bart.Star(mass=1.30, radius=1.45, mu1=mu1, mu2=mu2)
    planet = bart.Planet(r=6.2e-2 * star.radius, period=period, b=0.2, t0=t0, e=0.81, pomega=-0.67883)
    # e=0.81, pomega=1.75)
else:
    star = bart.Star(mass=9.47, mu1=mu1, mu2=mu2)
    planet = bart.Planet(r=6.2e-2, period=period, ix=90 - 89.95, t0=t0)
示例#2
0
print("Downloading datasets")
client = kplr.API()
kic = client.koi("1574.01").star
kois = kic.kois
print([k.koi_time0bk for k in kois])

periods = [114.73635, 191.2318]
t0s = [165.1564, 286.0894 % periods[1]]
dts = [3.0, 4.0]
lcs = []
hyperpars = [1e-3, 2.0, 12.0]  # Initial hyper parameters.
for lc in kic.get_light_curves(short_cadence=False):
    data = lc.read()
    m = data["SAP_QUALITY"] == 0
    data = GPLightCurve(data["TIME"][m], data["SAP_FLUX"][m], data["SAP_FLUX_ERR"][m], hyperpars, K=5)
    lcs += data.active_window(periods, t0s, dts).autosplit()

print("Building initial model")
# Build the initial model.
mu1, mu2 = kplr.ld.get_quad_coeffs(5600.0, logg=3.96, feh=-0.17)
star = bart.Star(mass=1.1, radius=1.82, ldp=bart.ld.QuadraticLimbDarkening(mu1, mu2, 100))
planetary_system = bart.VariationalSystem(star)

times = np.sort(np.concatenate([lc.time for lc in lcs]))
for period, t0, r, b in zip(periods, t0s, [0.06855, 0.03123], [0.727, 0.579]):
    # Choose the kick times halfway between each transit.
    kicks = times[0] - t0 + 0.5 * period + period * np.arange(1, (times[-1] - times[0]) / period)

    planet = bart.Planet(r=r * star.radius, period=period, b=b, t0=t0 % period)
    planetary_system.add_planet(planet, kicks)