Skip to content

pass temperature, pressure to modelchain sol pos call #936

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 1 commit into from
Apr 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions pvlib/modelchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import pvlib.irradiance # avoid name conflict with full import
from pvlib.pvsystem import _DC_MODEL_PARAMS
from pvlib._deprecation import pvlibDeprecationWarning

from pvlib.tools import _build_kwargs

def basic_chain(times, latitude, longitude,
module_parameters, temperature_model_parameters,
Expand Down Expand Up @@ -870,9 +870,15 @@ def prepare_inputs(self, weather, times=None):
'is used for times.', pvlibDeprecationWarning)

self.times = self.weather.index
try:
kwargs = _build_kwargs(['pressure', 'temp_air'], weather)
kwargs['temperature'] = kwargs.pop('temp_air')
except KeyError:
pass

self.solar_position = self.location.get_solarposition(
self.weather.index, method=self.solar_position_method)
self.weather.index, method=self.solar_position_method,
**kwargs)

self.airmass = self.location.get_airmass(
solar_position=self.solar_position, model=self.airmass_model)
Expand Down