Run the CCF analysis

You should have already cross-correlated all your spectra against a suitable model using Search.py. This notebook goes through the shifting and subtracting of the average CCF, and measuring the companion velocities.


In [1]:
%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
import CombineCCFs
import numpy as np
from astropy import units as u, constants
from HelperFunctions import Gauss, integral
import os
import lmfit
import emcee
import triangle

from scipy.interpolate import InterpolatedUnivariateSpline as spline

sns.set_context('paper', font_scale=2.0)

home = os.environ['HOME']


:0: FutureWarning: IPython widgets are experimental and may change in the future.

Get and shift the Cross-correlation functions to the primary star rest frame

Run with T > 6000 first, to measure the primary star radial velocity in my CCFs. Then, run with T = 4000 or so to detect the companion.


In [2]:
hdf_file = '{}/School/Research/McDonaldData/PlanetData/PsiDraA/Cross_correlations/CCF.hdf5'.format(home)
output_dir = '{}/School/Research/McDonaldData/PlanetData/Paper/Figures/'.format(home)

T = 4400
vsini = 5
logg = 4.5
metal = 0.0
dV = 0.1
c = constants.c.cgs.to(u.m/u.s).value
xgrid = np.arange(-400, 400+dV/2., dV)
ccfs, original_files = CombineCCFs.get_ccfs(T=T, vsini=vsini, logg=logg, metal=metal,
                                        hdf_file=hdf_file, xgrid=xgrid)


