|
7 | 7 | """ |
8 | 8 | # %% |
9 | 9 | # This example model uses satellite-based solar resource data from the |
10 | | -# NSRDB PSM3. This approach is useful for pre-construction energy modeling |
| 10 | +# NSRDB PSM4. This approach is useful for pre-construction energy modeling |
11 | 11 | # and in retrospective analyses where the system’s own irradiance |
12 | 12 | # measurements are not present or unreliable. |
13 | 13 | # |
14 | 14 | # The system has public monitoring data available at the Open Energy Data |
15 | 15 | # Initiative (OEDI) under `System ID |
16 | | -# 9068 <https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=pvdaq%2F2023-solar-data-prize%2F9068_OEDI%2F>`__. |
| 16 | +# 9068 <https://data.openei.org/s3_viewer?bucket=oedi-data-lake&prefix=pvdaq%2F2023-solar-data-prize%2F9068_OEDI%2F>`__. # noqa: E501 |
17 | 17 | # For more information about the system, see its `OEDI |
18 | 18 | # page <https://openei.org/wiki/PVDAQ/Sites/SR_CO>`__. |
| 19 | +# |
| 20 | +# .. warning:: |
| 21 | +# This example requires user-provided credentials to be run at step |
| 22 | +# :ref:`Fetch weather data <fetch_weather_data>`. Therefore, it is not |
| 23 | +# executed as part of documentation build process and it's more |
| 24 | +# susceptible to API changes. Please, report any issues you may find. |
19 | 25 |
|
20 | 26 | # sphinx_gallery_thumbnail_path = "_images/OEDI_9068_daily_timeseries.png" |
21 | 27 | import pvlib |
|
132 | 138 | # %% |
133 | 139 | # Fetch weather data |
134 | 140 | # ------------------ |
| 141 | +# .. _fetch_weather_data: |
135 | 142 | # |
136 | 143 | # The system does have measured plane-of-array irradiance data, but the |
137 | 144 | # measurements suffer from row-to-row shading and tracker stalls. In this |
138 | | -# example, we will use weather data taken from the NSRDB PSM3 for the year |
| 145 | +# example, we will use weather data taken from the NSRDB PSM4 for the year |
139 | 146 | # 2019. |
140 | 147 |
|
141 | 148 | api_key = 'DEMO_KEY' |
142 | 149 | email = 'your_email@domain.com' |
143 | 150 |
|
144 | 151 | keys = ['ghi', 'dni', 'dhi', 'temp_air', 'wind_speed', |
145 | 152 | 'albedo', 'precipitable_water'] |
146 | | -psm3, psm3_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, |
| 153 | +psm4, psm4_metadata = pvlib.iotools.get_nsrdb_psm4_conus(latitude, longitude, |
147 | 154 | api_key, email, |
148 | | - year=2019, interval=5, |
| 155 | + year=2019, |
| 156 | + time_step=5, |
149 | 157 | parameters=keys, |
150 | 158 | map_variables=True, |
151 | 159 | leap_day=True) |
|
167 | 175 | # module fraction and returns the average irradiance over the total module |
168 | 176 | # surface. |
169 | 177 |
|
170 | | -solar_position = location.get_solarposition(psm3.index) |
| 178 | +solar_position = location.get_solarposition(psm4.index) |
171 | 179 | tracker_angles = mount.get_orientation( |
172 | 180 | solar_position['apparent_zenith'], |
173 | 181 | solar_position['azimuth'] |
174 | 182 | ) |
175 | | -dni_extra = pvlib.irradiance.get_extra_radiation(psm3.index) |
| 183 | +dni_extra = pvlib.irradiance.get_extra_radiation(psm4.index) |
176 | 184 |
|
177 | 185 | # note: this system is monofacial, so only calculate irradiance for the |
178 | 186 | # front side: |
179 | 187 | averaged_irradiance = pvlib.bifacial.infinite_sheds.get_irradiance_poa( |
180 | 188 | tracker_angles['surface_tilt'], tracker_angles['surface_azimuth'], |
181 | 189 | solar_position['apparent_zenith'], solar_position['azimuth'], |
182 | 190 | gcr, axis_height, pitch, |
183 | | - psm3['ghi'], psm3['dhi'], psm3['dni'], psm3['albedo'], |
| 191 | + psm4['ghi'], psm4['dhi'], psm4['dni'], psm4['albedo'], |
184 | 192 | model='haydavies', dni_extra=dni_extra, |
185 | 193 | ) |
186 | 194 |
|
|
191 | 199 |
|
192 | 200 | cell_temperature_steady_state = pvlib.temperature.faiman( |
193 | 201 | poa_global=averaged_irradiance['poa_global'], |
194 | | - temp_air=psm3['temp_air'], |
195 | | - wind_speed=psm3['wind_speed'], |
| 202 | + temp_air=psm4['temp_air'], |
| 203 | + wind_speed=psm4['wind_speed'], |
196 | 204 | **temperature_model_parameters, |
197 | 205 | ) |
198 | 206 |
|
199 | 207 | cell_temperature = pvlib.temperature.prilliman( |
200 | 208 | cell_temperature_steady_state, |
201 | | - psm3['wind_speed'], |
| 209 | + psm4['wind_speed'], |
202 | 210 | unit_mass=module_unit_mass |
203 | 211 | ) |
204 | 212 |
|
|
215 | 223 | 'poa_direct': averaged_irradiance['poa_direct'], |
216 | 224 | 'poa_diffuse': averaged_irradiance['poa_diffuse'], |
217 | 225 | 'cell_temperature': cell_temperature, |
218 | | - 'precipitable_water': psm3['precipitable_water'], # for the spectral model |
| 226 | + 'precipitable_water': psm4['precipitable_water'], # for the spectral model |
219 | 227 | }) |
220 | 228 | model.run_model_from_poa(weather_inputs) |
221 | 229 |
|
|
0 commit comments