@@ -659,18 +659,20 @@ def complete_irradiance(self, times=None, weather=None):
659
659
"Results can be too high or negative.\n " +
660
660
"Help to improve this function on github:\n " +
661
661
"https://github.com/pvlib/pvlib-python \n " )
662
- warnings . warn ( wrn_txt , UserWarning )
662
+
663
663
if {'ghi' , 'dhi' } <= icolumns and 'dni' not in icolumns :
664
664
logging .debug ('Estimate dni from ghi and dhi' )
665
665
self .weather .loc [:, 'dni' ] = pvlib .irradiance .dni (
666
666
self .weather .loc [:, 'ghi' ], self .weather .loc [:, 'dhi' ],
667
667
self .solar_position .loc [:, 'zenith' ])
668
668
elif {'dni' , 'dhi' } <= icolumns and 'ghi' not in icolumns :
669
+ warnings .warn (wrn_txt , UserWarning )
669
670
logging .debug ('Estimate ghi from dni and dhi' )
670
671
self .weather .loc [:, 'ghi' ] = (
671
672
self .weather .dni * tools .cosd (self .solar_position .zenith ) +
672
673
self .weather .dhi )
673
674
elif {'dni' , 'ghi' } <= icolumns and 'dhi' not in icolumns :
675
+ warnings .warn (wrn_txt , UserWarning )
674
676
logging .debug ('Estimate dhi from dni and ghi' )
675
677
self .weather .loc [:, 'dhi' ] = (
676
678
self .weather .ghi - self .weather .dni *
0 commit comments