function conv_p2hxt, pix, old=old
;+
; NAME:
;	CONV_P2HXT
; PURPOSE:
;	To convert from SXT pixel location to an HXT pixel location
; CALLING SEQUENCE:
; 	hxt = conv_p2hxt(pix)
; INPUTS:
;       pix	- The SXT IDL Full Resolution coordinate
;                       (0,*) = E/W value (0,0 in lower left South-East)
;                       (1,*) = N/S value
; OUTPUTS:
;       hxt     - The pixel coordinates of the point(s) in question in 
;		  126 arcsec units (??)  Rectified HXA coordinates, in 
;		  HXT pitch units, as used in the Matsushita study
;                       (0,*) = E/W direction with W negative!
;				NOTE: This is opposite of SXT and HELIO
;                       (1,*) = N/S direction
; HISTORY:
;	written by HSH, July 29, 1992
;       TRM  June 1993 Modified to call conv_h2p.pro and changed the inputs
;	22-Jun-93 (MDM) - Modified the header some
;	20-Dec-93 (MDM) - Changed the algorithm and coefficients to use 
;			  Masuda san's HXT_IMG_CNTR algorithm.  It took
;			  the /home/flare/hxt/masuda/hxt_param/hxt_param1
;			  data file coefficients of Dec-93.
;			  print, hxt_img_cntr(date, [0,0]) gave
;				515.3, 703.5      +/- 0.2 pixels
;			  determining one sample very 7 days over 2 year
;			  time span.
;	21-Apr-94 (MDM) - Corrected error which gave incorrect results when
;			  more than one pair of coordinates were passed in.
;			  Old version returned the first location for all
;			  values.
;-
;
if (keyword_set(old)) then begin
    print, 'Using the old HSH method'
    xy = 2.46 * pix
    xy(0,*) = ( 1302.3 - 1.0316 * xy(0,*)) / 126.
    xy(1,*) = (-1660.4 + 0.9709 * xy(1,*)) / 126.
    return, xy
end
;
x0 = 515.3
y0 = 703.5
theta2 = 0.67		; rotation between HXT and SXT
hxt_pitch = 126.0	; in arcsec
sxt_pxlsiz = 2.46	; in arcsec
;
sxt_x = -(pix(0,*)-x0) / (hxt_pitch/sxt_pxlsiz)
sxt_y =  (pix(1,*)-y0) / (hxt_pitch/sxt_pxlsiz)
;
c = cos(theta2/!radeg)
s = sin(theta2/!radeg)
;
out = float(pix)
out(0,*) =  c*sxt_x + s*sxt_y
out(1,*) = -s*sxt_x + c*sxt_y

return, out
end
