import re
import datetime


def DateString_DecimalYear(string):
    """
    DateString_DecimalYear(string):
    A simple function to convert a text date value into a float year value.
    YYYY/MM/DD in, YYYY.yyy out.
    """
    #string formatted as YYYY/MM/DD
    date_time = re.split('\D+', string)
    #convert the date into a decimal year:
    date = datetime.datetime(int(date_time[0]),int(date_time[1]),int(date_time[2]))
    dec_date = (float(date.strftime("%j"))-1) / 366 + float(date.strftime("%Y"))
    return dec_date