(-12.920810871298379, 'RV31378-1_telluric_corrected.fits')
(-13.145677334476934, 'RV31380-1_telluric_corrected.fits')
(-12.001281868376692, 'RV33985-1_telluric_corrected.fits')
(-14.004713501735132, 'RV40657-1_telluric_corrected.fits')
(-13.87538004681295, 'RV41804-1_telluric_corrected.fits')
(-13.887676565781232, 'RV41806-1_telluric_corrected.fits')
(-13.66200068782735, 'RV42158-1_telluric_corrected.fits')
(-13.423053982512545, 'RV42333-1_telluric_corrected.fits')
(-12.543257216777988, 'RV42460-1_telluric_corrected.fits')
(-13.659743174852585, 'RV43838-1_telluric_corrected.fits')
(-12.353388202471594, 'RV44144-1_telluric_corrected.fits')
(-13.25820360941071, 'RV44764-1_telluric_corrected.fits')
(-13.088368282533459, 'RV46786-1_telluric_corrected.fits')
(-13.008133720451221, 'RV46787-1_telluric_corrected.fits')
(-13.304690623182319, 'RV46903-1_telluric_corrected.fits')
(-14.375580536022454, 'RV47237-1_telluric_corrected.fits')
(-13.103020926497681, 'RV47671-1_telluric_corrected.fits')
(-13.324317393989855, 'RV50253-1_telluric_corrected.fits')
(-12.960501594043478, 'RV50366-1_telluric_corrected.fits')
(-12.866620210359034, 'RV50367-1_telluric_corrected.fits')
(-12.593268172763125, 'RV50755-1_telluric_corrected.fits')
(-12.330960096497964, 'RV51343-1_telluric_corrected.fits')
(-12.316817200762383, 'RV51344-1_telluric_corrected.fits')
(-12.34954097997699, 'RV51345-1_telluric_corrected.fits')
(-12.328269497773038, 'RV51346-1_telluric_corrected.fits')
(-12.23711250473799, 'RV51347-1_telluric_corrected.fits')
(-12.308361037660259, 'RV51348-1_telluric_corrected.fits')
(-12.209382088862693, 'RV51349-1_telluric_corrected.fits')
(-12.415586485348895, 'RV51350-1_telluric_corrected.fits')
(-12.46028593857246, 'RV51351-1_telluric_corrected.fits')
(-13.197397561679031, 'RV56061-1_telluric_corrected.fits')
(-13.230205431858007, 'RV56062-1_telluric_corrected.fits')
(-13.428043748362878, 'RV60794-1_telluric_corrected.fits')
(-13.344454043249954, 'RV67083-1_telluric_corrected.fits')
(-13.377589481915152, 'RV68264-1_telluric_corrected.fits')
(-13.235958167026467, 'RV69096-1_telluric_corrected.fits')
(-13.336041919439136, 'RV70314-1_telluric_corrected.fits')
(-13.449378780314543, 'RV70483-1_telluric_corrected.fits')
(-13.378723011230655, 'RV71933-1_telluric_corrected.fits')
(-13.31824767213633, 'RV72585-1_telluric_corrected.fits')
(-12.70173055771912, 'RV72941-1_telluric_corrected.fits')
(-13.125026938033399, 'RV72942-1_telluric_corrected.fits')
(-13.134018263827159, 'RV72943-1_telluric_corrected.fits')
(-13.76131772182697, 'RV74034-1_telluric_corrected.fits')
(-13.508520580695885, 'RV78643-1_telluric_corrected.fits')
(-13.475839914063339, 'RV78644-1_telluric_corrected.fits')
(-13.368724166557998, 'RV79536-1_telluric_corrected.fits')
(-13.301632510101625, 'RV79537-1_telluric_corrected.fits')
(-13.561196997279048, 'RV79762-1_telluric_corrected.fits')
(-13.510200911482654, 'RV79763-1_telluric_corrected.fits')
(-13.48333616833599, 'RV80090-1_telluric_corrected.fits')
(-13.570955767280637, 'RV80091-1_telluric_corrected.fits')
(-13.511000221995983, 'RV80092-1_telluric_corrected.fits')
(-13.206318831105571, 'RV80355-1_telluric_corrected.fits')
(-13.457715431859759, 'RV80987-1_telluric_corrected.fits')
(-13.302827551229582, 'RV81615-1_telluric_corrected.fits')
(-13.25501436661613, 'RV81616-1_telluric_corrected.fits')
(-13.31659400156123, 'RV82282-1_telluric_corrected.fits')
(-13.585272213605018, 'RV83486-1_telluric_corrected.fits')
(-13.570492609884329, 'RV83946-1_telluric_corrected.fits')
(-13.269540240439978, 'RV85100-1_telluric_corrected.fits')
(-13.51881650084737, 'RV85212-1_telluric_corrected.fits')
(-13.226399417731363, 'RV87981-1_telluric_corrected.fits')
(-13.282162276422543, 'RV88381-1_telluric_corrected.fits')
(-13.234339512459671, 'RV88615-1_telluric_corrected.fits')
(-13.469412793146526, 'RV89735-1_telluric_corrected.fits')
(-13.3858504888588, 'RV89736-1_telluric_corrected.fits')
(-13.391124201232834, 'RV90406-1_telluric_corrected.fits')
(-13.310242955864647, 'RV90407-1_telluric_corrected.fits')
(-13.410880473232821, 'RV91271-1_telluric_corrected.fits')
(-13.402343133034782, 'RV92853-1_telluric_corrected.fits')
(-13.274001966929692, 'RV92854-1_telluric_corrected.fits')
(-13.107491670987127, 'RV95508-1_telluric_corrected.fits')
(-13.064574238221381, 'RV95899-1_telluric_corrected.fits')
(-13.385661409491094, 'RV96457-1_telluric_corrected.fits')
(-13.166710375446005, 'RV96752-1_telluric_corrected.fits')
(-13.204665984550337, 'RV97456-1_telluric_corrected.fits')
(-16.153832439865827, 'RV97829-1_telluric_corrected.fits')
(-16.146048471822471, 'RV97830-1_telluric_corrected.fits')
(-16.628749488943491, 'RV97987-1_telluric_corrected.fits')
(-16.669669891179602, 'RV97988-1_telluric_corrected.fits')
(-18.934413676635589, 'RV98358-1_telluric_corrected.fits')
(-18.799193551092682, 'RV98359-1_telluric_corrected.fits')
(-19.051667412168907, 'RV98649-1_telluric_corrected.fits')

