Compute directional lamp for direction
If you are just wanting a calculation based on given Euler angles, (since location makes no difference to a Sun lamp, which shines down its negative Z all over the world from an infinite distance), then all we are interested in the world-Z component of the direction of the lamp's own Z axis. If that is positive, the sun is shining down.

So you could do this sort of thing:

from mathutils import Matrix, Euler
from math import radians

def shines_down(XYZ_angles):     
    angles = (radians(x) for x in XYZ_angles)
    eul = Euler(angles, 'XYZ')
    mat = eul.to_matrix()
    return mat[2][2] &gt; 0

print ( shines_down((78,38,-179)) )


However, if you have the object already created, then you could just read the value out of its transformation matrix:

import bpy

ob = bpy.data.objects['Sun']
print (ob.matrix_world[2][2] &gt; 0)

#True if down