mostapha:
from ladybug.epw import EPW
from ladybug.analysisperiod import AnalysisPeriod
# Change the original file to a valid path. Here is an example
# original_file = r'C:\EnergyPlusV8-6-0\WeatherData\USA_CA_San.Francisco.Intl.AP.724940_TMY3.epw'
original_file = r'PATH_TO_YOUR_WEATHER_FILE'
epw_file = EPW(original_file)
zero_values = 8760 * [0]
ap = AnalysisPeriod() # create an annual analysis period
# set radiation values to 0
epw_file.direct_normal_radiation.update_data_for_analysis_period(zero_values, ap)
epw_file.diffuse_horizontal_radiation.update_data_for_analysis_period(zero_values, ap)
epw_file.global_horizontal_radiation.update_data_for_analysis_period(zero_values, ap)
# save first modified file
epw_file.save(r'c:\ladybug', '{}_zero_radiation.epw'.format(epw_file.location.city))
# now update temperature values
epw_file.dew_point_temperature.update_data_for_analysis_period(zero_values, ap)
epw_file.dry_bulb_temperature.update_data_for_analysis_period(zero_values, ap)
# save second modified file
epw_file.save(r'c:\ladybug', '{}_zero_temp_radiation.epw'.format(epw_file.location.city))
Hi,
I’m trying to use this code to replace the dry-bulb temperature of the epw file with my own data. However, I get this error : ‘HourlyContinuousCollection’ object has no attribute ‘update_data_for_analysis_period’. I really appreciate your help if you can help me with this issue