This page was generated from /home/docs/checkouts/readthedocs.org/user_builds/pvcaptest/checkouts/stable/docs/examples/reporting_conditions.ipynb.
Interactive online version:
Reporting Conditions and Predicted Capacities
[1]:
import warnings
warnings.filterwarnings('ignore')
import pandas as pd
import matplotlib as plt
import captest as ct
First we load the NREL data used for testing and set the translation dictionary.
[2]:
meas = ct.load_data('../../tests/data/nrel_data.csv')
before calling get common timestep
1min
[3]:
meas.column_groups
[3]:
temp__:
Deck Dry Bulb Temp [deg C]
irr_poa_:
POA 40-South CMP11 [W/m^2]
wind__:
Avg Wind Speed @ 19ft [m/s]
irr_ghi_:
Global CMP22 (vent/cor) [W/m^2]
[4]:
meas.set_regression_cols(poa='irr_poa_', w_vel='wind__', t_amb='temp__', power='')
[5]:
meas.filter_irr(500, 600)
Below is an exmaple of calculating reporting conditions using all defaults, which are set based on the ASTM E2939 standard. The reporting condition method always performs calculations using the filtered dataframe stored in the df_flt attribute.
RC_irr 60% percentile
RC_temp mean
RC_wind mean
Calculates values on filtered data
inplace
[6]:
meas.rep_cond()
Reporting conditions saved to rc attribute.
poa t_amb w_vel
0 551.843379 5.554151 1.358792
Irradiance Balance Method
Setting the irr_bal key-word argument to True causes the aggregation methods specified with the func argument to be ignored and the reporting irradiance is calculated internally by creating an instance of the ReportingIrradiance class. This class is intended to implement a strict interpretation of common contract language that specifies the reporting irradiance be determined by finding the irradiance that results in a balance of points within a +/- percent range of the reporting
irradiance.
[7]:
meas.reset_filter()
[8]:
meas.filter_irr(500, 900)
[9]:
meas.rep_cond(irr_bal=True, percent_filter=20)
Reporting conditions saved to rc attribute.
poa t_amb w_vel
0 659.36 5.475107 1.419542
The instance of ReportingIrradiance created is stored in the rc_tool attribute and additional, so it can be used to access additional documentation of the reporting irradiance calculation. For example, there is a plot method, which marks the reporting irradiance selected on a linked plots showing the count of points above and below the reporting irradiance, the percent of points below the reporting irradiance, and the total points within the specifiec +/- percent band centered on the
reporting irradiance.
[10]:
meas.rc_tool.plot()
[10]:
If you have the Panel package installed you can easily obtain an interactive dashboard allowing you to adjust the reporting condition parameters. Note this dashboard will not work unless you have a live notebook.
[11]:
meas.rc_tool.dashboard()
[11]:
The save_csv method will save a copy of the following table documenting the possible options for reporting conditions to a csv file.
[12]:
meas.rc_tool.poa_flt
[12]:
| t_amb | w_vel | plus_perc | minus_perc | below_count | above_count | total_pts | perc_above | perc_below | valid | perc_below_minus_50_abs | |
|---|---|---|---|---|---|---|---|---|---|---|---|
| poa | |||||||||||
| 500.308 | -0.507 | 0.963 | 600.3696 | 400.2464 | 1 | 317 | 318 | 99.685535 | 0.314465 | False | 49.685535 |
| 500.330 | -2.411 | 1.175 | 600.3960 | 400.2640 | 2 | 316 | 318 | 99.371069 | 0.628931 | False | 49.371069 |
| 500.382 | -2.207 | 2.113 | 600.4584 | 400.3056 | 3 | 315 | 318 | 99.056604 | 0.943396 | False | 49.056604 |
| 500.397 | 4.253 | 0.000 | 600.4764 | 400.3176 | 4 | 314 | 318 | 98.742138 | 1.257862 | False | 48.742138 |
| 500.469 | 8.400 | 1.835 | 600.5628 | 400.3752 | 5 | 313 | 318 | 98.427673 | 1.572327 | False | 48.427673 |
| ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
| 898.873 | 11.480 | 0.180 | 1078.6476 | 719.0984 | 613 | 5 | 618 | 0.809061 | 99.190939 | False | 49.190939 |
| 899.029 | 7.361 | 0.228 | 1078.8348 | 719.2232 | 614 | 4 | 618 | 0.647249 | 99.352751 | False | 49.352751 |
| 899.334 | 7.662 | 0.697 | 1079.2008 | 719.4672 | 615 | 3 | 618 | 0.485437 | 99.514563 | False | 49.514563 |
| 899.377 | 0.563 | 2.400 | 1079.2524 | 719.5016 | 616 | 2 | 618 | 0.323625 | 99.676375 | False | 49.676375 |
| 899.525 | 3.229 | 1.125 | 1079.4300 | 719.6200 | 617 | 1 | 618 | 0.161812 | 99.838188 | False | 49.838188 |
1290 rows × 11 columns
Reporting Conditions spanning New Year Using TMY Data
The cntg_eoy year function can be used to wrap tmy data around the beginning/end of the year to prepare for calculating reporting conditions using time periods that span the new year.
[13]:
pvsyst = ct.load_pvsyst('./data/pvsyst_example_HourlyRes_2.CSV')
[14]:
pvsyst.column_groups
[14]:
temp_mod_:
TArray
irr_ghi_:
GlobHor
shade__:
FShdBm
pvsyt_losses__:
IL Pmax
IL Pmin
IL Vmax
IL Vmin
irr_poa_:
GlobInc
wind__:
WindVel
index__:
index
_inv_:
EOutInv
real_pwr__:
E_Grid
temp_amb_:
T_Amb
[15]:
pvsyst.set_regression_cols(power='real_pwr__', poa='irr_poa_', t_amb='temp_amb_', w_vel='wind__')
[16]:
pvsyst.df_flt = ct.capdata.wrap_year_end(pvsyst.data_filtered,
pd.Timestamp(year=1989, month=12, day=15),
pd.Timestamp(year=1990, month=1, day=15))
[17]:
pvsyst.df_flt.head(2)
[17]:
| GlobInc | GlobHor | T_Amb | TArray | WindVel | FShdBm | IL Pmin | IL Vmin | IL Pmax | IL Vmax | EOutInv | E_Grid | index | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Timestamp | |||||||||||||
| 1989-12-15 00:00:00 | 0.0 | 0.0 | 19.4 | 0.0 | 2.1 | 1.0 | 0 | 0 | 0.0 | 0 | -1200 | -8868 | 12/15/1989 00 00 |
| 1989-12-15 01:00:00 | 0.0 | 0.0 | 19.4 | 0.0 | 3.6 | 1.0 | 0 | 0 | 0.0 | 0 | -1200 | -8868 | 12/15/1989 01 00 |
[18]:
pvsyst.df_flt.tail(2)
[18]:
| GlobInc | GlobHor | T_Amb | TArray | WindVel | FShdBm | IL Pmin | IL Vmin | IL Pmax | IL Vmax | EOutInv | E_Grid | index | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Timestamp | |||||||||||||
| 1990-01-14 23:00:00 | 0.0 | 0.0 | 10.6 | 0.0 | 2.1 | 1.0 | 0 | 0 | 0.0 | 0 | -1200 | -8868 | 01/14/1990 23 00 |
| 1990-01-15 00:00:00 | 0.0 | 0.0 | 11.1 | 0.0 | 3.1 | 1.0 | 0 | 0 | 0.0 | 0 | -1200 | -8868 | 01/15/1990 00 00 |
[19]:
pvsyst.filter_irr(200, 900)
[20]:
pvsyst.filter_pvsyst()
[21]:
pvsyst.rep_cond()
Reporting conditions saved to rc attribute.
poa t_amb w_vel
0 527.912218 24.797326 4.313621
Reporting Conditions for Time Periods
v0.15.0 Change - This functionality has been moved out of ``rep_cond`` to the separate ``rep_cond_freq`` method.
The freq option can be used to calculate reporting conditions for groups of time like months or seasons. Any standard aggregation method can be used to calculate the reporting conditions for each group using the func or the irr_bal method options.
[22]:
pvsyst.reset_filter()
[23]:
print(pvsyst.data_filtered.index[0])
print(pvsyst.data_filtered.index[-1])
1990-01-01 00:00:00
1990-12-31 23:00:00
[24]:
pvsyst.filter_irr(500, 900)
[25]:
pvsyst.rep_cond_freq(freq='MS')
Reporting conditions saved to rc attribute.
poa t_amb w_vel
Timestamp
1990-01-01 714.095698 14.813956 5.887209
1990-02-01 694.524568 17.693826 4.956790
1990-03-01 724.956667 21.124444 4.805556
1990-04-01 702.163711 25.413402 4.712371
1990-05-01 702.958641 28.066019 4.277670
1990-06-01 720.130625 31.425000 4.117969
1990-07-01 717.505400 32.542000 3.858667
1990-08-01 722.953836 32.113699 4.257534
1990-09-01 717.664793 29.318182 3.821488
1990-10-01 707.949639 25.843373 3.837349
1990-11-01 694.441566 20.733735 4.413253
1990-12-01 687.322247 17.101112 4.297753
[26]:
pvsyst.rc
[26]:
| poa | t_amb | w_vel | |
|---|---|---|---|
| Timestamp | |||
| 1990-01-01 | 714.095698 | 14.813956 | 5.887209 |
| 1990-02-01 | 694.524568 | 17.693826 | 4.956790 |
| 1990-03-01 | 724.956667 | 21.124444 | 4.805556 |
| 1990-04-01 | 702.163711 | 25.413402 | 4.712371 |
| 1990-05-01 | 702.958641 | 28.066019 | 4.277670 |
| 1990-06-01 | 720.130625 | 31.425000 | 4.117969 |
| 1990-07-01 | 717.505400 | 32.542000 | 3.858667 |
| 1990-08-01 | 722.953836 | 32.113699 | 4.257534 |
| 1990-09-01 | 717.664793 | 29.318182 | 3.821488 |
| 1990-10-01 | 707.949639 | 25.843373 | 3.837349 |
| 1990-11-01 | 694.441566 | 20.733735 | 4.413253 |
| 1990-12-01 | 687.322247 | 17.101112 | 4.297753 |
Using the irr_bal option to calculate reporting conditions for each month of the year results in higher reporting irradiances.
Note that the with inplace set to False the reporting conditions attribute of the CapData object, pvsyst, is not overwritten.
[27]:
ib_rcs = pvsyst.rep_cond_freq(freq='MS', irr_bal=True, percent_filter=20, inplace=False)
ib_rcs
[27]:
| poa | t_amb | w_vel | |
|---|---|---|---|
| 1990-01-01 | 719.78 | 14.851558 | 5.957813 |
| 1990-02-01 | 698.64 | 17.632729 | 5.030909 |
| 1990-03-01 | 737.60 | 21.179730 | 4.813514 |
| 1990-04-01 | 730.85 | 25.541772 | 4.670886 |
| 1990-05-01 | 666.39 | 27.570149 | 4.443284 |
| 1990-06-01 | 673.45 | 31.213793 | 4.234483 |
| 1990-07-01 | 722.88 | 32.273043 | 3.757391 |
| 1990-08-01 | 657.70 | 31.747126 | 4.226437 |
| 1990-09-01 | 669.71 | 29.177333 | 3.736000 |
| 1990-10-01 | 712.53 | 26.157627 | 3.686441 |
| 1990-11-01 | 662.24 | 21.038596 | 4.482456 |
| 1990-12-01 | 730.97 | 17.457361 | 4.160656 |
[28]:
(ib_rcs - pvsyst.rc)['poa']
[28]:
1990-01-01 5.684302
1990-02-01 4.115432
1990-03-01 12.643333
1990-04-01 28.686289
1990-05-01 -36.568641
1990-06-01 -46.680625
1990-07-01 5.374600
1990-08-01 -65.253836
1990-09-01 -47.954793
1990-10-01 4.580361
1990-11-01 -32.201566
1990-12-01 43.647753
Freq: MS, Name: poa, dtype: float64
Predicted Capacities
The predict_capacities method will use reporting conditions calculated using the freq option to determine predicted and guaranteed capacities.
From the previous exercise we still have the montly reporting conditions.
[29]:
pvsyst.rc
[29]:
| poa | t_amb | w_vel | |
|---|---|---|---|
| Timestamp | |||
| 1990-01-01 | 714.095698 | 14.813956 | 5.887209 |
| 1990-02-01 | 694.524568 | 17.693826 | 4.956790 |
| 1990-03-01 | 724.956667 | 21.124444 | 4.805556 |
| 1990-04-01 | 702.163711 | 25.413402 | 4.712371 |
| 1990-05-01 | 702.958641 | 28.066019 | 4.277670 |
| 1990-06-01 | 720.130625 | 31.425000 | 4.117969 |
| 1990-07-01 | 717.505400 | 32.542000 | 3.858667 |
| 1990-08-01 | 722.953836 | 32.113699 | 4.257534 |
| 1990-09-01 | 717.664793 | 29.318182 | 3.821488 |
| 1990-10-01 | 707.949639 | 25.843373 | 3.837349 |
| 1990-11-01 | 694.441566 | 20.733735 | 4.413253 |
| 1990-12-01 | 687.322247 | 17.101112 | 4.297753 |
[30]:
pvsyst.tolerance = '+/- 7'
[31]:
pvsyst.predict_capacities()
[31]:
| poa | t_amb | w_vel | PredCap | poa-param | I(poa * poa) | I(poa * t_amb) | I(poa * w_vel) | guaranteedCap | pt_qty | |
|---|---|---|---|---|---|---|---|---|---|---|
| Timestamp | ||||||||||
| 1990-01-01 | 714.095698 | 14.813956 | 5.887209 | 4.724455e+06 | 7679.049879 | -0.887403 | -29.798439 | 2.050399 | 4.393744e+06 | 63 |
| 1990-02-01 | 694.524568 | 17.693826 | 4.956790 | 4.545713e+06 | 7653.907428 | -0.847033 | -29.252167 | -0.598597 | 4.227513e+06 | 55 |
| 1990-03-01 | 724.956667 | 21.124444 | 4.805556 | 4.643211e+06 | 7786.526387 | -1.058941 | -29.372769 | 1.343319 | 4.318186e+06 | 69 |
| 1990-04-01 | 702.163711 | 25.413402 | 4.712371 | 4.399729e+06 | 7613.496430 | -0.898769 | -28.277768 | 0.462675 | 4.091748e+06 | 70 |
| 1990-05-01 | 702.958641 | 28.066019 | 4.277670 | 4.346075e+06 | 7640.024825 | -0.910647 | -28.216901 | -5.936471 | 4.041850e+06 | 64 |
| 1990-06-01 | 720.130625 | 31.425000 | 4.117969 | 4.378059e+06 | 7717.759622 | -0.925855 | -30.783629 | -0.998859 | 4.071595e+06 | 111 |
| 1990-07-01 | 717.505400 | 32.542000 | 3.858667 | 4.344178e+06 | 7759.817960 | -1.031071 | -29.513272 | -1.306165 | 4.040086e+06 | 114 |
| 1990-08-01 | 722.953836 | 32.113699 | 4.257534 | 4.384737e+06 | 7747.938911 | -0.954836 | -30.941487 | 0.244063 | 4.077805e+06 | 122 |
| 1990-09-01 | 717.664793 | 29.318182 | 3.821488 | 4.419240e+06 | 7762.687719 | -0.983270 | -30.845433 | 1.336595 | 4.109893e+06 | 85 |
| 1990-10-01 | 707.949639 | 25.843373 | 3.837349 | 4.447070e+06 | 7757.657137 | -0.911051 | -32.157756 | 0.001431 | 4.135775e+06 | 59 |
| 1990-11-01 | 694.441566 | 20.733735 | 4.413253 | 4.484922e+06 | 7727.377692 | -0.901704 | -30.928802 | -0.365567 | 4.170977e+06 | 59 |
| 1990-12-01 | 687.322247 | 17.101112 | 4.297753 | 4.522142e+06 | 7686.456191 | -0.874831 | -29.906440 | 1.309884 | 4.205592e+06 | 53 |