-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodul_1_IND_E.py
167 lines (115 loc) · 7.03 KB
/
modul_1_IND_E.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# -*- coding: utf-8 -*-
"""
Created on Tue Mar 30 15:52:10 2021
@author: asandhaa
"""
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import modul_plot_IND_E
def modul_1_el(industry_number, PATH):
"""Input 1: Normierte Tageslastprofile Load_profiles_enduser.xlsx """
load_prof_enduser = pd.read_excel(PATH+'\\Electrical\\Load_profiles_enduser.xlsx', usecols=('B:J'), sheet_name='Week_day')
load_prof_enduser.drop('unstetige mech. Antriebe', axis=1 ,inplace=True)
load_prof_enduser.dropna(axis=0,inplace=True)
profiles_weekday = load_prof_enduser.rename(columns={'stetige mech. Antriebe': 'Mechanische Antriebe'})
load_prof_enduser = pd.read_excel(PATH+'\\Electrical\\Load_profiles_enduser.xlsx', usecols=('B:J'), sheet_name='Saturday')
load_prof_enduser.drop('unstetige mech. Antriebe', axis=1 ,inplace=True)
load_prof_enduser.dropna(axis=0,inplace=True)
profiles_saturday = load_prof_enduser.rename(columns={'stetige mech. Antriebe': 'Mechanische Antriebe'})
load_prof_enduser = pd.read_excel(PATH+'\\Electrical\\Load_profiles_enduser.xlsx', usecols=('B:J'), sheet_name='Sunday')
load_prof_enduser.drop('unstetige mech. Antriebe', axis=1 ,inplace=True)
load_prof_enduser.dropna(axis=0,inplace=True)
profiles_sunday = load_prof_enduser.rename(columns={'stetige mech. Antriebe': 'Mechanische Antriebe'})
load_prof_enduser = pd.read_excel(PATH+'\\Electrical\\Load_profiles_enduser.xlsx', usecols=('B:J'), sheet_name='Holiday')
load_prof_enduser.drop('unstetige mech. Antriebe', axis=1 ,inplace=True)
load_prof_enduser.dropna(axis=0,inplace=True)
profiles_holiday = load_prof_enduser.rename(columns={'stetige mech. Antriebe': 'Mechanische Antriebe'})
profiles_constant = profiles_weekday.copy()
profiles_constant.loc[:,:] =1
"""Input 2: Tabelle mit allen Informationen zu Industrietypen"""
all_info_wz = pd.read_excel(PATH+'\\Electrical\\All_info_industry_types_electrical.xlsx'.format())
all_info_wz.dropna(how='all',axis=0, inplace=True)
all_info_wz.dropna(how='all',axis=1, inplace=True)
all_info_wz.fillna(0, inplace=True)
"""Filtern der Infos für ausgewählten Industrietyp"""
data_industry_type = all_info_wz[all_info_wz.industry_number.eq(industry_number)] #filters the row with specific industry_wz
energy_enduser_industry_type = data_industry_type[['Raumwärme', 'Warmwasser', 'Prozesswärme', 'Klimakälte',
'Prozesskälte', 'Beleuchtung', 'IKT', 'Mechanische Antriebe']].values #extracts enduser values
energy_enduser_industry_type = energy_enduser_industry_type.astype(np.float)
"""ERSTELLUNG normierter Tageslastprofile"""
"""WEEK DAY"""
y = profiles_weekday.mul(energy_enduser_industry_type, axis=1) #Anwendungsprofile * Anteile der Anwendungen
#modul_plot_IND_E.day_electrical(y)
y['Total'] = y.sum(axis=1)
weekday_1 = y
"""SATURDAY"""
y = profiles_saturday.mul(energy_enduser_industry_type, axis=1) #Anwendungsprofile * Anteile der Anwendungen
#modul_plot_IND_E.day_electrical(y)
y['Total'] = y.sum(axis=1)
saturday_1 = y
"""SUNDAY"""
y = profiles_sunday.mul(energy_enduser_industry_type, axis=1) ##Anwendungsprofile * Anteile der Anwendungen
#modul_plot_IND_E.day_electrical(y)
y['Total'] = y.sum(axis=1)
sunday_1 = y
"""HOLIDAY"""
y = profiles_holiday.mul(energy_enduser_industry_type, axis=1) #Anwendungsprofile * Anteile der Anwendungen
#modul_plot_IND_E.day_electrical(y)
y['Total'] = y.sum(axis=1)
holiday_1 = y
"""Constant"""
y = profiles_constant.mul(energy_enduser_industry_type, axis=1) #Anwendungsprofile * Anteile der Anwendungen
#modul_plot_IND_E.day_electrical(y)
y['Total'] = y.sum(axis=1)
constant_1 = y
return weekday_1, saturday_1, sunday_1, holiday_1, constant_1, data_industry_type
def modul_1_th(industry_number, PATH):
"""Input 1: Normierte Tageslastprofile Load_profiles_enduser.xlsx """
profiles_weekday = pd.read_excel(PATH+'\\Thermal\\Load_profiles_daytypes.xlsx', sheet_name='Week_day', index_col=0)
profiles_saturday = pd.read_excel(PATH+'\\Thermal\\Load_profiles_daytypes.xlsx', sheet_name='Saturday', index_col=0)
profiles_sunday = pd.read_excel(PATH+'\\Thermal\\Load_profiles_daytypes.xlsx', sheet_name='Sunday', index_col=0)
profiles_holiday = pd.read_excel(PATH+'\\Thermal\\Load_profiles_daytypes.xlsx', sheet_name='Holiday', index_col=0)
profiles_constant = profiles_weekday.copy()
profiles_constant.loc[:,:] =1
"""Input 2: Tabelle mit allen Informationen zu Industrietypen"""
all_info_wz = pd.read_excel(PATH+'\\Thermal\\All_info_industry_types_thermal.xlsx'.format())
all_info_wz.dropna(how='all',axis=0, inplace=True)
all_info_wz.dropna(how='all',axis=1, inplace=True)
all_info_wz.fillna(0, inplace=True)
"""Filtern der Infos für ausgewählten Industrietyp"""
data_industry_type = all_info_wz[all_info_wz.industry_number.eq(industry_number)] #filters the row with specific industry_wz
energy_enduser_industry_type = data_industry_type.iloc[:,3:9] #extracts temp range values
energy_enduser_industry_type = energy_enduser_industry_type.astype(np.float)
"""ERSTELLUNG normierter Tageslastprofile"""
"""WEEK DAY"""
y = pd.DataFrame(index=profiles_weekday.index, columns = energy_enduser_industry_type.columns)
for i in range(len(y.columns)):
y.iloc[:,i]=profiles_weekday*float(energy_enduser_industry_type.iloc[:,i])
y['Total']=y.sum(axis=1)
weekday_1 = y
"""SATURDAY"""
y = pd.DataFrame(index=profiles_saturday.index, columns = energy_enduser_industry_type.columns)
for i in range(len(y.columns)):
y.iloc[:,i]=profiles_saturday*float(energy_enduser_industry_type.iloc[:,i])
y['Total']=y.sum(axis=1)
saturday_1 = y
"""SUNDAY"""
y = pd.DataFrame(index=profiles_sunday.index, columns = energy_enduser_industry_type.columns)
for i in range(len(y.columns)):
y.iloc[:,i]=profiles_sunday*float(energy_enduser_industry_type.iloc[:,i])
y['Total']=y.sum(axis=1)
sunday_1 = y
"""HOLIDAY"""
y = pd.DataFrame(index=profiles_holiday.index, columns = energy_enduser_industry_type.columns)
for i in range(len(y.columns)):
y.iloc[:,i]=profiles_holiday*float(energy_enduser_industry_type.iloc[:,i])
y['Total']=y.sum(axis=1)
holiday_1 = y
"""CONSTANT"""
y = pd.DataFrame(index=profiles_constant.index, columns = energy_enduser_industry_type.columns)
for i in range(len(y.columns)):
y.iloc[:,i]=profiles_constant*float(energy_enduser_industry_type.iloc[:,i])
y['Total']=y.sum(axis=1)
constant_1 = y
return weekday_1, saturday_1, sunday_1, holiday_1, constant_1, data_industry_type