Skip to content

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

Merged
merged 9 commits into from
Jan 14, 2021

Conversation

cwhanse
Copy link
Member

@cwhanse cwhanse commented Jan 11, 2021

For the irradiance input to cell temperature models, uses 'poa_global' if available in ModelChain.results.total_irrad, if not, uses ModelChain.results.effective_irradiance. Follow to #1076

@cwhanse cwhanse added this to the 0.9.0 milestone Jan 13, 2021
@cwhanse
Copy link
Member Author

cwhanse commented Jan 13, 2021

Ready for review. One question for discussion: when the code switches to use effective irradiance vs. 'poa_global' should the user be warned?

Copy link
Member

@wholmgren wholmgren left a 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.

Comment on lines 50 to 51
automatically switch to using 'effective_irradiance' (if available) for
cell temperature models, when 'poa_global' is not provided in input weather
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
automatically switch to using 'effective_irradiance' (if available) for
cell temperature models, when 'poa_global' is not provided in input weather
automatically switch to using ``'effective_irradiance'`` (if available) for
cell temperature models, when ``'poa_global'`` is not provided in input weather

@@ -1041,6 +1043,28 @@ def faiman_temp(self):
def fuentes_temp(self):
return self._set_celltemp(self.system.fuentes_celltemp)

@staticmethod
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a few helper functions at the bottom of the module. I wonder if this should live there rather than be a staticmethod on ModelChain. I don't have a strong preference at this time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For less experienced python users (like me) it would be more familiar as a helper function.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I had to lookup staticmethod in the python documentation to confirm its behavior before reviewing the function, count me in the less experienced group too.


Returns
-------
None.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not accurate

Copy link
Member Author

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

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'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
of preference 'poa_global' or 'effective_irradiance'
of preference 'poa_global' then 'effective_irradiance'

@@ -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(
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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 run_model_from_effective_irradiance copy the values for 'poa_global' to 'effective_irradiance' (for convenience) so can't distinguish if the wrong values are being used to calculate power.


Returns
-------
Series of tuple of Series
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Series of tuple of Series
Series or tuple of Series

@@ -1740,6 +1751,19 @@ def run_model_from_effective_irradiance(self, data=None):

Notes
-----
Optional `data` columns ``'cell_temperature'``,
``'module_temperature'`` and ``'poa_global'`` are used for determining
cell temperature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1740,6 +1751,19 @@ def run_model_from_effective_irradiance(self, data=None):

Notes
-----
Optional `data` columns ``'cell_temperature'``,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Optional `data` columns ``'cell_temperature'``,
Optional ``data`` columns ``'cell_temperature'``,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Irradiance for cell temperature models
2 participants