-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathClearskyplot.py
71 lines (59 loc) · 2.27 KB
/
Clearskyplot.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
# -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
"""
import pandas as pd
import matplotlib as plt
import numpy as np
import matplotlib.pyplot as plt
july = pd.read_csv(r'C:\Users\sarth\Desktop\Solar\July.csv')
# columns are series
dni = july.loc[:, 'DNI']
#clearskydni = july.loc[:, 'Clearsky DNI']
# cloudtype
# gets the averages for each hour from 8 am to 6 pm
dniavg = [july.loc[0:32, 'DNI'].mean(),
july.loc[33:63, 'DNI'].mean(),
july.loc[64:94, 'DNI'].mean(),
july.loc[95:125, 'DNI'].mean(),
july.loc[126:156, 'DNI'].mean(),
july.loc[157:187, 'DNI'].mean(),
july.loc[188:218, 'DNI'].mean(),
july.loc[219:249, 'DNI'].mean(),
july.loc[250:280, 'DNI'].mean(),
july.loc[281:311, 'DNI'].mean(),
july.loc[312:342, 'DNI'].mean(),
july.loc[343:373, 'DNI'].mean()
]
# basic DNI vs. hourly plot
"""
plt.plot([8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], dniavg, c='r', label = 'DNI Avg Per Hour', hold = 'on')
plt.xlabel("Hour, In Military Time")
plt.ylabel("DNI(w/m\u00b2)")
plt.show()
"""
# average for clearsky DNI
clearskyavg = [
july.loc[0:32, 'Clearsky DNI'].mean(),
july.loc[33:63, 'Clearsky DNI'].mean(),
july.loc[64:94, 'Clearsky DNI'].mean(),
july.loc[95:125, 'Clearsky DNI'].mean(),
july.loc[126:156, 'Clearsky DNI'].mean(),
july.loc[157:187, 'Clearsky DNI'].mean(),
july.loc[188:218, 'Clearsky DNI'].mean(),
july.loc[219:249, 'Clearsky DNI'].mean(),
july.loc[250:280, 'Clearsky DNI'].mean(),
july.loc[281:311, 'Clearsky DNI'].mean(),
july.loc[312:342, 'Clearsky DNI'].mean(),
july.loc[343:373, 'Clearsky DNI'].mean()
]
# my attempt at plotting both DNI and Clearsky DNI on one plot
fig = plt.figure()
ax = fig.add_subplot(1, 1, 1)
ax.plot([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], dniavg, c='r', label = 'DNI Avg Per Hour')
ax.plot([7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18], clearskyavg, c='g', label = 'Clearsky DNI Avg Per Hour')
ax.set_xlabel('Hour in Military Time')
ax.set_ylabel('DNI(w/m\u00b2)')
plt.legend()
plt.show()