;+
;
; NAME: 
;  inms_doy2julian - converts calendar strings to Julian dates
;
function inms_doy2julian, asDoyTimes, mjd=mjd
;
; PURPOSE: 
;   convert strings in the form yyyy-doyThh:mm:ss.sss  to a Julian date
;
; RETURNS:
;   Julian Date, JD for the specified 
;   Gregorian Dates. If the input is an array
;   the output is an array of the same shape
;
; ARGUMENTS:
;   asDoyTimes - an array of strings containing PDS compliant
;                doy time strings.  
;   /MJD         Set if input is a modified Julian date
;
; METHOD:
;   The input calendar dates are converted to ordinal dates,
;   where the date is the year*1000+day-of-year and the time
;   is the time of day in milliseconds. The routine 
;   sprl_cvt_odate_jdate performs the conversion to Julian Date.

;
; CHANGES:
; 09-Nov-2005 D.A. Gell  Initial Coding
;
;-
;==============================================================
;
    on_error, 2

    asTime = inms_remove_quotes(asDoyTimes)

    axParsedTime = inms_parse_time(asTime)
    anDates = 1000L*axParsedTime.nYear + axParsedTime.nDay
    anTimes = 1000L*(axParsedTime.nsec $
                     + 60L * ( axParsedTime.nMin $
                         + 60L * axParsedTime.nHour))
    return, sprl_cvt_odate_jdate(anDates, anTimes, mjd=mjd)
end
