; ; CALLING SEQUENCE: image=it_center(img,x_center,y_center) ; ; PARAMETERS: img is the image array to be centered. ; x_center and y_center are the current center ; information found in the FITS header. ; ; NOTES: This function operates on FITS images with CORRECT ; centering information in the header. It will center ; any sized array into a larger, square array, keeping ; all available data intact; nothing is discarded. ; The returned image can be composited with another ; image with it_add.pro or resized to match another ; solar diameter with it_radius.pro ; ; RETURN TYPE: INTARR ; ; CALLS: NONE ; ; HISTORY: Drafted by Tony Darnell, 21-Mar-97 ; FUNCTION it_center,image,x_center,y_center sz=SIZE(image) x_max=sz(1) y_max=sz(2) x1=x_center y1=y_center x2=x_max-x_center y2=y_max-y_center x=(x1>x2) y=(y1>y2) r=(x>y) d=r*2 array=INTARR(d,d) w_center=d/2 w1=(0>(w_center-x_center)) w2=w_center-x_center+x_max-1 v_center=w_center v1=(0>(v_center-y_center)) v2=v_center-y_center+y_max-1 array(w1:w2,v1:v2)=image(0:x_max-1,0:y_max-1) RETURN,array END