This repository was archived by the owner on Jun 14, 2024. It is now read-only.
[Easy] Calculate one year of clear-sky irradiance at a location of your choosing. #2
kandersolar
started this conversation in
Project Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Clear-sky irradiance can be modeled at a selected location using one of pvlib's clear-sky models.
Step 1. - Import some libraries:
pvlib,pandas,pytz, andmatplotlib.pandasprovides date time functions andpytzhelps to localize the date times to a timezone.Step 2. - Choose a location and define a
Locationobject usingpvlib.location.Location. Hint: usepytz.all_timezonesto list available timezones.Step 3. - Set up one year of time stamps as a
pandasDateTimeindex, usingpandasdate_range. Be sure to localize the time stamps to the correct timezone.Step 4. - Calculate a year of clear-sky irradiance using the Haurwitz model. We'll use Haurwitz's model here because it requires the fewest inputs. Do the calculation two different ways:
Locationmethodget_clearsky. Be sure to specify'haurwitz'.pvlib.clearsky.haurwitz. To prepare the inputs forhaurwitz, you will need to first calculate solar position (use either theLocationmethodget_solarpositionor the functionpvlib.solarposition.get_solarposition).Use
matplotlibto visualize the results. Did you get the same answer from both approaches?In what season is clear-sky irradiance greatest? Least?
Step 5. - pvlib provides several clear-sky models. The default is a model of P. Ineichen's. Use the
Locationmethodget_clearskyto calculate clear-sky irradiance by the Ineichen model. Plot the Haurwitz and Ineichen clear-sky results. How are they the same? How are they different?For a deeper understanding: Look at the source code for the
Locationmethodget_clearsky. How does the calculation know what solar position to use?Bonus challenge: the Ineichen model can adjust clear-sky irradiance for the atmospheric depth at the selected location. If you use the
Locationmethodget_clearsky, the adjustment uses thealtitudevalue on theLocationobject. Vary the altitude and see how much GHI changes with different altitude values.Beta Was this translation helpful? Give feedback.
All reactions