def _init_header(self, string):
taf_header_pattern = """<STR_LIT>"""<EOL>metar_header_pattern = """<STR_LIT>"""<EOL>header_taf = re.match(taf_header_pattern, string, re.VERBOSE)<EOL>header_metar = re.match(metar_header_pattern, string, re.VERBOSE)<EOL>if header_taf:<EOL><INDENT>header_dict = header_taf.groupdict()<EOL>header_dict['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>elif header_metar:<EOL><INDENT>header_dict = header_metar.groupdict()<EOL>header_dict['<STR_LIT>'] = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise MalformedTAF("<STR_LIT>")<EOL><DEDENT>return header_dict<EOL>
Extracts header part from TAF/METAR string and populates header dict

        Args:
            TAF/METAR report string

        Raises:
            MalformedTAF: An error parsing the report

        Returns:
            Header dictionary