How can I analyze whether my camera is looking up/down?
When the camera's X rotation (in euler rotation) is at 90 degrees it is looking parallel to the ground. Less than 90 it will be pointing down at the ground, greater than 90 is pointing up.

if camera.rotation_euler.x &gt; 90 and camera.rotation_euler.x &lt; 180:
    # looking up
elif camera.rotation_euler.x &lt; 90 and camera.rotation_euler.x &gt; 0:
    # looking down