def read_original_textlc(lcpath):
LOGINFO('<STR_LIT>'.format(lcpath))<EOL>N_lines_to_parse_comments = <NUM_LIT:50><EOL>with open(lcpath, '<STR_LIT:rb>') as file:<EOL><INDENT>head = [next(file) for ind in range(N_lines_to_parse_comments)]<EOL><DEDENT>N_comment_lines = len([l for l in head if l.decode('<STR_LIT>')[<NUM_LIT:0>] == '<STR_LIT:#>'])<EOL>if N_comment_lines < N_lines_to_parse_comments:<EOL><INDENT>LOGERROR(<EOL>'<STR_LIT>'.format(fpath=lcpath)<EOL>)<EOL>return None<EOL><DEDENT>first_data_line = list(<EOL>filter(None, head[N_comment_lines].decode('<STR_LIT>').split())<EOL>)<EOL>N_cols = len(first_data_line)<EOL>if N_cols == <NUM_LIT>:<EOL><INDENT>colformat = '<STR_LIT>'<EOL><DEDENT>elif N_cols == <NUM_LIT:20>:<EOL><INDENT>colformat = '<STR_LIT>'<EOL><DEDENT>elif N_cols == <NUM_LIT:32>:<EOL><INDENT>colformat = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>LOGERROR("<STR_LIT>"<EOL>"<STR_LIT>".format(fpath=lcpath,<EOL>ncols=N_cols))<EOL>return None<EOL><DEDENT>if colformat == '<STR_LIT>':<EOL><INDENT>col_names = ['<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>']<EOL>col_dtypes = ['<STR_LIT>',float,<EOL>float,float,'<STR_LIT>',<EOL>float,float,'<STR_LIT>',<EOL>float,float,'<STR_LIT>',<EOL>float,float,float,<EOL>float,float,float]<EOL>dtype_pairs = [el for el in zip(col_names, col_dtypes)]<EOL>data = np.genfromtxt(lcpath, names=col_names, dtype=col_dtypes,<EOL>skip_header=N_comment_lines, delimiter=None)<EOL>out = {}<EOL>for ix in range(len(data.dtype.names)):<EOL><INDENT>out[data.dtype.names[ix]] = data[data.dtype.names[ix]]<EOL><DEDENT><DEDENT>elif colformat == '<STR_LIT>':<EOL><INDENT>col_names = ['<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>',<EOL>'<STR_LIT>','<STR_LIT>','<STR_LIT>']<EOL>col_dtypes = ['<STR_LIT>',float,<EOL>float,float,'<STR_LIT>',<EOL>float,float,'<STR_LIT>',<EOL>float,float,'<STR_LIT>',<EOL>float,float,float,<EOL>float,float,float,<EOL>float,float,float]<EOL>dtype_pairs = [el for el in zip(col_names, col_dtypes)]<EOL>data = np.genfromtxt(lcpath, names=col_names, dtype=col_dtypes,<EOL>skip_header=N_comment_lines, delimiter=None)<EOL>out = {}<EOL>for ix in range(len(data.dtype.names)):<EOL><INDENT>out[data.dtype.names[ix]] = data[data.dtype.names[ix]]<EOL><DEDENT><DEDENT>elif colformat == '<STR_LIT>':<EOL><INDENT>col_names = ['<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>',<EOL>'<STR_LIT>', '<STR_LIT>', '<STR_LIT>']<EOL>out = astascii.read(lcpath, names=col_names, comment='<STR_LIT:#>')<EOL><DEDENT>return out<EOL>
Read .epdlc, and .tfalc light curves and return a corresponding labelled
dict (if LC from <2012) or astropy table (if >=2012). Each has different
keys that can be accessed via .keys()

Input:
lcpath: path (string) to light curve data, which is a textfile with HAT
LC data.

Example:
dat = read_original_textlc('HAT-115-0003266.epdlc')