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

Extending final_time by 1 hour for EPW radiation data #151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions mpcpy/exodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,28 +910,28 @@ def _read_timeseries_from_epw(self):
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.deg, start_time = self.start_time, final_time = self.final_time);
elif key == 'Horizontal infrared radiation':
varname = 'weaHHorIR';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Direct normal radiation':
varname = 'weaHDirNor';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Global horizontal radiation':
varname = 'weaHGloHor';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Diffuse horizontal radiation':
varname = 'weaHDifHor';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.W_m2, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Averaged global horizontal illuminance':
varname = 'weaIAveHor';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.lx, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.lx, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Direct normal illuminance':
varname = 'weaIDirNor';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.lx, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.lx, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Diffuse horizontal illuminance':
varname = 'weaIDifHor';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.lx, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.lx, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
elif key == 'Zenith luminance':
varname = 'weaZLum';
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.cd_m2, start_time = self.start_time, final_time = self.final_time);
self.data[varname] = self._dataframe_to_mpcpy_ts_variable(df_epw, key, varname, units.cd_m2, start_time = self.start_time, final_time = self.final_time + pd.Timedelta('1 hours'));
# Time shift the solar data back 30 minutes by linear interpolation (see Buildings.BoundaryConditions.WeatherData.ReaderTMY3 info)
for key in self.data.keys():
if key in ['weaHHorIR', 'weaHGloHor', 'weaHDirNor', 'weaHDifHor', \
Expand All @@ -940,7 +940,7 @@ def _read_timeseries_from_epw(self):
ts = ts_old.resample('30T').interpolate(method='time');
ts = ts.shift(freq = '-30T');
ts = ts.resample(rule='H').first();
ts = ts.ix[1:].append(ts_old.tail(n=1));
ts = ts.ix[1:];
self.data[key].set_data(ts);

class WeatherFromCSV(_Weather, utility._DAQ):
Expand Down