Inputs:
    T: Numpy 1-D array of datetime.datetime OR string for dateutil.parser.parse

    Outputs:
    yd: yyyyddd four digit year, 3 digit day of year (INTEGER)
    utsec: seconds from midnight utc

def datetime2yeardoy(time: Union[str, datetime.datetime]) -> Tuple[int, float]:
    """
    Inputs:
    T: Numpy 1-D array of datetime.datetime OR string for dateutil.parser.parse

    Outputs:
    yd: yyyyddd four digit year, 3 digit day of year (INTEGER)
    utsec: seconds from midnight utc
    """
    T = np.atleast_1d(time)

    utsec = np.empty_like(T, float)
    yd = np.empty_like(T, int)
    for i, t in enumerate(T):
        if isinstance(t, np.datetime64):
            t = t.astype(datetime.datetime)
        elif isinstance(t, str):
            t = parse(t)

        utsec[i] = datetime2utsec(t)
        yd[i] = t.year*1000 + int(t.strftime('%j'))

    return yd.squeeze()[()], utsec.squeeze()[()]