From 5e9f1f63c914b75ad797fc23c4df1e4cef185a2a Mon Sep 17 00:00:00 2001 From: Mark Mikofski Date: Wed, 26 Aug 2020 21:24:05 -0700 Subject: [PATCH 1/3] add TEMPERATURE_MODEL_PARAMETERS to api.rst --- docs/sphinx/source/api.rst | 8 ++++++++ pvlib/temperature.py | 25 ++++++++++++++++++++----- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/sphinx/source/api.rst b/docs/sphinx/source/api.rst index 91c7662a0a..0db325e4f4 100644 --- a/docs/sphinx/source/api.rst +++ b/docs/sphinx/source/api.rst @@ -238,6 +238,14 @@ PV temperature models temperature.pvsyst_cell temperature.faiman +Temperature Model Parameters +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.. currentmodule:: pvlib.temperature +.. autodata:: TEMPERATURE_MODEL_PARAMETERS + :annotation: + +.. currentmodule:: pvlib + Single diode models ------------------- diff --git a/pvlib/temperature.py b/pvlib/temperature.py index c9f77c5424..b9a45c2762 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -16,6 +16,21 @@ 'pvsyst': {'freestanding': {'u_c': 29.0, 'u_v': 0}, 'insulated': {'u_c': 15.0, 'u_v': 0}} } +"""Dictionary of temperature parameters organized by model. + +There are keys for each model at the top level. Currently there are two models, +``'sapm'`` for the Sandia Array Performance Model, and ``'pvsyst'``. Each model +has a dictionary of configurations with a dictionary of the model parameters +associated with it. Retrieve parameters by indexing the model and +configuration by name. Note: the keys are lower-cased and case sensitive. + +Example +------- +Retrieve the open rack glass-polymer configuration for SAPM:: + + from pvlib.temperature import TEMPERATURE_MODEL_PARAMS + temp_params = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_polymer'] +""" def _temperature_model_params(model, parameter_set): @@ -87,7 +102,7 @@ def sapm_cell(poa_global, temp_air, wind_speed, a, b, deltaT, ambient air temperature :math:`T_{a}` (C). Model parameters depend both on the module construction and its mounting. Parameter sets are provided in [1]_ for representative modules and mounting, and are coded for convenience - in ``pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS``. + in :data:`~pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS`. +---------------+----------------+-------+---------+---------------------+ | Module | Mounting | a | b | :math:`\Delta T [C]`| @@ -168,7 +183,7 @@ def sapm_module(poa_global, temp_air, wind_speed, a, b): :math:`T_{C}`. Model parameters depend both on the module construction and its mounting. Parameter sets are provided in [1]_ for representative modules and mounting, and are coded for convenience in - ``temperature.TEMPERATURE_MODEL_PARAMETERS``. + :data:`~pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS`. +---------------+----------------+-------+---------+---------------------+ | Module | Mounting | a | b | :math:`\Delta T [C]`| @@ -238,7 +253,7 @@ def sapm_cell_from_module(module_temperature, poa_global, deltaT, Model parameters depend both on the module construction and its mounting. Parameter sets are provided in [1]_ for representative modules and mounting, and are coded for convenience in - ``pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS``. + :data:`~pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS`. +---------------+----------------+-------+---------+---------------------+ | Module | Mounting | a | b | :math:`\Delta T [C]`| @@ -323,8 +338,8 @@ def pvsyst_cell(poa_global, temp_air, wind_speed=1.0, u_c=29.0, u_v=0.0, the module construction and its mounting. Parameters are provided in [1]_ for open (freestanding) and close (insulated) mounting configurations, , and are coded for convenience in - ``temperature.TEMPERATURE_MODEL_PARAMETERS``. The heat loss factors - provided represent the combined effect of convection, radiation and + :data:`~pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS`. The heat loss + factors provided represent the combined effect of convection, radiation and conduction, and their values are experimentally determined. +--------------+---------------+---------------+ From eecdefac1ad25ea80cdf5a05caec07005032785a Mon Sep 17 00:00:00 2001 From: Mark Mikofski Date: Thu, 27 Aug 2020 09:55:53 -0700 Subject: [PATCH 2/3] apply suggested changes to temp model params docstring Co-authored-by: Cliff Hansen --- pvlib/temperature.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pvlib/temperature.py b/pvlib/temperature.py index b9a45c2762..91650d7891 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -20,8 +20,8 @@ There are keys for each model at the top level. Currently there are two models, ``'sapm'`` for the Sandia Array Performance Model, and ``'pvsyst'``. Each model -has a dictionary of configurations with a dictionary of the model parameters -associated with it. Retrieve parameters by indexing the model and +has a dictionary of configurations; a value is itself a dictionary containing model +parameters. Retrieve parameters by indexing the model and configuration by name. Note: the keys are lower-cased and case sensitive. Example From b63c35f64cda12d6e8f19a794f51aef19ab0e673 Mon Sep 17 00:00:00 2001 From: Mark Mikofski Date: Wed, 2 Sep 2020 15:09:28 -0700 Subject: [PATCH 3/3] fix stickler, typos in example --- pvlib/temperature.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/pvlib/temperature.py b/pvlib/temperature.py index 91650d7891..e9ce1cf6cc 100644 --- a/pvlib/temperature.py +++ b/pvlib/temperature.py @@ -20,16 +20,18 @@ There are keys for each model at the top level. Currently there are two models, ``'sapm'`` for the Sandia Array Performance Model, and ``'pvsyst'``. Each model -has a dictionary of configurations; a value is itself a dictionary containing model -parameters. Retrieve parameters by indexing the model and -configuration by name. Note: the keys are lower-cased and case sensitive. +has a dictionary of configurations; a value is itself a dictionary containing +model parameters. Retrieve parameters by indexing the model and configuration +by name. Note: the keys are lower-cased and case sensitive. Example ------- Retrieve the open rack glass-polymer configuration for SAPM:: - from pvlib.temperature import TEMPERATURE_MODEL_PARAMS - temp_params = TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_polymer'] + from pvlib.temperature import TEMPERATURE_MODEL_PARAMETERS + temperature_model_parameters = ( + TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_polymer']) + # {'a': -3.56, 'b': -0.075, 'deltaT': 3} """