-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Handle poa_global and effective_irradiance for cell temperature models #1129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
9317efb
68b7cf7
8166cf6
7e54534
40d8734
c720a75
2211fed
9174fe3
8c3e643
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -1023,7 +1023,9 @@ def _set_celltemp(self, model): | |||||
| ------- | ||||||
| self | ||||||
| """ | ||||||
| poa = _tuple_from_dfs(self.results.total_irrad, 'poa_global') | ||||||
|
|
||||||
| poa = self._irrad_for_celltemp(self.results.total_irrad, | ||||||
| self.results.effective_irradiance) | ||||||
| temp_air = _tuple_from_dfs(self.weather, 'temp_air') | ||||||
| wind_speed = _tuple_from_dfs(self.weather, 'wind_speed') | ||||||
| self.results.cell_temperature = model(poa, temp_air, wind_speed) | ||||||
|
|
@@ -1041,6 +1043,28 @@ def faiman_temp(self): | |||||
| def fuentes_temp(self): | ||||||
| return self._set_celltemp(self.system.fuentes_celltemp) | ||||||
|
|
||||||
| @staticmethod | ||||||
|
||||||
| def _irrad_for_celltemp(total_irrad, effective_irradiance): | ||||||
| """ | ||||||
| Determine irradiance to use for cell temperature models, in order | ||||||
| of preference 'poa_global' or 'effective_irradiance' | ||||||
|
||||||
| of preference 'poa_global' or 'effective_irradiance' | |
| of preference 'poa_global' then 'effective_irradiance' |
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One question for discussion: when the code switches to use effective irradiance vs. 'poa_global' should the user be warned?
I lean no.
I also, but the switch should be made clear in the ModelChain documentation, and in the docstring for ModelChain.run_model_from_effective_irradiance
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -918,6 +918,18 @@ def test_run_model_from_effective_irradiance(sapm_dc_snl_ac_system, location, | |
| assert_series_equal(ac, expected) | ||
|
|
||
|
|
||
| def test_run_model_from_effective_irradiance_no_poa_global( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we also need a test for when both effective irradiance and poa global are provided? I think not but thought it was worth mentioning.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it's worth adding this test. All of the tests for |
||
| sapm_dc_snl_ac_system, location, weather, total_irrad): | ||
| data = weather.copy() | ||
| data['effective_irradiance'] = total_irrad['poa_global'] | ||
| mc = ModelChain(sapm_dc_snl_ac_system, location, aoi_model='no_loss', | ||
| spectral_model='no_loss') | ||
| ac = mc.run_model_from_effective_irradiance(data).results.ac | ||
| expected = pd.Series(np.array([149.280238, 96.678385]), | ||
| index=data.index) | ||
| assert_series_equal(ac, expected) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("input_type", [tuple, list]) | ||
| def test_run_model_from_effective_irradiance_arrays_error( | ||
| sapm_dc_snl_ac_system_Array, location, weather, total_irrad, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.