def gd2jd(*date):
	#print date
	#print date[0]
	date = date[0]
	
	date = list(date)
	
	if len(date)<3:
		print "You must enter a date of the form (2009, 02, 25)!"
		return -1
	elif len(date)==3:
		for ii in range(3): date.append(0)
	elif len(date)==4:
		for ii in range(2): date.append(0)
	elif len(date)==5:
		date.append(0)
	
	yyyy = int(date[0])
	mm = int(date[1])
	dd = float(date[2])
	hh = float(date[3])
	minutes = float(date[4])
	sec = float(date[5])
	#print yyyy,mm,dd,hh,minutes,sec
	
	UT=hh+minutes/60+sec/3600
	
	#print "UT="+`UT`
	
	total_seconds=hh*3600+minutes*60+sec
	fracday=total_seconds/86400
	
	#print "Fractional day: %f" % fracday
	# print dd,mm,yyyy, hh,minutes,sec, UT
	
	if (100*yyyy+mm-190002.5)>0:
		sig=1
	else:
		sig=-1
	
	JD = 367*yyyy - int(7*(yyyy+int((mm+9)/12))/4) + int(275*mm/9) + dd + 1721013.5 + UT/24 - 0.5*sig +0.5
	
	months=["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
	
	#print "\n"+months[mm-1]+" %i, %i, %i:%i:%i UT = JD %f" % (dd, yyyy, hh, minutes, sec, JD),
	
	# Now calculate the fractional year. Do we have a leap year?
	daylist=[31,28,31,30,31,30,31,31,30,31,30,31]
	daylist2=[31,29,31,30,31,30,31,31,30,31,30,31]
	if (yyyy%4 != 0):
		days=daylist2
	elif (yyyy%400 == 0):
		days=daylist2
	elif (yyyy%100 == 0):
		days=daylist
	else:
		days=daylist2
	
	daysum=0
	for y in range(mm-1):
		daysum=daysum+days[y]
		daysum=daysum+dd-1+UT/24
	
	if days[1]==29:
		fracyear=yyyy+daysum/366
	else:
		fracyear=yyyy+daysum/365
	#print " = " + `fracyear`+"\n"
	return JD
gd2jd.py converts a UT Gregorian date to Julian date.
dataset/ETHPy150Open OSCAAR/OSCAAR/oscaar/extras/eph/ephemeris.py/gd2jd