<jupyter_start><jupyter_text>`ApJdataFrames` Douglas_2017 *Extra, 1*---`Title`: Poking the Beehive from Space: K2 Rotation Periods for Praesepe    `Authors`: <NAME>, <NAME>, <NAME>, and <NAME>Data is from this paper:  http://iopscience.iop.org/article/10.3847/1538-4357/aa6e52/meta<jupyter_code>%matplotlib inline
import matplotlib.pyplot as plt
import seaborn as sns
import pandas as pd
pd.options.display.max_columns = 150
%config InlineBackend.figure_format = 'retina'
import astropy
from astropy.table import Table
from astropy.io import ascii
import numpy as np<jupyter_output><empty_output><jupyter_text>Douglas et al. 2016 Tables 2 & 3<jupyter_code>df2 = pd.read_csv('../data/Douglas2017/tab2.csv')
df3 = pd.read_csv('../data/Douglas2017/tab3.csv')<jupyter_output><empty_output><jupyter_text>Spectroscopic selection for iSHELL C16 monitoring Selection criteria for iSHELL0. Previously observed by Douglas et al. 20171. Being observed in K2 C162. Bright enough for iSHELL3. Large amplitude of starspot modulation4. Medium-to-low period (lower vsini, on average) The K2 website has the list of targets in C16<jupyter_code>c16_GO_url = 'https://keplerscience.arc.nasa.gov/data/campaigns/c16/K2Campaign16targets.csv'
df_GO_c16 = pd.read_csv(c16_GO_url)
df3.shape, df_GO_c16.shape
df_C16 = pd.merge(df3, df_GO_c16, how = 'inner', left_on='EPIC', right_on='EPIC ID')
df_C16.shape<jupyter_output><empty_output><jupyter_text>OK, so 308 targets are being re-observed.  Good.<jupyter_code>plt.figure(figsize=(5,5))
plt.plot(df_C16.Kmag, df_C16['Raw-Amp'], '.', ms=3, color='#BBBBBB')
plt.xlim(8, 20)
plt.ylim(0, 0.11)
plt.xlabel('$K$ (mag)')
plt.ylabel('Amplitude (mag)')<jupyter_output><empty_output><jupyter_text>The iSHELL exposure time calculator indicates a 10.9 magnitude can be achieved in 10 minutes with 6 cycles with a 0.75 arcsecond slit in 0.8 arcsecond seeing.  We don't want to go too bright, because those targets are likely to be more massive stars, which don't show starspots, or are facula dominated.<jupyter_code>df_C16['Raw-Amp'].max()
plt.figure(figsize=(5,10))
plt.axvspan(9.5, 10.9, alpha=0.5, color='#f39c12')
plt.axhspan(0.03, 0.285, alpha=0.5, color='#1abc9c')
plt.plot(df_C16.Kmag, df_C16['Raw-Amp'], 'o', ms=3, color='#2980b9', mec='#ecf0f1')
plt.xlim(8, 20)
plt.ylim(0, 0.30)



plt.xlabel('$K$ (mag)')
plt.ylabel('Amplitude (mag)')
plt.savefig('/Users/obsidian/Desktop/beehive/iSHELL_beehive.png', dpi=300)<jupyter_output><empty_output><jupyter_text>Well, there are a few objects in the target range.<jupyter_code>subset = (df_C16.Kmag > 9.5) & (df_C16.Kmag < 10.9) & (df_C16['Raw-Amp'] > 0.03)
df_C16[subset]
df_C16.columns
df_C16[subset]
good_cols = ['NAME', 'EPIC', 'Mass', "r'mag", 'Kmag', 'Prot1',
       'Clean?', 'Multi-Prot?',
       'Spot-Evol?', 'Blended?', 'Binary', 'Raw-Amp', 'Smoothed-Amp',
       'Prot-Flag',
       'Kpmag', 'EPIC ID', ' RA (J2000) [deg]', ' Dec (J2000) [deg]',
       ' magnitude']
df_C16.columns
df_C16[subset][good_cols].T
pd.merge(df_C16[subset][good_cols], df2, on='EPIC').T<jupyter_output><empty_output><jupyter_text>Read in the lightcurve<jupyter_code>df_vdb = pd.read_csv('~/Desktop/beehive/c05/211900000/35518/' + \
                     'hlsp_k2sff_k2_lightcurve_211935518-c05_kepler_v1_llc-default-aper.txt', usecols=[0,1])
df_vdb.columns
#plt.plot(df_vdb['BJD - 2454833'], df_vdb[' Corrected Flux'])
#phased = np.mod(df_vdb['BJD - 2454833'], 3.932626)
#plt.plot(phased, df_vdb[' Corrected Flux'], '.')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15705311250713877, 'fraction_numerical': 0.07081667618503712, 'mean_word_length': 5.723608445297505, 'pattern_counts': {'":': 0, '<': 34, '<?xml version=': 0, '>': 35, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '7', 'dir': 'jupyter-structured-clean-dedup', 'id': '106313', 'license': 'MIT', 'n_tokens_mistral': 1610, 'n_tokens_neox': 1421, 'n_words': 290, 'path': 'notebooks/Douglas2017_extra_1.ipynb', 'repo_name': 'BrownDwarf/ApJdataFrames', 'size': '3523'}