#NEWLINE# @ jcompile ( 'float64(int64, int64, int64, int64, int64, int64, int64)' , nopython = True ) #NEWLINE# def julian_day_dt( year , month , day , hour , minute , second , microsecond ) : #NEWLINE# #INDENT# 'This is the original way to calculate the julian day from the NREL paper.\n    However, it is much faster to convert to unix/epoch time and then convert\n    to julian day. Note that the date must be UTC.' #NEWLINE# if ( month <= 2 ) : #NEWLINE# #INDENT# year = ( year - 1 ) #NEWLINE# month = ( month + 12 ) #NEWLINE# #UNINDENT# a = int ( ( year / 100 ) ) #NEWLINE# b = ( ( 2 - a ) + int ( ( a * 0.25 ) ) ) #NEWLINE# frac_of_day = ( ( ( microsecond + ( ( second + ( minute * 60 ) ) + ( hour * 3600 ) ) ) * 1.0 ) / ( 3600 * 24 ) ) #NEWLINE# d = ( day + frac_of_day ) #NEWLINE# jd = ( ( ( ( int ( ( 365.25 * ( year + 4716 ) ) ) + int ( ( 30.6001 * ( month + 1 ) ) ) ) + d ) + b ) - 1524.5 ) #NEWLINE# return jd