def _parse_csv_header(header):
<EOL>headerlines = header.split('<STR_LIT:\n>')<EOL>headerlines = [x.lstrip('<STR_LIT>') for x in headerlines]<EOL>objectstart = headerlines.index('<STR_LIT>')<EOL>metadatastart = headerlines.index('<STR_LIT>')<EOL>camfilterstart = headerlines.index('<STR_LIT>')<EOL>photaperturestart = headerlines.index('<STR_LIT>')<EOL>columnstart = headerlines.index('<STR_LIT>')<EOL>lcstart = headerlines.index('<STR_LIT>')<EOL>objectinfo = headerlines[objectstart+<NUM_LIT:1>:metadatastart-<NUM_LIT:1>]<EOL>metadatainfo = headerlines[metadatastart+<NUM_LIT:1>:camfilterstart-<NUM_LIT:1>]<EOL>camfilterinfo = headerlines[camfilterstart+<NUM_LIT:1>:photaperturestart-<NUM_LIT:1>]<EOL>photapertureinfo = headerlines[photaperturestart+<NUM_LIT:1>:columnstart-<NUM_LIT:1>]<EOL>columninfo = headerlines[columnstart+<NUM_LIT:1>:lcstart-<NUM_LIT:1>]<EOL>metadict = {'<STR_LIT>':{}}<EOL>objectinfo = [x.split('<STR_LIT:;>') for x in objectinfo]<EOL>for elem in objectinfo:<EOL><INDENT>for kvelem in elem:<EOL><INDENT>key, val = kvelem.split('<STR_LIT>',<NUM_LIT:1>)<EOL>metadict['<STR_LIT>'][key.strip()] = (<EOL>_smartcast(val, METAKEYS[key.strip()])<EOL>)<EOL><DEDENT><DEDENT>metadict['<STR_LIT>'] = metadict['<STR_LIT>']['<STR_LIT>'][:]<EOL>del metadict['<STR_LIT>']['<STR_LIT>']<EOL>metadatainfo = [x.split('<STR_LIT:;>') for x in metadatainfo]<EOL>for elem in metadatainfo:<EOL><INDENT>for kvelem in elem:<EOL><INDENT>try:<EOL><INDENT>key, val = kvelem.split('<STR_LIT>',<NUM_LIT:1>)<EOL>if key.strip() == '<STR_LIT>':<EOL><INDENT>val = json.loads(val)<EOL><DEDENT>if key.strip() in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>val = int(val)<EOL><DEDENT>if key.strip() == '<STR_LIT>':<EOL><INDENT>val = float(val)<EOL><DEDENT>metadict[key.strip()] = val<EOL><DEDENT>except Exception as e:<EOL><INDENT>LOGWARNING('<STR_LIT>'<EOL>'<STR_LIT>' % kvelem)<EOL><DEDENT><DEDENT><DEDENT>metadict['<STR_LIT>'] = []<EOL>for row in camfilterinfo:<EOL><INDENT>filterid, filtername, filterdesc = row.split('<STR_LIT>')<EOL>metadict['<STR_LIT>'].append((int(filterid),<EOL>filtername,<EOL>filterdesc))<EOL><DEDENT>metadict['<STR_LIT>'] = {}<EOL>for row in photapertureinfo:<EOL><INDENT>apnum, appix = row.split('<STR_LIT>')<EOL>appix = float(appix.rstrip('<STR_LIT>'))<EOL>metadict['<STR_LIT>'][apnum.strip()] = appix<EOL><DEDENT>metadict['<STR_LIT>'] = []<EOL>for row in columninfo:<EOL><INDENT>colnum, colname, coldesc = row.split('<STR_LIT>')<EOL>metadict['<STR_LIT>'].append(colname)<EOL><DEDENT>return metadict<EOL>
This parses the CSV header from the CSV HAT sqlitecurve.

Returns a dict that can be used to update an existing lcdict with the
relevant metadata info needed to form a full LC.