Day of Year script ported to Python