In [3]:
# Plot all the CCFs
cmap = sns.cubehelix_palette(reverse=False, as_cmap=True, gamma=1, rot=0.7, start=2)
fig, ax = plt.subplots(1, 1)
out = ax.imshow(ccfs, cmap=cmap, aspect='auto', origin='lower')#, vmin=vmin, vmax=vmax)
min_v = -75.
max_v = 75.
dv_ticks = 50.0/dV
ax.set_xlim(((min_v+400)/dV, (max_v+400)/dV))
ticks = np.arange((min_v+400)/dV, (max_v+400)/dV+1, dv_ticks)
ax.set_xticks((ticks))
#ax.set_xticklabels((-150, -100, -50, 0, 50, 100, 150))
ax.set_xticklabels((-75, -25, 25, 75))
ax.set_xlabel('Velocity in primary star rest frame (km/s)')
ax.set_yticklabels(())
ax.set_ylabel('Observation Date')

# Colorbar
cb = plt.colorbar(out)
cb.set_label('CCF Power')

# Save
plt.savefig('{}Original_CCFs.pdf'.format(output_dir))


/home/kgullikson/anaconda3/envs/python2/lib/python2.7/site-packages/matplotlib/collections.py:590: FutureWarning: elementwise comparison failed; returning scalar instead, but in the future will perform elementwise comparison
  if self._edgecolors == str('face'):

In [4]:
avg_ccf = np.mean(ccfs, axis=0)
normed_ccfs = ccfs - avg_ccf

In [7]:
# Get the time each observation was made (in julian date)
dates = np.array([CombineCCFs.fits.getheader(fname)['HJD'] for fname in original_files])

In [6]:
# Set up the scaling manually
low, high = np.min(normed_ccfs), np.max(normed_ccfs)
rng = max(abs(low), abs(high))
vmin = np.sign(low) * rng
vmax = np.sign(high) * rng

# Make the actual plot
#cmap = sns.cubehelix_palette(reverse=False, as_cmap=True, gamma=1, rot=0.7, start=2) #defined above now...
fig, ax = plt.subplots(1, 1)
out = ax.imshow(normed_ccfs, cmap=cmap, aspect='auto', origin='lower')#, vmin=vmin, vmax=vmax)
ax.set_xlim(((min_v+400)/dV, (max_v+400)/dV))
ticks = np.arange((min_v+400)/dV, (max_v+400)/dV+1, dv_ticks)
ax.set_xticks((ticks))
#ax.set_xticklabels((-150, -100, -50, 0, 50, 100, 150))
ax.set_xticklabels((-75, -25, 25, 75))
ax.set_xlabel('Velocity (km/s)')
ax.set_yticklabels(())
ax.set_ylabel('Observation Date')

# Colorbar
cb = plt.colorbar(out)
cb.set_label('CCF Power')

fig.subplots_adjust(bottom=0.18, left=0.10, top=0.95, right=0.90)

plt.savefig('{}Resid_CCFs.pdf'.format(output_dir))



In [33]:
# Make the same plot, but with the y-axis linearized so that I can give dates.

X,Y = np.meshgrid(xgrid, dates-2450000)

fig, ax = plt.subplots(1, 1, figsize=(6,4))
out = ax.pcolormesh(X,Y,normed_ccfs, cmap=cmap, rasterized=True)
ax.set_xlabel('Velocity (km/s)')
ax.set_ylabel('JD - 2450000')
ax.set_xlim((-75, 75))
ax.set_ylim((Y.min(), Y.max()))


# Colorbar
cb = plt.colorbar(out)
cb.set_label('CCF Power')

