Viewing contents of file '../idllib/uit/pro/chngxy.pro'
pro chngxy,hdr1,x1,y1,hdr2,x2,y2
;+
; NAME:
;       CHNGXY
; PURPOSE:
;       To convert x and y values based on the reference frame of one header
;       into x and y values based on the reference frame of a new header.
; CALLING SEQUENCE:
;       chngxy,hdr1,x1,y1,hdr2,x2,y2
; INPUTS:
;       hdr1 - first FITS header
;       x,y  - x and y values based on hdr1, scalars or vectors
;       hdr2 - second FITS header
; OUTPUTS:
;       x2,y2 - x and y values based on hdr2
; SIDE EFFECTS:
;       if hdr2  is at a different equinox, it will be precessed to match
;       hdr1.
; REVISON HISTORY:
;       written by J. Hill, STX
;       documented for public use, B. PFarr, STX, 2/91
;-
if (n_params() lt 6) then begin
   print,'CHNGXY calling sequence: chngxy,hdr1,x1,y1,hdr2,x2,y2'
   return
endif
ep1 = get_equinox(hdr1)
ep2 = get_equinox(hdr2)
if ep1 NE ep2 then hprecess,hdr2,ep1
xyad,hdr1,x1,y1,a,d
adxy,hdr2,a,d,x2,y2
return
end