;+ ; fb.pro IDL procedure ; ; PURPOSE ; Read FITS images and define a region of interest. ; ; SYNTAX ; fb, 'fits_file' ; ; PROCEDURES USED ; readfits ; writefits ; fxaddpar ; ; HISTORY ; Author: Andrew L. Stanger 2 June 1998 ;- pro fb, fits_file loadct, 0 lct,'/home/stanger/color/bwy.lut' red = indgen (256) green = indgen (256) blue = indgen (256) xdim = 0 ydim = 0 xcen = 0 ycen = 0 roll = 0.0 mag = 1.0 ;--- Read FITS image. img = readfits (fits_file, hdu) xdim = fxpar (hdu, "NAXIS1") ydim = fxpar (hdu, "NAXIS2") nbypix = fxpar (hdu, "BITPIX") * 8 xcen = fxpar (hdu, "CRPIX1") ycen = fxpar (hdu, "CRPIX2") pixrs = fxpar (hdu, "PIXRS") ;--- Display image. tvscl, img ;--- Define Region-of-interest (ROI). polypix = defroi (xdim, ydim, xv, yv) size_roi = size (polypix) nloc = size_roi (1) xloc = intarr (nloc) yloc = intarr (nloc) FOR i = 0, nloc-1 DO $ BEGIN yloc (i) = polypix (i) / xdim xloc (i) = polypix (i) - yloc (i) * xdim END size_xv = size (xv) nv = size_xv (1) print, 'size (xv): ', size (xv) print, 'size (yv): ', size (yv) FOR i = 0, nv - 1 DO $ print, 'i, xv, yv: ', i, xv (i), yv (i) print, 'size (polypix): ', size (polypix) FOR i = 0, nloc - 1 DO $ print, 'polypix, xloc, yloc: ', polypix (i), xloc (i), yloc (i) ; xm = xmass (imgref, imgcme, xdim, ydim, nbypix, $ ; xcen, ycen, pixrs, xloc, yloc, nloc) brt = brtsum (img, xloc, yloc, nloc) print, 'brt: ', brt END