Skip to content
Snippets Groups Projects
Commit 78d47195 authored by Christoph von Oy's avatar Christoph von Oy
Browse files

Made t_step and t_horizon be interpreted correctly

Fixed focus-framework#44
parent 06ec20da
No related branches found
No related tags found
No related merge requests found
......@@ -26,27 +26,7 @@ import numpy as np
import pandas as pd
from datetime import timedelta
def set_dates(t_start, t_horizon, t_step):
"""
The method XYZ adds ...
:param
XYZ:
:returns
XYZ
"""
time_steps = []
for t in pd.date_range(pd.Timestamp(t_start), pd.Timestamp(t_start) +
timedelta(hours=t_horizon) -
timedelta(hours=t_step),
freq=str(t_step) + 'H'):
time_steps.append(t)
return time_steps
def calc_total_irradiance(irradiance, timer, beta, psi_f, phi, lambda_st, lambda_1, alpha_albedo=0.2, reflection=1,
refraction_index=2):
def calc_total_irradiance(irradiance, timer, beta, psi_f, phi, lambda_st, lambda_1, alpha_albedo=0.2, reflection=1, refraction_index=2):
"""
check value: alpha_albedo: ground reflectivity
Reflection = 1?
......@@ -138,22 +118,10 @@ def calc_total_irradiance(irradiance, timer, beta, psi_f, phi, lambda_st, lambda
g_total = g_diffuse + g_reflected + g_beam
return g_total
def generate_g_t_series(irradiance, beta, psi_f, phi, lambda_st, lambda_1, t_start, t_horizon, t_step):
"""
The method XYZ adds ...
:param
XYZ:
:returns
XYZ
"""
T = set_dates(t_start, t_horizon, t_step)
T = list(pd.date_range(pd.Timestamp(t_start), pd.Timestamp(t_start) + timedelta(hours=t_horizon * t_step - t_step), freq=str(t_step) + 'H'))
g_total_lst = []
for itr in range(len(T)):
timer = T[itr]
g_total = calc_total_irradiance(irradiance.loc[timer], timer, beta, psi_f, phi, lambda_st, lambda_1)
g_total_lst.append(g_total)
for t in T:
g_total_lst.append(calc_total_irradiance(irradiance.loc[t], t, beta, psi_f, phi, lambda_st, lambda_1))
return pd.Series(data=g_total_lst, index=T)
......@@ -63,7 +63,7 @@ def process_input_profiles(input_profile_dict, t_start, t_horizon, t_step):
def generate_profile(profile_type, parameters, input_profiles, t_start, t_horizon, t_step):
t_last = t_start + pd.Timedelta(hours = (t_horizon - 1) * t_step)
t_last = t_start + pd.Timedelta(hours = t_horizon * t_step - t_step)
years = range(t_start.year, t_last.year + 1)
if profile_type == 'elec_demand':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment