This page was generated from docs/examples/clear_sky.ipynb. Interactive online version: Binder badge

Clear Sky Examples

Overview of Functionality

The captest clear sky functionality is based entirely on wrapping and integrating the clear sky modeling capabilities of the pvlib-python package. The primary intent of this functionality is to provide the option to easily calculate and plot modeled clear sky data as part of the workflow of loading, visualizing, and validating data from pyranometers.

When setting clear_sky to True when calling the CapData load_data method, the csky function will be called when loading data and the modeled clear sky POA and GHI data will be added to the dataframe. The plot method will detect these columns and plot them as dashed lines with the measured irradiance data.

Below is a basic example of this functionality using data from the NREL Solar Radiation Research Library.

Andreas, A.; Stoffel, T.; (1981). NREL Solar Radiation Research Laboratory (SRRL): Baseline Measurement System (BMS); Golden, Colorado (Data); NREL Report No. DA-5500-56488. http://dx.doi.org/10.5439/1052221

[1]:
import pandas as pd
from captest import capdata as pvc

from bokeh.io import output_notebook
output_notebook()
Loading BokehJS ...
[2]:
meas_nrel = pvc.CapData('meas_nrel')
[3]:
loc = {'latitude': 39.742, 'longitude': -105.18, 'altitude': 1828.8, 'tz': 'Etc/GMT+7'}
sys = {'surface_tilt': 40, 'surface_azimuth': 180, 'albedo': 0.2}
[4]:
meas_nrel.load_data(fname='nrel_data.csv', source='AlsoEnergy', clear_sky=True, loc=loc, sys=sys)
/home/docs/checkouts/readthedocs.org/user_builds/pvcaptest/envs/latest/lib/python3.7/site-packages/pvlib/solarposition.py:368: FutureWarning: casting datetime64[ns, Etc/GMT+7] values to int64 with .astype(...) is deprecated and will raise in a future version. Use .view(...) instead.
  unixtime = np.array(time.astype(np.int64)/10**9)
[5]:
meas_nrel.plot(ncols=1, width=800, merge_grps=['irr'],
               subset=['irr_comb'])
Added new group: irr_comb