fig.subplots_adjust(bottom=0.18, left=0.15, top=0.95, right=0.90)
plt.savefig('{}Resid_CCFs.pdf'.format(output_dir))
print(output_dir)


/home/kgullikson/School/Research/McDonaldData/PlanetData/Paper/Figures/

In [24]:
ax.pcolormesh?

In [8]:
def fwhm(x, y, search_range=(-500, 500)):
    good = (x > search_range[0]) & (x < search_range[1])
    x = x[good].copy()
    y = y[good].copy()
    idx = np.argmax(y)
    ymax = y[idx]
    half_max = ymax / 2.0
    
    # Find the first pixels less than half_max to the left of idx
    for di in range(1, idx):
        if y[idx-di] < half_max:
            break
    slope = (y[idx-(di+1)] - y[idx-di])/(x[idx-(di+1)] - x[idx-di])
    left = x[idx-di] + (half_max - y[idx-di])/slope
    
    # Find the first pixels less than half_max to the right of idx
    for di in range(1, len(x)-idx-1):
        if y[idx+di] < half_max:
            break
    slope = (y[idx+(di+1)] - y[idx+di])/(x[idx+(di+1)] - x[idx+di])
    right = x[idx+di] + (half_max - y[idx+di])/slope
    
    return left, x[idx], right

In [39]:
# Make plot of a normal residual CCF
sns.set_style('white')
sns.set_style('ticks')

i = 50
corr = normed_ccfs[i]
fig, ax = plt.subplots()
ax.plot(xgrid, corr, 'k-', lw=3)

l, m, h = fwhm(xgrid, corr, search_range=(-50, 10))
ylim = ax.get_ylim()
ax.plot([m, m], ylim, 'g--', alpha=0.7)
ax.plot([l, l], ylim, 'r--', alpha=0.7)
ax.plot([h, h], ylim, 'r--', alpha=0.7)

ax.set_xlim((-60, 20))
ax.set_ylim(ylim)

ax.set_xlabel('Velocity (km/s)')
ax.set_ylabel('CCF Power')
fig.subplots_adjust(bottom=0.18, left=0.20, top=0.95, right=0.95)

plt.savefig('{}Typical_CCF.pdf'.format(output_dir))


Measure the companion RVs.

The measured CCF velocities are in the primary star rest frame + some $\Delta v$ caused by the mismatch between the modeled index of refraction and the real index of refraction at McDonald observatory. That is a constant though. So, we get

$v_m(t) = v_2(t) - v_1(t) + \Delta v$

and

$v_2(t) = v_m(t) + v_1(t) - \Delta v$

where $v_m(t)$ are the measured radial velocities in the residual CCFS. But, all that get's done in the MCMC fitting code. Let's just measure $v_m$ for as many times as possible.


In [9]:
# Measure the radial velocities of the companion as the peak and FWHM of the residual CCF

date = []
rv1 = []
rv1_err = []
rv2 = []
rv2_err = []
import time
for i in range(10, len(original_files)):
#for i in range(20, 21):
    header = CombineCCFs.fits.getheader(original_files[i])
    jd = header['HJD']
    prim_rv = CombineCCFs.get_prim_rv(original_files[i], data_shift=0.0)
    measurements = CombineCCFs.get_measured_rv(original_files[i])
    rv1.append(measurements[0])
    rv1_err.append(measurements[1])
    
    try:
        l, m, h = fwhm(xgrid.copy(), normed_ccfs[i], search_range=(-50, 10))
        print('i = {}, HJD = {}\n\t{:.1f} +{:.1f}/-{:.1f}\n\t{}'.format(i, jd, m, h-m, m-l, original_files[i]))
        date.append(jd)
        rv2.append((h+l)/2.)
        rv2_err.append((h-l)/2.355)
    except:
        date.append(jd)
        rv2.append(np.nan)
        rv2_err.append(np.nan)
        continue
        
    plt.plot(xgrid, normed_ccfs[i])
    plt.xlim((-100, 50))
    ylim = plt.ylim()
    plt.plot([(h+l)/2., (h+l)/2.], ylim, 'g--')
    plt.savefig('Figures/CCF_{}.pdf'.format(original_files[i][:-5]))
    plt.cla()
    
    
