; ; CALLING SEQUENCE: image=it_disk(img,header[,RADIUS=radius]) ; ; PARAMETERS: img is the image array to extract circle from ; header is the .fts header from which to get center info,etc. ; ; NOTES: This function only operates on FITS images with CORRECT ; header information. It will extract a circular region ; specified by radius info in the header. If another radius ; is desired, set the keyword RADIUS equal to desired value. ; Function's behavior is unpredictable at radii larger than ; image array size. ; ; RETURN TYPE: INTARR ; ; CALLS: R_COORD.PRO, IT_GETRAD.PRO ; ; HISTORY: Drafted by Tony Darnell, 20-MAR-97. ; ; FUNCTION it_disk,image,header,radius=radius arrsz=SIZE(image) cirarr=MAKE_ARRAY(arrsz(1),arrsz(2),/INT) IF NOT KEYWORD_SET(radius) THEN BEGIN radius=it_getrad(header) END hcrpix1=fxpar(header,'CRPIX1') IF (!err NE -1) THEN ew_center=hcrpix1 IF (ew_center LE 0) THEN BEGIN cen_err=WIDGET_MESSAGE('The centering info in this header is invalid', $ /ERROR,TITLE='Bummer') cirarr(0,0)=-1 RETURN,cirarr ENDIF hcrpix2=fxpar(header,'CRPIX2') IF (!err NE -1) THEN ns_center=hcrpix2 IF (ns_center LE 0) THEN BEGIN cen_err=WIDGET_MESSAGE('The centering info in this header is invalid', $ /ERROR,TITLE='Bummer') cirarr(0,0)=-1 RETURN,cirarr ENDIF ind=LINDGEN(arrsz(1),arrsz(2)) center=fltarr(2) center(0)=ew_center center(1)=ns_center disk=r_coord(ind,arrsz(1),center) cirarr(where(disk LE radius))=image(where(disk LE radius)) RETURN,cirarr END