def sensor_analysis_exp_power(sensor_parameters): power_expected = normalization.pvwatts_dc_power( sensor_parameters['poa_global'], power_dc_rated=1) sensor_parameters['power_expected'] = power_expected rd_analysis = TrendAnalysis(**sensor_parameters) rd_analysis.sensor_analysis(analyses=['yoy_degradation']) return rd_analysis
def clearsky_analysis_exp_power(clearsky_parameters, clearsky_optional): power_expected = normalization.pvwatts_dc_power( clearsky_parameters['poa_global'], power_dc_rated=1) clearsky_parameters['power_expected'] = power_expected rd_analysis = TrendAnalysis(**clearsky_parameters) rd_analysis.set_clearsky(**clearsky_optional) rd_analysis.clearsky_analysis(analyses=['yoy_degradation']) return rd_analysis
def test_pvwatts_dc_power(self): ''' Test PVWatts DC power caculation. ''' dc_power = pvwatts_dc_power(self.poa_global, self.power, temperature_cell=self.temp, gamma_pdc=self.gamma_pdc) # Assert output has same frequency and length as input self.assertEqual(self.poa_global.index.freq, dc_power.index.freq) self.assertEqual(len(self.poa_global), len(dc_power)) # Assert value of output Series is equal to value expected self.assertTrue((dc_power == 19.75).all())