|
5 | 5 | "cell_type": "markdown", |
6 | 6 | "metadata": {}, |
7 | 7 | "source": [ |
8 | | - "# Spectral mismatch Modifiers\n", |
| 8 | + "# Spectral Mismatch Modifiers\n", |
9 | 9 | "Learn to use spectral mismatch modifiers with this notebook!\n", |
10 | 10 | "Feel free to add other models, be sure to update the index and give you credit ;)\n", |
11 | 11 | "\n", |
|
64 | 64 | "cell_type": "markdown", |
65 | 65 | "metadata": {}, |
66 | 66 | "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." |
68 | 70 | ] |
69 | 71 | }, |
70 | 72 | { |
|
119 | 121 | "poa_irrad = pvlib.irradiance.poa_components(aoi,\n", |
120 | 122 | " weather_data['dni'],\n", |
121 | 123 | " 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)" |
143 | 125 | ] |
144 | 126 | }, |
145 | 127 | { |
146 | 128 | "attachments": {}, |
147 | 129 | "cell_type": "markdown", |
148 | 130 | "metadata": {}, |
149 | 131 | "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." |
151 | 134 | ] |
152 | 135 | }, |
153 | 136 | { |
|
157 | 140 | "outputs": [], |
158 | 141 | "source": [ |
159 | 142 | "# 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", |
161 | 145 | "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", |
167 | 150 | "\n", |
168 | 151 | "# Get the spectral mismatch modifiers\n", |
169 | 152 | "spectral_modifiers = \\\n", |
|
181 | 164 | "multiplication.\n", |
182 | 165 | "\n", |
183 | 166 | "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``." |
185 | 169 | ] |
186 | 170 | }, |
187 | 171 | { |
|
204 | 188 | "cell_type": "markdown", |
205 | 189 | "metadata": {}, |
206 | 190 | "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." |
208 | 193 | ] |
209 | 194 | }, |
210 | 195 | { |
|
218 | 203 | "poa_irrad['poa_global'].plot()\n", |
219 | 204 | "poa_irrad_modified['poa_global'].plot()\n", |
220 | 205 | "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", |
223 | 208 | "plt.show()" |
224 | 209 | ] |
225 | 210 | } |
|
0 commit comments