;+
;
; NAME:
;   hsi_vis_type
;
; PURPOSE:
;    This function returns one of the 3 allowed full names for the hsi_vis.type tagname
;		The three full names are 'photon', 'reg_electron', and'reg_photon'
; CALLING SEQUENCE:
;       type = hsi_vis_type('pho') ;RETURNS 'photon'
;
;
; CALLED BY:
;
;   -
;
; CALLS TO:
;
;
;
; INPUT:
;	Arg - string, if it includes 'ph' photon is set, 'reg' a regularization
;		visibility will be set, 'el' regularized electron visibilities will be set
; KEYWORD:
;	FULL - return the full name of the type, i.e. types_full = ['photon', 'regularized photon', 'regularized electron']
;	ALL	 - return either the short or full name of all the types
; MODIFICATION HISTORY:
;	24-jul-2012, richard.schwartz@nasa.gov
;-

function hsi_vis_type, arg, all=all, full=full

types = ['photon', 'reg_photon', 'reg_electron']
types_full = ['photon', 'regularized photon', 'regularized electron']

full = keyword_set(full)

if keyword_set(all) then return, full ? types_full : types

input = keyword_set(arg) ? arg : 'photon'

reg   = stregex(/boo,/fold, input,'reg')
elec  = stregex(/boo,/fold, input,'el')
phtn  = stregex(/boo,/fold, input,'ph')
case 1 of
	elec: index = 2
	reg*phtn: index = 1
	else: index = 0
	endcase

return, full ? types_full[index] : types[index]
end