rv1 = np.array(rv1)
rv1_err = np.array(rv1_err)
rv2 = np.array(rv2)
rv2_err = np.array(rv2_err)


i = 10, HJD = 2453928.79731
	-41.9 +5.7/-14.6
	RV44144-1_telluric_corrected.fits
i = 12, HJD = 2454279.75215
	-1.9 +1.3/-1.4
	RV46786-1_telluric_corrected.fits
i = 13, HJD = 2454279.75674
	-1.8 +1.3/-1.2
	RV46787-1_telluric_corrected.fits
i = 14, HJD = 2454309.79142
	-1.6 +1.3/-1.2
	RV46903-1_telluric_corrected.fits
i = 15, HJD = 2454345.62967
	-1.0 +0.8/-0.8
	RV47237-1_telluric_corrected.fits
i = 17, HJD = 2454662.92681
	-4.4 +2.7/-2.5
	RV50253-1_telluric_corrected.fits
i = 18, HJD = 2454665.7677
	-4.0 +2.5/-2.4
	RV50366-1_telluric_corrected.fits
i = 19, HJD = 2454665.77228
	-4.1 +2.6/-2.5
	RV50367-1_telluric_corrected.fits
i = 20, HJD = 2454730.70839
	-4.2 +2.7/-2.4
	RV50755-1_telluric_corrected.fits
i = 30, HJD = 2455100.5744
	-5.2 +3.1/-3.0
	RV56061-1_telluric_corrected.fits
i = 31, HJD = 2455100.57858
	-5.0 +3.1/-3.1
	RV56062-1_telluric_corrected.fits
i = 32, HJD = 2455398.75306
	-6.6 +3.7/-3.5
	RV60794-1_telluric_corrected.fits
i = 33, HJD = 2455790.72158
	-8.6 +4.7/-4.8
	RV67083-1_telluric_corrected.fits
i = 34, HJD = 2455869.57534
	-8.4 +4.5/-4.0
	RV68264-1_telluric_corrected.fits
i = 35, HJD = 2455910.56504
	-8.6 +4.7/-4.3
	RV69096-1_telluric_corrected.fits
i = 36, HJD = 2455992.01916
	-9.3 +4.9/-4.3
	RV70314-1_telluric_corrected.fits
i = 37, HJD = 2456016.92541
	-9.5 +4.7/-4.1
	RV70483-1_telluric_corrected.fits
i = 38, HJD = 2456106.77632
	-10.4 +4.8/-4.7
	RV71933-1_telluric_corrected.fits
i = 39, HJD = 2456138.83706
	-10.7 +5.2/-5.2
	RV72585-1_telluric_corrected.fits
i = 40, HJD = 2456145.65472
	-11.1 +5.4/-6.0
	RV72941-1_telluric_corrected.fits
i = 41, HJD = 2456145.65781
	-11.2 +5.4/-5.8
	RV72942-1_telluric_corrected.fits
i = 42, HJD = 2456145.66056
	-10.9 +5.3/-5.8
	RV72943-1_telluric_corrected.fits
i = 43, HJD = 2456173.73133
	-10.7 +5.2/-5.4
	RV74034-1_telluric_corrected.fits
i = 44, HJD = 2456401.96616
	-14.2 +5.0/-4.8
	RV78643-1_telluric_corrected.fits
i = 45, HJD = 2456401.96853
	-14.4 +4.8/-4.8
	RV78644-1_telluric_corrected.fits
i = 46, HJD = 2456433.74199
	-14.7 +4.6/-4.2
	RV79536-1_telluric_corrected.fits
