Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 425
Kernel:
%matplotlib inline import numpy as np import pandas as pd import matplotlib.pyplot as plt time_sec = np.array([1,2,3,4,5,6,7,8,9,10]) velocity_mps = np.array([10,12,14,16,18,20,22,24,26,28])
plt.plot(time_sec, velocity_mps) plt.grid(True) plt.ylim((0,30))
(0, 30)
Image in a Jupyter notebook
delta_T = 1 velocity_mps.sum() * delta_T
190
try: santa_rosa except NameError: # 724957 Santa Rosa, CA santa_rosa = pd.read_table('http://rredc.nrel.gov/solar/old_data/nsrdb/1991-2005/data/tmy3/724957TYA.CSV', skiprows=1, sep=',') else: print('skipping download')
santa_rosa.head()
Date (MM/DD/YYYY) Time (HH:MM) ETR (W/m^2) ETRN (W/m^2) GHI (W/m^2) GHI source GHI uncert (%) DNI (W/m^2) DNI source DNI uncert (%) ... Alb (unitless) Alb source Alb uncert (code) Lprecip depth (mm) Lprecip quantity (hr) Lprecip source Lprecip uncert (code) PresWth (METAR code) PresWth source PresWth uncert (code)
0 01/01/2004 01:00 0 0 0 2 0 0 2 0 ... 0.17 F 8 0 1 D 9 10 C 8
1 01/01/2004 02:00 0 0 0 2 0 0 2 0 ... 0.17 F 8 0 1 D 9 10 C 8
2 01/01/2004 03:00 0 0 0 2 0 0 2 0 ... 0.17 F 8 10 1 D 9 10 C 8
3 01/01/2004 04:00 0 0 0 2 0 0 2 0 ... 0.17 F 8 0 1 D 9 10 C 8
4 01/01/2004 05:00 0 0 0 2 0 0 2 0 ... 0.17 F 8 0 1 D 9 10 C 8

5 rows × 71 columns

santa_rosa['Dry-bulb (C)'].plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f60a300e2b0>
Image in a Jupyter notebook
delta_T = 18 - santa_rosa['Dry-bulb (C)']
delta_T[delta_T < 0] = 0 delta_T.plot()
<matplotlib.axes._subplots.AxesSubplot at 0x7f45f09530b8>
Image in a Jupyter notebook
# degree days # compare to https://wrcc.dri.edu/cgi-bin/cliMONthdd.pl?casros delta_T.sum() / 24
1557.5958333333331
# energy # multiply degree days by UA product to get energy