Skip to content

Missing values using DISC to generate the direct normal irradiance  #6

Closed

Description

@Lamaf

I am having missing values when using DISC to simulate DNI, I trad this using clear sky GHI data and even with data I have from a measuring device
For an example try this:

import datetime
import pandas as pd
from pvlib.location import Location
import pvlib.solarposition
import pvlib.clearsky

# make a location
tus = Location(32.2, -111, 'MST', 700)
# make a pandas DatetimeIndex for some day
times = pd.date_range(start=datetime.datetime(2014,6,24), end=datetime.datetime(2014,6,25), freq='1Min')
# calculate the solar position
solpos = pvlib.solarposition.get_solarposition(times, tus, method='pyephem')
# calculate clear sky data
tus_cs = pvlib.clearsky.ineichen(times, tus, airmass_model='young1994')
ax = tus_cs.plot()
# calculate the direct normal irradiance using GHI from the clear sky data
DNI= pvlib.clearsky.disc(Time= solpos.index, GHI=tus_cs.GHI, SunZen=solpos.zenith)
DNI.DNI_gen_DISC.plot(ax=ax, legend=True)

Am I doing something wrong ??

dni

Activity

  1. wholmgren commented on Feb 25, 2015

    @wholmgren
    Member

    Thanks for moving the issue here.

    Looks like there are some nan assignments:

    https://github.com/pvlib/pvlib-python/blob/master/pvlib/clearsky.py#L378

    I don't personally have any experience with this algorithm so I don't know if those conditions can be relaxed or not. If you have experience with this algorithm then I'll encourage you to make the appropriate changes and submit a pull request. The documentation needs improvement too.

  2. Lamaf commented on Feb 26, 2015

    @Lamaf
    Author

    It is not the nan assignments in the script. According to the DISC algorithm, the condition in the lines 368,369 and 370 must be (Kt <= 0.6)
    Still not sure if it perfect, as in my previous example the values of DNI is high in the early morning and in the end of the day, because the GHI will be more than the I0h
    and here is the plot
    disc
    However in the measured data till now it's sufficient result

  3. wholmgren commented on Feb 26, 2015

    @wholmgren
    Member

    Ok, I understand now.

    Sandia-Labs/PVLIB_Python#35 fixed the DISC algorithm on the old master branch.

    Sandia-Labs/PVLIB_Python#37 was supposedly closed with Sandia-Labs/PVLIB_Python/8ffbf80e, but I now see that the fix was incomplete since it missed the 0.6-1's on the right side of the assignments.

    Better. Unit. Tests.

    @Lamaf or @Jorissup, do either of you want to make a pull request to fix this? You'd also need to fix the documentation and add a unit test to test_clearsky.py. I would also like to see some PEP8 applied to this algorithm, but that is less important.

  4. added a commit that references this issue on Mar 12, 2015
    14d9a0f
  5. added this to the 0.1 milestone on Mar 12, 2015
  6. added a commit that references this issue on Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions