define SZ_MONTH 3 # pkttime -- convert the packet time to modified Julian date # # Description: # ------------ # # Version Date Author Description # 3 12-09-90 J.-C. Hsu rewrite in SPP #------------------------------------------------------------------------------- procedure pkttime (pkttm, mjd) ## input char pkttm[ARB] # packet time string ## output double mjd # modified Julian date ## local int year, month, day int ip, pt char monstr[SZ_MONTH], dummy[SZ_MONTH] double dd, hour int strdic(), ctoi(), ctod() #------------------------------------------------------------------------------ begin # read the month substring and convert to numerical month call strcpy (pkttm[4], monstr, SZ_MONTH) month = strdic (monstr, dummy, SZ_MONTH, "|JAN|FEB|MAR|APR|MAY|JUN|JUL|AUG|SEP|OCT|NOV|DEC|") if (month <= 0) call error (1, "illegal packet time string") # read year, day, and hour ip = 1 pt = ctoi (pkttm, ip, day) ip = 8 pt = ctoi (pkttm, ip, year) pt = ctod (pkttm, ip, hour) dd = dble(day) + hour/24.d0 # calculate the modified Julian date call cdmjd (year, month, dd, mjd) end