Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gendaylit1axis() making less skyfiles #441

Closed
ebousi opened this issue Nov 14, 2022 · 4 comments
Closed

gendaylit1axis() making less skyfiles #441

ebousi opened this issue Nov 14, 2022 · 4 comments
Labels
bug v0_5_0 Include for v0.5.0 release

Comments

@ebousi
Copy link

ebousi commented Nov 14, 2022

Dear Sir/Madam,

The gendaylit1axis() function is creating less skyfiles than the necessary one (see Figure).

As a result although the metdata has the full year weather data, the gendaylit adds the skyfile till a certain day of the year (typically end of November).

Thanks in advanc for your support,
Erion
issue

@ebousi ebousi changed the title gendaylit1axis() gendaylit1axis() making less skyfiles Nov 14, 2022
@shirubana
Copy link
Member

when you load the weather data, do you have a start_date or end_date ?

Also, do these entries have valid values for DNI, GHI and DHI? I think it cuts values very close to 0.

S.

@ebousi
Copy link
Author

ebousi commented Nov 15, 2022

Hi Silvana,

Thank you for the very quick reply.

To give some more insights in my example:

  • The metdata file has 4608 entries ending on the 31st December
  • the trackerdict after applying the set1axis() has 4382 data points, less cause as you said it cuts values close to zero.

The strange things happens when you apply the gendaylit1axis() function, here the datapoints are cutted further, always from the end.

I did a bit more deep research on this, and in my opinion the problem comes from the indexing of the gendaylit1axis() function.

In the photo is part of the gendaylit1axis() function.

        - At point 1 the for loop iterates over the trackerdict dictionairy whih has 4382 points.              
        - However at point 2 the if statement is checking over the metdata dictionairy which continues having 4608 points. 
        - As a result the counter is mixed between the metdata and the trackedict.

PS. The above are just suggestions, there is still a chance I am completely wrong :).

Thank you for the support,
Erion

code of gandaylit1axis

@shirubana
Copy link
Member

shirubana commented Nov 16, 2022

@ebousi Is there any possibility you can share the weather file (if you want to anonymize it with a similar but diffferent lat or lon or name), to my NREL email to test this? I just tested it and are not seeing this behaviour on another weather file. silvana.ovaitt@nrel.gov

@magnetohack
Copy link

I experience the same issue - that hourly full-year simulations with a single axis tracker stop short of completing the full year. From what I can tell, the problem stems from incorrectly assuming that trackerdict and metdata share a common integer index, as @ebousi points out. This will likely cause mixing of irradiation data and tracker angles that do not correspond.

trackerdict gets created as an empty dict and initialzed in _set1axis (lines 3275-3287 of 'main.py' (see screenshot)), based on timestamps in the epw file. However, since only ghi>0 and valid tracker angles are kept, trackerdict and metdata will not generally be of the same length, and entries indexed with an integer will not correspond between the two.

If trackerdict instead get initialized with

trackerdict = dict.fromkeys(times)
(that has been commented out in line 3274), the problem goes away - as trackerdict gets to have the same length, keys and order as the metdata.

bifacial_radiance_main_py

The approach of indexing these data structures with integer indices that strictly require length and order to correspond seems risky, especially when pruning entries (ghi<0, etc.) various places in the code. Perhaps it would be safer to use the datetime index to look up the corresponding entries between dictionaries?

@cdeline cdeline added bug v0_5_0 Include for v0.5.0 release labels Sep 23, 2024
cdeline added a commit that referenced this issue Sep 24, 2024
fixes #441.  Changed how the metadata is indexed in gendaylit1axis - …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug v0_5_0 Include for v0.5.0 release
Projects
None yet
Development

No branches or pull requests

4 participants