;+
; NAME:
;	V4OK
; PURPOSE:
;	Check for self-consistency in a V4 array
; CALLING SEQUENCE:
;	ok = v4ok(vectors)
; AUTHOR:
;	Craig DeForest
; HISTORY:
;	6-Oct-1997 Initial version
;-
function v4ok,in

; It's gotta be a structure to be valid!
if(not data_chk(in,/struct)) then return,replicate(0,nlm(in))

; Fill our flag array with 1's
out = replicate(1,nlm(in))

; Retrieve data about the coordinates.
a = getv4type(in)

; If any of the coordinate systems were unknown, they're invalid.
out = (out and (a.coords)(0) ne "")

; Make the units more accessible
u = transpose([[in.u0],[in.u1],[in.u2],[in.u3]])

; Loop over the four dimensions, and make sure that we can interconvert
; between the standard unit types and the ones given.  Don't try to 
; convert time stamps.
for i=0,3 do begin
	out = 		out 				$
		and 	((a.units(i,*) eq "timestamp")   $
			 or  				 $
			 (zunits(u(i,*),(a.units)(i,*)) ne 0))
end

return,out
end




