;+
; NAME:
;	V42PIX
; PURPOSE:
;	Convert a VECT4 structure to pixel coordinates in an image.
; CALLING SEQUENCE:
;	xy = pix2v4(coords,tohdr)  
;		("coords" is a(n array of) v4 structure(s))
; RETURNS:
;	an nx2 array containing X's and Y's.
; HISTORY: 
;	Written by Craig DeForest, 24-Oct-1997
;-
function v42pix,coords,tohdr
hdr = solar_hdr()
v2 = v4xform(coords,'SRS')
v = v4canon(temporary(v2))
;v = v4canon(v4xform(coords,'SRS'))
hdr.CTYPE1 = v(0).u1
hdr.CTYPE2 = v(0).u2

if isvalid(tohdr) then return,zcoord(v.x1,v.x2,hdr(0),tohdr(0)) $
	else return,[[v.x1],[v.x2]]
end
