I am creating a new EPW from measured data using ladybug. Here is a code sample
epw_data = EPW.from_missing_values()
from ladybug.location import Location
epw_data.location = Location('Paris',None,'FR',48.85,2.35,1,35.0)
epw_data.years.values = df_epw_file.index.year.values
for col in set(df_epw_file.columns):
if np.any(np.isnan(df_epw_file[col].values)):
continue
col_formatted = col.lower().replace(" ","_")
if hasattr(epw_data, col_formatted):
getattr(epw_data, col_formatted).values = df_epw_file[col].values
epw_data.write(str(write_location))
This is not stand alone but that gives an idea. The problem i face is in the saved file, the last line of the epw is weird. See below the last two lines
2021,12,31,23,0,?9?9?9?9E0?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9*9*9?9?9?9,10.87,10.11,96.3,102618.0,9999,9999,331.23,9999,0.0,0.0,999999,999999,999999,9999,229.84,2.92,8.87,99,9999,99999,9,999999999,999,999,0.0,99,999,0.0,99
2021,1,31,24,0,?9?9?9?9E0?9?9?9?9?9?9?9?9?9?9?9?9?9?9?9*9*9?9?9?9,-1.02,-1.5,97.83,102618.0,9999,9999,235.24,9999,0.0,0.0,999999,999999,999999,9999,315.2,1.54,2.35,99,9999,99999,9,999999999,999,999,0.0,99,999,0.0,99
it is finishing with a line that has month = 1 instead of 12 and the data is not what I have input in the fields. I made sure I am assigning tables of length 8760. I am doing something wrong ?