pvlib.modelchain.ModelChain.complete_irradiance

ModelChain.complete_irradiance(times=None, weather=None)[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:

times : DatetimeIndex

Times at which to evaluate the model. Can be None if attribute times is already set.

weather : pandas.DataFrame

Table with at least two columns containing one of the following data sets: dni, dhi, ghi. Can be None if attribute weather is already set.

Returns:

self

Assigns attributes: times, weather

Examples

This example does not work until the parameters my_system, my_location, my_datetime and my_weather are not defined properly 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_datetime, my_weather)  
>>> mc.run_model()  
>>> # my_weather containing 'dhi', 'ghi' and 'dni'.
>>> mc = ModelChain(my_system, my_location)  
>>> mc.run_model(my_datetime, my_weather)