def to_wea(self, file_path, hoys=None):
hoys = hoys or xrange(len(self.direct_normal_radiation.datetimes))<EOL>if not file_path.lower().endswith('<STR_LIT>'):<EOL><INDENT>file_path += '<STR_LIT>'<EOL><DEDENT>originally_ip = False<EOL>if self.is_ip is True:<EOL><INDENT>self.convert_to_si()<EOL>originally_ip = True<EOL><DEDENT>lines = [self._get_wea_header()]<EOL>datetimes = self.direct_normal_radiation.datetimes<EOL>for hoy in hoys:<EOL><INDENT>dir_rad = self.direct_normal_radiation[hoy]<EOL>dif_rad = self.diffuse_horizontal_radiation[hoy]<EOL>line = "<STR_LIT>"% (datetimes[hoy].month,<EOL>datetimes[hoy].day,<EOL>datetimes[hoy].hour + <NUM_LIT:0.5>,<EOL>dir_rad, dif_rad)<EOL>lines.append(line)<EOL><DEDENT>file_data = '<STR_LIT>'.join(lines)<EOL>write_to_file(file_path, file_data, True)<EOL>if originally_ip is True:<EOL><INDENT>self.convert_to_ip()<EOL><DEDENT>return file_path<EOL>
Write an wea file from the epw file.

        WEA carries radiation values from epw. Gendaymtx uses these values to
        generate the sky. For an annual analysis it is identical to using epw2wea.

        args:
            file_path: Full file path for output file.
            hoys: List of hours of the year. Default is 0-8759.