i = 47, HJD = 2456433.74422
	-14.7 +4.7/-4.5
	RV79537-1_telluric_corrected.fits
i = 48, HJD = 2456435.87022
	-14.8 +4.6/-4.5
	RV79762-1_telluric_corrected.fits
i = 49, HJD = 2456435.87232
	-15.1 +4.5/-4.5
	RV79763-1_telluric_corrected.fits
i = 50, HJD = 2456461.87212
	-15.0 +4.5/-4.4
	RV80090-1_telluric_corrected.fits
i = 51, HJD = 2456461.87527
	-14.8 +4.8/-4.5
	RV80091-1_telluric_corrected.fits
i = 52, HJD = 2456461.87843
	-14.7 +4.4/-4.2
	RV80092-1_telluric_corrected.fits
i = 53, HJD = 2456465.80451
	-14.9 +3.9/-3.6
	RV80355-1_telluric_corrected.fits
i = 54, HJD = 2456497.85702
	-15.8 +5.1/-5.2
	RV80987-1_telluric_corrected.fits
i = 55, HJD = 2456519.61591
	-16.7 +4.1/-4.3
	RV81615-1_telluric_corrected.fits
i = 56, HJD = 2456519.61782
	-16.3 +4.2/-4.3
	RV81616-1_telluric_corrected.fits
i = 57, HJD = 2456525.66009
	-16.4 +4.6/-4.4
	RV82282-1_telluric_corrected.fits
i = 58, HJD = 2456560.58298
	-16.3 +6.3/-6.4
	RV83486-1_telluric_corrected.fits
i = 59, HJD = 2456564.59405
	-16.2 +6.1/-6.1
	RV83946-1_telluric_corrected.fits
i = 60, HJD = 2456613.55175
	-16.4 +6.9/-6.0
	RV85100-1_telluric_corrected.fits
i = 61, HJD = 2456614.57893
	-17.0 +6.5/-5.6
	RV85212-1_telluric_corrected.fits
i = 62, HJD = 2456755.98437
	-21.2 +5.0/-5.5
	RV87981-1_telluric_corrected.fits
i = 63, HJD = 2456759.96898
	-21.5 +5.0/-5.8
	RV88381-1_telluric_corrected.fits
i = 64, HJD = 2456784.83825
	-22.2 +5.4/-6.1
	RV88615-1_telluric_corrected.fits
i = 65, HJD = 2456816.67188
	-23.1 +5.0/-5.5
	RV89735-1_telluric_corrected.fits
i = 66, HJD = 2456816.67388
	-23.3 +4.7/-5.5
	RV89736-1_telluric_corrected.fits
i = 67, HJD = 2456860.72703
	-24.9 +5.5/-7.0
	RV90406-1_telluric_corrected.fits
i = 68, HJD = 2456860.72907
	-25.2 +5.3/-6.5
	RV90407-1_telluric_corrected.fits
i = 69, HJD = 2456885.6237
	-26.3 +5.0/-6.9
	RV91271-1_telluric_corrected.fits
i = 70, HJD = 2456938.63372
	-28.0 +6.0/-8.6
	RV92853-1_telluric_corrected.fits
i = 71, HJD = 2456938.63602
	-27.8 +5.6/-8.0
	RV92854-1_telluric_corrected.fits
i = 72, HJD = 2457092.01965
	-30.9 +6.4/-7.7
	RV95508-1_telluric_corrected.fits
i = 73, HJD = 2457109.849
	-31.0 +6.0/-9.6
	RV95899-1_telluric_corrected.fits
i = 74, HJD = 2457118.96201
	-30.5 +5.7/-7.0
	RV96457-1_telluric_corrected.fits
i = 75, HJD = 2457150.92343
	-29.3 +5.7/-7.2
	RV96752-1_telluric_corrected.fits
i = 76, HJD = 2457174.95965
	-28.0 +5.1/-6.3
	RV97456-1_telluric_corrected.fits
