Skip to content

running SeqAOIcor list out of range #53

@Nitzan-hez

Description

@Nitzan-hez

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions