def write(self, file_path, hoys=None, write_hours=False):
if not file_path.lower().endswith('<STR_LIT>'):<EOL><INDENT>file_path += '<STR_LIT>'<EOL><DEDENT>full_wea = False<EOL>if not hoys:<EOL><INDENT>hoys = self.hoys<EOL>full_wea = True<EOL><DEDENT>lines = [self.header]<EOL>if full_wea:<EOL><INDENT>for dir_rad, dif_rad, dt in zip(self.direct_normal_irradiance,<EOL>self.diffuse_horizontal_irradiance,<EOL>self.datetimes):<EOL><INDENT>line = "<STR_LIT>"% (dt.month, dt.day, dt.float_hour, dir_rad, dif_rad)<EOL>lines.append(line)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for hoy in hoys:<EOL><INDENT>try:<EOL><INDENT>dir_rad, dif_rad = self.get_irradiance_value_for_hoy(hoy)<EOL><DEDENT>except IndexError:<EOL><INDENT>print('<STR_LIT>'.format(dt))<EOL>continue<EOL><DEDENT>dt = DateTime.from_hoy(hoy)<EOL>dt = dt.add_minute(<NUM_LIT:30>) if self.timestep == <NUM_LIT:1> else dt<EOL>line = "<STR_LIT>"% (dt.month, dt.day, dt.float_hour, dir_rad, dif_rad)<EOL>lines.append(line)<EOL><DEDENT><DEDENT>file_data = '<STR_LIT>'.join(lines)<EOL>write_to_file(file_path, file_data, True)<EOL>if write_hours:<EOL><INDENT>hrs_file_path = file_path[:-<NUM_LIT:4>] + '<STR_LIT>'<EOL>hrs_data = '<STR_LIT:U+002C>'.join(str(h) for h in hoys) + '<STR_LIT:\n>'<EOL>write_to_file(hrs_file_path, hrs_data, True)<EOL><DEDENT>return file_path<EOL>
Write the wea file.

        WEA carries irradiance values from epw and is what gendaymtx uses to
        generate the sky.