Skip to content

Commit 652e100

Browse files
committed
Clean up & minor upgrades to notebook
1 parent bd733cb commit 652e100

File tree

1 file changed

+19
-34
lines changed

1 file changed

+19
-34
lines changed

docs/tutorials/spectral_mismatch_modifiers.ipynb

Lines changed: 19 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"cell_type": "markdown",
66
"metadata": {},
77
"source": [
8-
"# Spectral mismatch Modifiers\n",
8+
"# Spectral Mismatch Modifiers\n",
99
"Learn to use spectral mismatch modifiers with this notebook!\n",
1010
"Feel free to add other models, be sure to update the index and give you credit ;)\n",
1111
"\n",
@@ -64,7 +64,9 @@
6464
"cell_type": "markdown",
6565
"metadata": {},
6666
"source": [
67-
"First step is get to the effective irradiance. For simplicity, we will copy the procedure explained in the tutorial ``tmy_to_power.ipynb``. Please refer to it to get a more in depth explanation."
67+
"First step is get to the effective irradiance. For simplicity, we will copy the\n",
68+
"procedure explained in the tutorial ``tmy_to_power.ipynb`` to obtain it.\n",
69+
"Please refer to it to get a more in depth explanation."
6870
]
6971
},
7072
{
@@ -119,35 +121,16 @@
119121
"poa_irrad = pvlib.irradiance.poa_components(aoi,\n",
120122
" weather_data['dni'],\n",
121123
" poa_sky_diffuse,\n",
122-
" poa_ground_diffuse)\n",
123-
"\n",
124-
"# Following part will be needed later\n",
125-
"thermal_params = pvlib.temperature.TEMPERATURE_MODEL_PARAMETERS['sapm']['open_rack_glass_polymer']\n",
126-
"pvtemps = pvlib.temperature.sapm_cell(poa_irrad['poa_global'],\n",
127-
" weather_data['temp_air'],\n",
128-
" weather_data['wind_speed'],\n",
129-
" **thermal_params)\n",
130-
"\n",
131-
"# Note that we use the CEC Module provided for the singlediode subsection\n",
132-
"cec_modules = pvlib.pvsystem.retrieve_sam(name='CECMod')\n",
133-
"cec_module = cec_modules['Canadian_Solar_Inc__CS5P_220M']"
134-
]
135-
},
136-
{
137-
"attachments": {},
138-
"cell_type": "markdown",
139-
"metadata": {},
140-
"source": [
141-
"Here comes the modifier. Let's calculate it and examine the introduced\n",
142-
"difference.\n"
124+
" poa_ground_diffuse)"
143125
]
144126
},
145127
{
146128
"attachments": {},
147129
"cell_type": "markdown",
148130
"metadata": {},
149131
"source": [
150-
"That was a lot, yeah. But don't worry, now we can find the effective irradiance, the mismatch modifier (with the airmass and clearness index)"
132+
"Here comes the modifier. Let's calculate it with the airmass and clearness\n",
133+
"index."
151134
]
152135
},
153136
{
@@ -157,13 +140,13 @@
157140
"outputs": [],
158141
"source": [
159142
"# First, let's find the airmass and the clearness index\n",
160-
"# Little caution: default values for this model were fitted obtaining the airmass through the kasten1966 method, not used by default\n",
143+
"# Little caution: default values for this model were fitted obtaining the\n",
144+
"# airmass through the kasten1966 method, not used by default\n",
161145
"airmass = site.get_airmass(solar_position=solar_pos, model='kasten1966')\n",
162-
"clearness_index = pvlib.irradiance.clearness_index(ghi=weather_data['ghi'],\n",
163-
" solar_zenith=solar_pos['zenith'],\n",
164-
" extra_radiation=extra_rad)\n",
165-
"# Check module is m-Si (monocrystalline silicon)\n",
166-
"print('Module type is: ' + cec_module['Technology'])\n",
146+
"clearness_index = \\\n",
147+
" pvlib.irradiance.clearness_index(ghi=weather_data['ghi'],\n",
148+
" solar_zenith=solar_pos['zenith'],\n",
149+
" extra_radiation=extra_rad)\n",
167150
"\n",
168151
"# Get the spectral mismatch modifiers\n",
169152
"spectral_modifiers = \\\n",
@@ -181,7 +164,8 @@
181164
"multiplication.\n",
182165
"\n",
183166
"Note, however, that neither this does modify ``poa_global`` nor\n",
184-
"``poa_diffuse``, so we should update."
167+
"``poa_diffuse``, so we should update the dataframe afterwards, again with\n",
168+
"``irradiance.poa_components``."
185169
]
186170
},
187171
{
@@ -204,7 +188,8 @@
204188
"cell_type": "markdown",
205189
"metadata": {},
206190
"source": [
207-
"Finally, let's plot the raw vs modified global irradiances, and the difference."
191+
"Finally, let's plot the incident vs modified global irradiances, and their\n",
192+
"difference."
208193
]
209194
},
210195
{
@@ -218,8 +203,8 @@
218203
"poa_irrad['poa_global'].plot()\n",
219204
"poa_irrad_modified['poa_global'].plot()\n",
220205
"poa_irrad_global_diff.plot()\n",
221-
"plt.legend(['Original', 'Modified', 'Difference'])\n",
222-
"plt.ylabel('Irradiance [W/m²]')\n",
206+
"plt.legend(['Incident', 'Modified', 'Difference'])\n",
207+
"plt.ylabel('POA Global irradiance [W/m²]')\n",
223208
"plt.show()"
224209
]
225210
}

0 commit comments

Comments
 (0)