i = 77, HJD = 2457214.83258
	-24.2 +5.3/-6.3
	RV97829-1_telluric_corrected.fits
i = 78, HJD = 2457214.83594
	-24.7 +5.7/-7.0
	RV97830-1_telluric_corrected.fits
i = 79, HJD = 2457216.72647
	-24.3 +5.3/-6.9
	RV97987-1_telluric_corrected.fits
i = 80, HJD = 2457216.72862
	-24.5 +5.0/-6.3
	RV97988-1_telluric_corrected.fits
i = 81, HJD = 2457245.60314
	-21.7 +5.0/-6.0
	RV98358-1_telluric_corrected.fits
i = 82, HJD = 2457245.60539
	-21.6 +4.8/-5.3
	RV98359-1_telluric_corrected.fits
i = 83, HJD = 2457248.60697
	-21.3 +4.6/-5.3
	RV98649-1_telluric_corrected.fits

In [22]:
# I don't trust the very early measurements
rv2[:6] = np.nan*np.ones(6)
rv2_err[:6] = np.nan*np.ones(6)

In [23]:
# Save the RVs
np.savetxt('rv_data.txt', (date, rv1, rv1_err, rv2, rv2_err))

Fix the dates to line up with the RV output file


In [24]:
import pandas as pd
rv1_data = pd.read_fwf('../Planet-Finder/data/psi1draa_140p_28_37_ASW.dat', header=None)
t1 = rv1_data[0].values
rv1 = rv1_data[2].values / 1000. # Convert from m/s to km/s
rv1_err = rv1_data[3].values / 1000.

In [25]:
new_rv2 = np.empty_like(t1)
new_rv2_err = np.empty_like(t1)
for i, t1_i in enumerate(t1):
    #idx = np.searchsorted(t1, t2)
    idx = np.argmin(np.abs(date-t1_i))
    if abs(t1_i - date[idx]) < 0.001:
        print i, t1_i, date[idx], t1_i-date[idx]
        new_rv2[i] = rv2[idx]
        new_rv2_err[i] = rv2_err[idx]
    else:
        print i, t1_i, date[idx], np.nan
        new_rv2[i] = np.nan
        new_rv2_err[i] = np.nan


