pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

Forecasting page in User's guide

Open cwhanse opened this issue 2 years ago • 4 comments

The Forecasting page has at least two issues:

  • the "View on Github" link is broken
  • the example code refers to a pvlib location instance that is not defined. It is referenced in a block of code that isn't run, so doesn't generate an error. Including this code can be confusing to new users.

cwhanse avatar Mar 02 '22 16:03 cwhanse

Looks like the NDFD section has some broken code too.

the "View on Github" link is broken

In fact most of the top-level pages in stable have broken "view on github" links. This is because the 0.9.0 docs still point to the old repository locations from before #1173 moved those pages to the new user_guide subdirectory. I don't think there's anything to do about it until we release 0.9.1 and the docs get rebuilt with the new repository locations.

kandersolar avatar Mar 02 '22 16:03 kandersolar

On second look, the block of code referencing the location instance isn't executed, it's there to show how ghi is obtained from cloud cover. Maybe we can display that information differently to avoid confusing new users, who copy the code and try to run it.

cwhanse avatar Mar 02 '22 16:03 cwhanse

@cwhanse Can I work on this??

soma2000-lang avatar Mar 03 '22 19:03 soma2000-lang

@soma2000-lang certainly. My idea is to replace these lines with math (for the last three lines) and provide a reference to the cloud_cover_to_irradiance_clearsky_scaling function

E.g.,

GHI = [offset + (1 - offset) x (1 - cc) ] x GHI_{clearsky}

where offset (% of clearsky GHI) is the minimum GHI under complete cloud cover, and cc is the cloud cover (fraction of sky dome).

DNI is computed using the DISC model , and DHI is computing as

.. code-block:: python
    solpos = location.get_solarposition(cloud_cover.index)
    cs = location.get_clearsky(cloud_cover.index, model='ineichen')
    # offset and cloud cover in decimal units here
    # larson et. al. use offset = 0.35
    ghi = (offset + (1 - offset) * (1 - cloud_cover)) * ghi_clear
    dni = disc(ghi, solpos['zenith'], cloud_cover.index)['dni']
    dhi = ghi - dni * np.cos(np.radians(solpos['zenith']))

cwhanse avatar Mar 03 '22 20:03 cwhanse