pvlib.modelchain.ModelChain.complete_irradiance#

ModelChain.complete_irradiance(weather)[source]#

Determine the missing irradiation columns. Only two of the following data columns (dni, ghi, dhi) are needed to calculate the missing data.

This function is not safe at the moment. Results can be too high or negative. Please contribute and help to improve this function on https://github.com/pvlib/pvlib-python

Parameters

weather (DataFrame, or tuple or list of DataFrame) – Column names must be 'dni', 'ghi', 'dhi', 'wind_speed', 'temp_air'. All irradiance components are required. Air temperature of 20 C and wind speed of 0 m/s will be added to the DataFrame if not provided. If weather is a tuple it must be the same length as the number of Arrays in the system and the indices for each DataFrame must be the same.

Returns

self

Raises

ValueError – if the number of dataframes in weather is not the same as the number of Arrays in the system or if the indices of all elements of weather are not the same.

Notes

Assigns attributes to results: times, weather

Examples

This example does not work until the parameters my_system, my_location, and my_weather are defined but shows the basic idea how this method can be used.

>>> from pvlib.modelchain import ModelChain
>>> # my_weather containing 'dhi' and 'ghi'.
>>> mc = ModelChain(my_system, my_location)  
>>> mc.complete_irradiance(my_weather)  
>>> mc.run_model(mc.results.weather)  
>>> # my_weather containing 'dhi', 'ghi' and 'dni'.
>>> mc = ModelChain(my_system, my_location)  
>>> mc.run_model(my_weather)