0 2451809.65957 2453928.79731 nan
1 2451809.67398 2453928.79731 nan
2 2452142.68049 2453928.79731 nan
3 2453319.63924 2453928.79731 nan
4 2453585.85392 2453928.79731 nan
5 2453585.87521 2453928.79731 nan
6 2453634.64131 2453928.79731 nan
7 2453635.62354 2453928.79731 nan
8 2453655.63647 2453928.79731 nan
9 2453655.64247 2453928.79731 nan
10 2453689.53829 2453928.79731 nan
11 2453907.84895 2453928.79731 nan
12 2453928.79732 2453928.79731 7.39935785532e-07
13 2454019.60277 2454019.60276 3.11015173793e-06
14 2454279.75215 2454279.75215 2.44984403253e-06
15 2454279.75674 2454279.75674 2.4102628231e-06
16 2454309.79142 2454309.79142 2.21002846956e-06
17 2454345.62968 2454345.62967 2.73995101452e-06
18 2454401.55955 2454401.55955 3.46032902598e-06
19 2454662.92681 2454662.92681 3.60002741218e-06
20 2454665.7677 2454665.7677 3.43006104231e-06
21 2454665.77229 2454665.77228 3.41981649399e-06
22 2454730.70839 2454730.70839 2.22958624363e-06
23 2454750.63706 2454750.63705 2.12015584111e-06
24 2454750.64165 2454750.64164 2.10991129279e-06
25 2454750.64623 2454750.64623 2.12015584111e-06
26 2454750.65121 2454750.65121 2.12993472815e-06
27 2454750.6558 2454750.6558 2.10991129279e-06
28 2454750.66038 2454750.66038 2.12993472815e-06
29 2454750.67062 2454750.67062 2.11037695408e-06
30 2454750.6752 2454750.6752 2.12993472815e-06
31 2454750.67979 2454750.67979 2.10991129279e-06
32 2455100.57486 2455100.5744 0.000460680108517
33 2455100.57927 2455100.57858 0.000692139845341
34 2455398.75306 2455398.75306 1.43004581332e-06
35 2455790.72158 2455790.72158 -5.24008646607e-06
36 2455869.57534 2455869.57534 -5.16977161169e-06
37 2455910.56505 2455910.56504 7.90227204561e-07
38 2455992.01915 2455992.01916 -4.91971150041e-06
39 2456016.9254 2456016.92541 -5.2098184824e-06
40 2456106.77631 2456106.77632 -6.66966661811e-06
41 2456138.83706 2456138.83706 -9.69972461462e-07
42 2456145.65471 2456145.65472 -6.16023316979e-06
43 2456145.65781 2456145.65781 -3.79979610443e-07
44 2456145.66055 2456145.66056 -6.17001205683e-06
45 2456173.73133 2456173.73133 -1.97999179363e-06
46 2456401.96617 2456401.96616 7.66012817621e-06
47 2456401.96854 2456401.96853 9.7299925983e-06
48 2456433.74198 2456433.74199 -5.06034120917e-06
49 2456433.74421 2456433.74422 -5.41005283594e-06
50 2456435.87021 2456435.87022 -1.18101015687e-05
51 2456435.87231 2456435.87232 -9.2601403594e-06
52 2456461.87214 2456461.87212 1.71498395503e-05
53 2456461.87526 2456461.87527 -4.42005693913e-06
54 2456461.8784 2456461.87843 -3.22200357914e-05
55 2456465.8045 2456465.80451 -5.68013638258e-06
56 2456497.85702 2456497.85702 3.69967892766e-06
57 2456519.61592 2456519.61591 3.3900141716e-06
58 2456525.6601 2456525.66009 1.65398232639e-05
59 2456560.58299 2456560.58298 8.27014446259e-06
60 2456564.59405 2456564.59405 -7.81984999776e-06
61 2456613.55172 2456613.55175 -2.77003273368e-05
62 2456614.57881 2456614.57893 -0.000117650255561
63 2456755.9844 2456755.98437 3.18503007293e-05
64 2456759.96891 2456759.96898 -7.18301162124e-05
65 2456784.83826 2456784.83825 7.32019543648e-06
66 2456816.67187 2456816.67188 -6.48992136121e-06
67 2456816.67388 2456816.67388 2.3297034204e-06
68 2456860.72703 2456860.72703 -6.98026269674e-06
69 2456860.72906 2456860.72907 -3.74019145966e-06
70 2456885.62395 2456885.6237 0.000258320011199
71 2456938.63372 2456938.63372 -4.50992956758e-06
72 2456938.636 2456938.63602 -1.37500464916e-05
73 2457092.01964 2457092.01965 -4.40003350377e-06
74 2457109.84901 2457109.849 7.03986734152e-06
75 2457118.96212 2457118.96201 0.000108350068331
76 2457150.92189 2457150.92343 nan
77 2457174.95967 2457174.95965 1.45402736962e-05
78 2457214.83269 2457214.83258 0.000114779919386
79 2457214.83594 2457214.83594 -2.61003151536e-06
80 2457216.72646 2457216.72647 -5.01982867718e-06
81 2457216.72862 2457216.72862 9.89995896816e-07
82 2457245.60314 2457245.60314 2.51969322562e-06
83 2457245.60539 2457245.60539 -3.51015478373e-06
84 2457248.60697 2457248.60697 -4.98257577419e-08

In [26]:
np.savetxt('../Planet-Finder/data/rv_data.txt', (t1, rv1, rv1_err, new_rv2, new_rv2_err))

In [ ]: