	FUNCTION GetObsID, startTime= startTime
;	------------------------------------------------------------
;+							15-Apr-92
;	NAME:
;		GetObsID
;       PURPOSE:
;		Given the beginning date of the Archive week return
;		the proper file ID for the Observing Log.
;	CALLING SEQUENCE:
;		obsFileID = GetObsID(startT = startTime)
;	INPUT/Keyword:
;		startTime	string giving the start time of
;				archive week.
;	RETURNED:
;		obsFileID 	string in the format of yy_wka
;				where,
;				letter 'a' is an unused option saved
;				CD archive-- part I and II denoted as
;				'a' and 'b'.
;				NOTE: the following was dropped with
;				19-Feb-92 ver.
;				The file extendsion is the rev. number
;				of the acrhiving process (e.g. first
;				time is rev 1 and 2nd is 2 ...etc.)
;	HISTORY:
;		written 23-Sep-91 by GAL
;		updated 19-Feb-92, GAL for MONS ver # within file name.
;			i.e. dropping the ".1" which was the revno
;			of the archiving from the fileID.
;		1-Mar-92 (MDM) Changed "wk" to use I2.2 format statement
;			(it had trouble with week # < 10)
;		15-Apr-92 added trap for null input... add to avoid
;			hanging reformatter.
;-
;	-----------------------------------------------------------

	
	IF (NOT KEYWORD_SET(startTime))	THEN BEGIN	;not defined
	  IF (N_ELEMENTS(startTime) ne 0) THEN BEGIN 	
	    Print, 'Null input returning null result!'
	    RETURN, ''
	  ENDIF
	  startTime = ' '
	  READ, 'Enter beginning Date of Archive week [yymmdd]: ', $
		  startTime
	ENDIF 


;	The following method counts from weeks Always starting on sunday:

	stYr = STRMID(startTime,0,2)	;year
	stmm = STRMID(startTime,2,2)	;month
	stdd = STRMID(startTime,4,2)	;day
	a = [0,0,0,0,fix(stdd),fix(stmm),fix(styr)]	;external format

	wk = Ex2week(a)	

	;wk = STRTRIM( string(wk), 2)
	wk = string(wk, format = '(i2.2)')	;MDM added 1-Mar-92
	
	ret = stYr +'_'+ wk + 'a'

	RETURN, ret
	END
