def date_to_julian_day(my_date):
    a = (14 - my_date.month)//12
    y = my_date.year + 4800 - a
    m = my_date.month + 12*a - 3
    return my_date.day + ((153*m + 2)//5) + 365*y + y//4 - y//100 + y//400 - 32045

# Given a datetime and a observation point, determine the position of the sun
dataset/ETHPy150Open Esri/solutions-geoprocessing-toolbox/visibility/toolboxes/scripts/spa.py/date_to_julian_day/original