Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TStesco opened this issue Jul 20, 2018 · 4 comments
Labels

Comments

@TStesco
Copy link

TStesco commented Jul 20, 2018

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()
@dhblum
Copy link
Collaborator

dhblum commented Jul 23, 2018

Hey Tom, thanks for reporting the issue. I will have a look at it in the coming days.

@TStesco
Copy link
Author

TStesco commented Jul 24, 2018

Great thanks, I implemented the fix mentioned locally and it appears to give the expected behaviour.

@dhblum
Copy link
Collaborator

dhblum commented Jul 26, 2018

Hey Tom, thanks for implementing a suggested fix. Can you please send the pull request?

@TStesco
Copy link
Author

TStesco commented Jul 26, 2018

Sure, adding the pull request for information - it's nothing fancy but gets around having to append an uninterpolated final value in the timeseries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants