;+ ; NAME: ; naif_id ; ; PURPOSE: ; Given an integer or a string return the naif id of target ; ; DESCRIPTION: ; Given an integer or a string return the naif id of target ; ; CALLING SEQUENCE: ; id = naif_id(idin, found) ; ; INPUTS: ; idin - scalar or array of integers or strings ; OUTPUTS: ; found - scalar or array, 1 if found, 0 if not found ; id - scalar or array of longs, the naif ID ; ; REVISON HISTORY: ; 2007 Sep 12 LAY ;- function naif_id, idin, found n = n_elements(idin) found = replicate(1b,n) id = lonarr(n) for i = 0, n-1 do begin idini = idin[i] case datatype(idini) of 'STR': begin CSPICE_BODN2C, idini, idi, f found[i] = f id[i] = idi end 'INT': id[i] = idini 'LON': id[i] = idini else: begin id[i] = 0 found[i] = 0 end endcase endfor if size(idin, /n_dim) eq 0 then begin id = id[0] found = found[0] endif else begin dim = size(idin, /dim) id = reform(id, dim) found = reform(found, dim) endelse return, id end