function cnvrt_lp,lpnum
;+
; NAME:				CNVRT_LP
;
; PURPOSE:			Interprets the LEB Programs (LP) number 
;				into a string
;
; CATEGORY:			REDUCTION
;
; CALLING SEQUENCE:		Result = CNVRT_LP ( Lpnum)
;
; INPUTS:			Lpnum  = LP number (0..23)
;					-or- string containing the description
;
; OUTPUTS:			Result = string containing the description
;					-or- lpnum (0..23)
;
; MODIFICATION HISTORY:		Written  RA Howard, NRL, 15 Nov 1995
;				Version 1   RAH, 15 Nov 1995  Initial Release
;				Version 2   NBR,  2 Nov 1998  allow string input for number output
;							jake	030811	added AltMech = 25
;
;
;       @(#)cnvrt_lp.pro	1.1 03/06/97 LASCO IDL LIBRARY
;
;-
;

IF datatype(lpnum) EQ 'STR' THEN BEGIN
   case lpnum of
	'Infinite Loop':		k=0
	'Peripheral Status Request':	k=1
	'Take M1 Measurement':		k=2
	'FP Check and Correct':		k=6
	'Dump Memory':			k=10
	'Ground to Peripheral Command':	k=11
	'Peripheral Load':		k=12
	'Update DPT':			k=13
	'FP/Camera Coordinated Task':	k=15
	'Ground to Mechanism Command':	k=18
	'Move M1':			k=21
	'Read Mechanisms':		k=23
	;
	;    Imaging LPs
	;
	'FP (Wobble)':	k=3			; Wobble M1 inside FP Scan
	'Wobble (FP)':	k=4			; Wobble M1 outside FP Scan
	'Dark':		k=5
	'Cont RO':	k=7
	'Line Scan':	k=8
	'Normal':	k=9
	'Seq PW':	k=14
	'Concurrent':	k=16
	'Lamp':		k=17			; Calibration Lamp 
	'Sum/Diff':	k=19
	'Sequence':	k=20
	'Trans Detect':	k=22
	'AltMech': k=25				;Alternate Mechanism 
								;(Manual Exposure Control for short 
								;exposures of things like Mercury and Venus)

	;
	;  Unknown LP
	;
	else:  		k=-1
   endcase

ENDIF ELSE BEGIN
   case lpnum of
	0:	k='Infinite Loop'
	1:	k='Peripheral Status Request'
	2:	k='Take M1 Measurement'
	6:	k='FP Check and Correct'
	10:	k='Dump Memory'
	11:	k='Ground to Peripheral Command'
	12:	k='Peripheral Load'
	13:	k='Update DPT'
	15:	k='FP/Camera Coordinated Task'
	18:	k='Ground to Mechanism Command'
	21:	k='Move M1'
	23:	k='Read Mechanisms'
	;
	;    Imaging LPs
	;
	3:	k='FP (Wobble)'			; Wobble M1 inside FP Scan
	4:	k='Wobble (FP)'			; Wobble M1 outside FP Scan
	5:	k='Dark'
	7:	k='Cont RO'
	8:	k='Line Scan'
	9:	k='Normal'
	14:	k='Seq PW'
	16:	k='Concurrent'
	17:	k='Lamp'			; Calibration Lamp 
	19:	k='Sum/Diff'
	20:	k='Sequence'
	22:	k='Trans Detect'
	25: k='AltMech'				;Alternate Mechanism 
								;(Manual Exposure Control for short 
								;exposures of things like Mercury and Venus)
	;
	;  Unknown LP
	;
	else:  k='LEB PROG #'+strtrim(string(lpnum),2)
   endcase
ENDELSE

return,k
end

