<jupyter_start><jupyter_text>K2 light curve<NAME> 7-17-18  Let's look at the K2 light curve in more detail<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
from matplotlib.ticker import MaxNLocator
import seaborn as sns
import pandas as pd
%config InlineBackend.figure_format = 'retina'
%matplotlib inline
df = pd.read_csv('../data/reduced/211414597.csv')
df.head()
plt.plot(df.cadenceTimes, df.singleScaleFluxValues, '.');
from astropy.stats import LombScargle
times = np.array(df.cadenceTimes)
freq = np.linspace(0.005, 0.2, 1000)
power = LombScargle(times, normflux).power(freq)
period = 1 / freq[np.where(power == power.max())]
print(period)<jupyter_output>[ 23.43420127]<jupyter_text>This is similar to the ASSASN period, so that's good. It also is NOT the binary period, which is 18.396 days (Leiner et al. 2017).<jupyter_code>plt.plot((1/freq), power)
plt.xlabel("Days")
plt.ylabel("Lomb Scargle Power")
plt.xlim(0,50);
obs = np.array(57138.64)
obsphase = np.mod(obs,period) / period

plt.plot(np.mod(df.cadenceTimes,period) / period, normflux, '.', alpha=0.3)
plt.axvline(obsphase, linestyle='dashed', color='k')
plt.xlabel("Phase")
plt.ylabel("Flux");<jupyter_output><empty_output><jupyter_text>So, the IGRINS observation is at max light, which is the least visible spot coverage. How does this correspond to using the light curve to set a minimum filling factor? Isn't that the minimum filling factor seen at light curve minimum?  Reminder that the IGRINS spectrum was obtained only half a day before the K2 light curve started:<jupyter_code>print(times.min() - obs)<jupyter_output>0.466200000003
{'fraction_non_alphanumeric': 0.11967921036397286, 'fraction_numerical': 0.04503392967304133, 'mean_word_length': 5.872881355932203, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 1, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '561195', 'license': 'MIT', 'n_tokens_mistral': 631, 'n_tokens_neox': 564, 'n_words': 164, 'path': 'notebooks/03_time_series_photometry/K2_lightcurve_analysis.ipynb', 'repo_name': 'BrownDwarf/subsub', 'size': '1625'}