astrobase.hatsurveys.k2hat module

This contains functions for reading K2 CSV light-curves produced by the HAT Project into a Python dictionary. Requires numpy.

The only external function here is:

read_csv_lightcurve(lcfile)

Example:

Reading the best aperture LC for EPIC201183188 = UCAC4-428-055298 (see http://k2.hatsurveys.org to search for this object and download the light curve):

>>> import k2hat
>>> lcdict = k2hat.read_csv_lightcurve('UCAC4-428-055298-75d3f4357b314ff5ac458e917e6dfeb964877b60affe9193d4f65088-k2lc.csv.gz')

The Python dict lcdict contains the metadata and all columns.

>>> lcdict.keys()
['decl', 'objectid', 'bjdoffset', 'qualflag', 'fovchannel', 'BGV',
'aperpixradius', 'IM04', 'TF17', 'EP01', 'CF01', 'ra', 'fovmodule', 'columns',
'k2campaign', 'EQ01', 'fovccd', 'FRN', 'IE04', 'kepid', 'YCC', 'XCC', 'BJD',
'napertures', 'ucac4id', 'IQ04', 'kepmag', 'ndet','kernelspec']

The columns for the light curve are stored in the columns key of the dict. To get a list of the columns:

>>> lcdict['columns']
['BJD', 'BGV', 'FRN', 'XCC', 'YCC', 'IM04', 'IE04', 'IQ04', 'EP01', 'EQ01',
'TF17', 'CF01']

To get columns:

>>> bjd, epdmags = lcdict['BJD'], lcdict['EP01']
>>> bjd
array([ 2456808.1787283,  2456808.1991608,  2456808.2195932, ...,
        2456890.2535691,  2456890.274001 ,  2456890.2944328])
>>> epdmags
array([ 16.03474,  16.02773,  16.01826, ...,  15.76997,  15.76577,
        15.76263])
astrobase.hatsurveys.k2hat.read_csv_lightcurve(lcfile)[source]

This reads in a K2 lightcurve in CSV format. Transparently reads gzipped files.

Parameters:lcfile (str) – The light curve file to read.
Returns:Returns an lcdict.
Return type:dict