def solarangles (self):
        """
        Calculation based on NOAA. Solves for zenith angle, tangent of zenithal angle,
        and critical canyon angle based on following parameters:
            canAspect       # aspect Ratio of canyon
            simTime         # simulation parameters
            RSM.lon         # longitude (deg)
            RSM.lat         # latitude (deg)
            RSM.GMT         # GMT hour correction

        Properties
            self.ut         # elapsed hours on current day
            self.ad         # fractional year in radians
            self.eqtime
            self.decsol     # solar declination angle
            self.zenith     # Angle between normal to earth's surface and sun position
            self.tanzen     # tangente of solar zenithal angle
            self.critOrient # critical canyon angle for which solar radiation reaches the road
        """

        ln = self.RSM.lon

        month = self.simTime.month
        day = self.simTime.day
        secDay = self.simTime.secDay    # Total elapsed seconds in simulation
        inobis = self.simTime.inobis    # total days for first of month
                                        #  i.e [0,31,59,90,120,151,181,212,243,273,304,334]
        canAspect = self.UCM.canAspect
        lon = self.RSM.lon
        lat = self.RSM.lat
        GMT = self.RSM.GMT

        self.ut = (24. + (int(secDay)/3600.%24.)) % 24. # Get elapsed hours on current day
        ibis = list(range(len(inobis)))

        for JI in range(1, 12):
             ibis[JI] = inobis[JI]+1

        date = day + inobis[month-1]-1 # Julian day of the year
        # divide circle by 365 days, multiply by elapsed days + hours
        self.ad = 2.0 * math.pi/365. * (date-1 + (self.ut-(12/24.)))     # Fractional year (radians)

        self.eqtime = 229.18 * (0.000075+0.001868*math.cos(self.ad)-0.032077*math.sin(self.ad) - \
            0.01461*math.cos(2*self.ad)-0.040849*math.sin(2*self.ad))

        # Declination angle (angle of sun with equatorial plane)
        self.decsol = 0.006918-0.399912*math.cos(self.ad)+0.070257*math.sin(self.ad) \
            -0.006758*math.cos(2.*self.ad)+0.000907*math.sin(2.*self.ad) \
            -0.002697*math.cos(3.*self.ad)+0.00148 *math.sin(3.*self.ad)

        time_offset = self.eqtime - 4. * lon + 60 * GMT
        tst = secDay + time_offset * 60

        ha = (tst/4./60.-180.) * math.pi/180.
        zlat = lat * (math.pi/180.)   # change angle units to radians

        # Calculate zenith solar angle
        self.zenith = math.acos(math.sin(zlat)*math.sin(self.decsol) + math.cos(zlat)*math.cos(self.decsol)*math.cos(ha))

        # tangente of solar zenithal angle
        if abs(0.5*math.pi - self.zenith) < 1e-6:
            if 0.5*math.pi - self.zenith > 0.:
                self.tanzen = math.tan(0.5*math.pi-1e-6)

            elif 0.5*math.pi - self.zenith <= 0.:
                self.tanzen = math.tan(0.5*math.pi+1e-6)

        elif abs(self.zenith) < 1e-6:
            # lim x->0 tan(x) -> 0 which results in division by zero error
            # when calculating the critical canyon angle
            # so set tanzen to 1e-6 which will result in critical canyon angle = 90
            self.tanzen = 1e-6

        else:
            self.tanzen = math.tan(self.zenith)

        # critical canyon angle for which solar radiation reaches the road
        # has to do with street canyon orientation for given solar angle
        self.critOrient = math.asin(min(abs( 1./self.tanzen)/canAspect, 1. ))
def solarangles ( self ) : ln = self . RSM . lon month = self . simTime . month day = self . simTime . day secDay = self . simTime . secDay inobis = self . simTime . inobis canAspect = self . UCM . canAspect lon = self . RSM . lon lat = self . RSM . lat GMT = self . RSM . GMT self . ut = ( 24. + ( int ( secDay ) / 3600. % 24. ) ) % 24. ibis = list ( range ( len ( inobis ) ) ) for JI in range ( 1 , 12 ) : ibis [ JI ] = inobis [ JI ] + 1 date = day + inobis [ month - 1 ] - 1 self . ad = 2.0 * math . pi / 365. * ( date - 1 + ( self . ut - ( 12 / 24. ) ) ) self . eqtime = 229.18 * ( 0.000075 + 0.001868 * math . cos ( self . ad ) - 0.032077 * math . sin ( self . ad ) - 0.01461 * math . cos ( 2 * self . ad ) - 0.040849 * math . sin ( 2 * self . ad ) ) self . decsol = 0.006918 - 0.399912 * math . cos ( self . ad ) + 0.070257 * math . sin ( self . ad ) - 0.006758 * math . cos ( 2. * self . ad ) + 0.000907 * math . sin ( 2. * self . ad ) - 0.002697 * math . cos ( 3. * self . ad ) + 0.00148 * math . sin ( 3. * self . ad ) time_offset = self . eqtime - 4. * lon + 60 * GMT tst = secDay + time_offset * 60 ha = ( tst / 4. / 60. - 180. ) * math . pi / 180. zlat = lat * ( math . pi / 180. ) self . zenith = math . acos ( math . sin ( zlat ) * math . sin ( self . decsol ) + math . cos ( zlat ) * math . cos ( self . decsol ) * math . cos ( ha ) ) if abs ( 0.5 * math . pi - self . zenith ) < 1e-6 : if 0.5 * math . pi - self . zenith > 0. : self . tanzen = math . tan ( 0.5 * math . pi - 1e-6 ) elif 0.5 * math . pi - self . zenith <= 0. : self . tanzen = math . tan ( 0.5 * math . pi + 1e-6 ) elif abs ( self . zenith ) < 1e-6 : self . tanzen = 1e-6 else : self . tanzen = math . tan ( self . zenith ) self . critOrient = math . asin ( min ( abs ( 1. / self . tanzen ) / canAspect , 1. ) )
Calculation based on NOAA. Solves for zenith angle, tangent of zenithal angle,
        and critical canyon angle based on following parameters:
            canAspect       # aspect Ratio of canyon
            simTime         # simulation parameters
            RSM.lon         # longitude (deg)
            RSM.lat         # latitude (deg)
            RSM.GMT         # GMT hour correction

        Properties
            self.ut         # elapsed hours on current day
            self.ad         # fractional year in radians
            self.eqtime
            self.decsol     # solar declination angle
            self.zenith     # Angle between normal to earth's surface and sun position
            self.tanzen     # tangente of solar zenithal angle
            self.critOrient # critical canyon angle for which solar radiation reaches the road