10000 Add noct_sam cell temperature model to PVSystem, ModelChain by cwhanse · Pull Request #1195 · pvlib/pvlib-python · GitHub
[go: up one dir, main page]

Skip to content

Add noct_sam cell temperature model to PVSystem, ModelChain #1195

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 15 commits into from
Mar 15, 2021
Merged
Prev Previous commit
edits from review
  • Loading branch information
cwhanse committed Mar 15, 2021
commit 9613bb8dc071efc40b3c77f3e42bb6a830e6a60e
3 changes: 2 additions & 1 deletion pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -999,8 +999,9 @@ def _set_celltemp(self, model):
temp_air = _tuple_from_dfs(self.weather, 'temp_air')
wind_speed = _tuple_from_dfs(self.weather, 'wind_speed')
arg_list = [poa, temp_air, wind_speed]
kwargs = {}
10000 if model == self.system.noct_sam_celltemp:
arg_list += [self.results.effective_irradiance]
kwargs['effective_irradiance'] = self.results.effective_irradiance
self.results.cell_temperature = model(*tuple(arg_list))
return self

Expand Down
6 changes: 4 additions & 2 deletions pvlib/pvsystem.py
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ def noct_sam_celltemp(self, poa_global, temp_air, wind_speed,
wind_speed : numeric or tuple of numeric
Wind speed in m/s at a height of 10 meters.

effective_irradiance : numeric, tuple of numeric or None.
effective_irradiance : numeric, tuple of numeric, or None.
The irradiance that is converted to photocurrent. If None,
assumed equal to ``poa_global``. [W/m^2]

Expand Down Expand Up @@ -833,12 +833,14 @@ def _build_kwargs_noct_sam(array):
'array_height', 'mount_standoff'],
array.temperature_model_parameters)
try:
# noct_sam required args
# bundled with kwargs for simplicity
temp_model_kwargs['noct'] = \
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
temp_model_kwargs['noct'] = \
# noct_sam required args.
# bundled with kwargs for simplicity
temp_model_kwargs['noct'] = \

array.temperature_model_parameters['noct']
temp_model_kwargs['eta_m_ref'] = \
array.temperature_model_parameters['eta_m_ref']
except KeyError:
msg = ('Parameter noct and eta_m_ref are required.'
msg = ('Parameters noct and eta_m_ref are required.'
' Found {} in temperature_model_parameters.'
.format(array.temperature_model_parameters))
raise KeyError(msg)
Expand Down
0