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

running SeqAOIcor list out of range #53

Open
Nitzan-hez opened this issue Oct 6, 2022 · 0 comments
Open

running SeqAOIcor list out of range #53

Nitzan-hez opened this issue Oct 6, 2022 · 0 comments

Comments

@Nitzan-hez
Copy link

Hi,

I had some issues on front irradiation calculation that SegAOIcor[index][j] get out of index when j>180, although SeqAOIcor[index] length is 180.

 for j in range (0, iStopIso):                                        # Add sky diffuse component and horizon brightening if present

    frontGTI[i] += 0.5 * (math.cos(j * DTOR) - math.cos((j + 1) * DTOR)) * SegAOIcor[index][j] * iso_sky_dif;                # Sky radiation
    frontReflected[i] += 0.5 * (math.cos(j * DTOR) - math.cos((j + 1) * DTOR)) * iso_sky_dif * (1.0 - SegAOIcor[index][j] * (1.0 - Ro));  
   
     if ((iStopIso - j) <= iHorBright):                                   # Add horizon brightening term if seen
    
        frontGTI[i] += 0.5 * (math.cos(j * DTOR) - math.cos((j + 1) * DTOR)) * SegAOIcor[index][j] * F2DHI / 0.052264;  
        frontReflected[i] += 0.5 * (math.cos(j * DTOR) - math.cos((j + 1) * DTOR)) * (F2DHI / 0.052264) * (1.0 - SegAOIcor[index][j] * (1.0 - Ro));    

I won't pretend to be too familiar the code, but I think I solved it by limiting iStopIso to 180 at most (it also it sound physically logic).. see below:

iStopIso =min(int(round(np.float64((math.pi - beta - elvUP)) / DTOR)), 180)   # Last whole degree in arc range that sees sky, first is 0

instead of:

iStopIso =int(round(np.float64((math.pi - beta - elvUP)) / DTOR))   # Last whole degree in arc range that sees sky, first is 0
@Nitzan-hez Nitzan-hez changed the title running seqAOIcor list out of range running SeqAOIcor list out of range Oct 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant