Skip to content

EPW radiation data final timestep timeseries value changes in next timestep. #149

@TStesco

Description

@TStesco

WeatherFromEPW._read_timeseries_from_epw gives changing values for final hour radiation variables. This is because after resampling the values, interpolating, and shifting 30 minutes backwards (as mentioned in Buildings.BoundaryConditions.WeatherData.ReaderTMY3) the original unshifted uninterpolated value is appended as the final value in the timeseries (see exodata.py line 956).

This value for the hourly radiation will then change if it is not the final hour in the timeseries (see reproducing code). There is a simple fix to read one timestep further for radiation data then do the resampling, interpolation, and time shift - without appending the original value at the end. I would happily send a pull request implementing this if it is sufficient. Although, perhaps there are already some rewrites to EPW time interval handling already in the works (#143)? Please let me know - thanks!

minimal reproducing code (have to add local .epw file path):

from mpcpy import exodata
import datetime
weather = exodata.WeatherFromEPW(
    '/root/data/CHE_Geneva.067000_IWEC.epw',
    standard_time=True
)
start_time = datetime.datetime.strptime('4/2/2017 01:00:00', '%m/%d/%Y %H:%M:%S')
final_time = datetime.datetime.strptime('4/2/2017 07:00:00', '%m/%d/%Y %H:%M:%S')
weather.collect_data(start_time, final_time)
weather.data['weaHGloHor'].display_data()

start_time += datetime.timedelta(hours=1)
final_time += datetime.timedelta(hours=1)
weather.collect_data(start_time, final_time)
weather.data['weaHGloHor'].display_data()

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions