section of routines in img.i

functions in img.i -

 
 
 
img_cbar


             img_cbar, img;  
          or img_cbar, cmin=cmin, cmax=cmax;  
 
           
     Draw a color bar below the  current coordinate system.  If LEVS is not  
     specified uses plfc_levs (set by previous call to plfc).  If COLORS is  
     specified, it should have one  more value than LEVS, otherwise equally  
     spaced colors are chosen, or  plfc_colors if plfc_levs was used.  With  
     the VERT=1  keyword the color bar  appears to the left  of the current  
     coordinate  system (vert=0  is default).   By default,  color_bar will  
     attempt  to  label some  of  the  color  interfaces.  With  the  LABS  
     keyword,  you can  force the  labelling algorithm  as  follows: LABS=0  
     supresses all  labels, LABS=n forces  a label at every  n-th interface,  
     LABS=[i,n]  forces  a  label  at  every n-th  interface  starting  from  
     interface i (0<=i<=numberof(LEVS)).  
     You    can    specify   the    viewport    coordinates   by    keyword  
     VPORT=[xmin,xmax,ymin,ymax]; by default the  colorbar is drawn next to  
     the current viewport.  You can use the ADJUST keyword  to move the bar  
     closer to (adjust<0) or further from (adjust>0) the viewport.  
     You  can specify  the string  format  for labels  with keyword  FORMAT  
     (default "%g"), the font  type with keyword FONT (default "helvetica")  
     and the font height with keyword HEIGHT (default 14 points).  
     Keyword COLOR  can be  used to  specify the color  of the  labels, the  
     ticks and the frame of the colorbar.  Default is foreground color.  
     Keyword WIDTH can be  used to set the width of the  lines used to draw  
     the frame and the ticks of the colorbar.  
     Keyword TICKLEN  can be used to set  the lenght (in NDC  units) of the  
     ticks.  Default is 0.005 NDC.  
       
SEE ALSO: plfc  
 
 
 
img_dims


             img_dims(img)  
 
     Returns dimensions of image IMG: [WIDTH,HEIGHT].  IMG must be a 2  
     dimensional array.  
SEE ALSO,   dimsof.  
 
 
 
img_extract_parallelogram_as_rectangle


             img_extract_parallelogram_as_rectangle(img, x1, y1, x2, y2, x3, y3,  
                                                    width, height)  
 
      Returns a WIDTH-by-HEIGHT rectangle obtained by bi-linear  
      interpolation of a parallelogram region from image IMG.  The  
      parallelogram is specified by the coordinates of 3 of its corner:  
      (X1,Y1) is the upper-left corner, (X2,Y2) is the lower-left corner  
      and (X3,Y3) is the lower-right corner.  Note that coordinates run  
      like Yorick indices: (1,1) is the location of the lower-left pixel in  
      the image.  
        
SEE ALSO: img_interpolate,   LUsolve  
 
 
 
img_fft_centered_at_max


             img_fft_centered_at_max(img)  
 
     Returns image IMG rolled so that its maximum is at coordinates (1,1).  
SEE ALSO: img_dims,   img_max,   img_flt_max,   roll  
 
 
 
IMG_FITS


 IMG_FITS  
 
SEE IMG_PNM  
 
 
 
img_flt_flac


             img_flt_flac(img, width)  
 
     Compute ``flipped-local-auto-convolution'' (sic!)   of image IMG.  The  
     output  pixel  value  is  the   local  convolution  --  in  a  box  of  
     WIDTH-by-WIDTH pixels  (WIDTH must  be odd) --  of the input  image by  
     itself rotated  by 180 degrees.  This  is usefull to  locate spikes in  
     IMG that may have different shapes but are all nearly symmetrical with  
     respect to both axis (i.e.   each spike has its shape nearly unchanged  
     by a  180 degrees  rotation).  This processing  is a kind  of adaptive  
     filtering.   WIDTH should  be roughly  as large  as the  typical spike  
     width.  The impact of input noise  in the result is reduced by using a  
     larger WIDTH. But  WIDTH should remain smaller than  half the smallest  
     separation between  spikes.  The  computation time is  proportional to  
     WIDTH^2.  
SEE ALSO: img_flt_max  
 
 
 
img_flt_max


             img_flt_max(img, width)  
 
     Return indices of pixels in image IMG that have the maximum value in a  
     local  WIDTH-by-WIDTH box  (WIDTH must  be odd).   If keyword  UNIQ is  
     true, a uniq maximum is  selected in every WIDTH-by-WIDTH box, in this  
     case the intensity of the maxima will be in ascending order.  
SEE ALSO: img_flt_flac  
 
 
 
img_get_type


 img_get_type  
 
SEE IMG_PNM  
 
 
 
IMG_GIF


 IMG_GIF  
 
SEE IMG_PNM  
 
 
 
img_interpolate


              img_interpolate(img, x, y)  
 
     Returns image IMG interpolated (by bi-linear interpolation) at  
     positions (X,Y).  The coordinates X and Y must be conformable and the  
     result has dimensopn list dimsof(X,Y).  Note that coordinates run like  
     Yorick indices, for instance (1,1) is the location of the lower-left  
     pixel in the image.  
       
SEE ALSO: interp  
 
 
 
IMG_JPEG


 IMG_JPEG  
 
SEE IMG_PNM  
 
 
 
img_max


             img_max(img)  
 
     Returns coordinates of first image maximum.  
SEE ALSO: img_dims,   img_flt_max  
 
 
 
img_pad


             img_pad(img)  
 
       -or- img_pad(img, dimlist)  
       -or- img_pad(img, width, height)  
     Pad an image to another size, one of:  
       - the smallest square 2D array that contains the image  
       - an 2D array with dimension list DIMLIST  
       - a WIDTH-by-HEIGHT array  
     The padding value can be specified with keyword BG (for "background"),  
     the default is 0.  
       
     The type of the result depends on the types of IMG and BG.  
     The justification is set by keyword JUST:  
       JUST =  0 or nil -> lower-left (the default)  
               1        -> center  
              -1        -> at corners to preserve FFT indexing  
SEE ALSO: img_paste,   img_dims  
 
 
 
img_paste


             img_paste(dst, x, y, src)  
 
     Paste image (2D array) SRC  at location (X,Y) in DST.  The coordinates  
     (X,Y) are the  integer indices of the location in  DST where the lower  
     left pixel  of SRC will be pasted.   SRC is possibly clipped  so as to  
     fit  into DST  (e.g.  X  and/or Y  may be  less or  equal  zero).  The  
     operation is  done "in-place"  and the result  is returned.   The data  
     type of DST is unchanged.  
       
SEE ALSO: img_pad,   img_dims  
 
 
 
img_photometry


             img_photometry(img, x, y, r)  
 
     Returns  sum of pixel  values in  image IMG  whithin circular  area of  
     radius R and centered at (X,Y).  Arrays X, Y and R are in pixel units,  
     they may have any geometry  but must be conformable.  Coordinates have  
     the  same  origin  as  array  indices:  the first  pixel  in  IMG  has  
     coordinates (1,1).  
       
SEE ALSO,   dimsof,,   avg.  
 
 
 
img_plot


             img_plot, img;  
 
     Plot image (2D array) IMG using pli.  Keyword FIRST can be used to set  
     coordinates  of  center  of  first  (lower  left)  pixel,  default  is  
     FIRST=1.0 (i.e. same coordinates as Yorick's indexing rules).  Keyword  
     SCALE  can  be used  to  set the  step  size  between adjacent  pixels  
     (default is SCALE=1.0).   Keywords FIRST and/or SCALE may  have one or  
     two values depending whether or not both axis have same value.  
SEE ALSO,   pli,,   img_dims.  
 
 
 
IMG_PNG


 IMG_PNG  
 
SEE IMG_PNM  
 
 
 
IMG_PNM


             img_get_type(filename)  
 
     Returns image type for file FILENAME.  If keyword READING is true,  
     then FILENAME must exists and the image type is obtained from the file  
     signature (the 4 first bytes in the file).  Otherwise, if keyword TYPE  
     is true it must be one of the string: "pnm", "jpeg", "png", "tiff",  
     "fits", or "gif". Finally if none of this keywords is set, the image  
     type is guessed form the file extension.  
       
     The returned value is one of:  
       1 = IMG_PNM    portable anymap (PBM/PGM/PPM) image;  
       2 = IMG_JPEG   JPEG image;  
       3 = IMG_PNG,   portable network graphic image;  
       4 = IMG_TIFF   TIFF image;  
       5 = IMG_FITS   FITS (flexible image transport system) file;  
       6 = IMG_GIF    GIF image;  
       
SEE ALSO: img_read,   img_write  
 
 
 
img_read


             img_read(filename)  
 
     Returns image  read from FILENAME.   Supported image formats  are: PNM  
     (PBM/PBM/PPM), JPEG,  PNG, TIFF,  FITS and GIF.   For some  formats, a  
     temporary PNM  image needs  to be created;  the name of  the temporary  
     file can be specified with keyword TMP.  
       
SEE ALSO: system,   pnm_read,   fits_read,   img_get_type,  
img_tmpnam,   expand_file_name,  
protect_file_name  
 
 
 
IMG_TIFF


 IMG_TIFF  
 
SEE IMG_PNM  
 
 
 
img_tmpnam


             img_tmpnam(name)  
 
     Return a  string in the form: NAME~#  where # is an  integer chosen so  
     that file  NAME~# does not exists.   Beware that there  is no absolute  
     warranty that the returned name is not used elsewhere (for instance if  
     two programs run at the same time and call the same function) but this  
     is highly improbable.  In order to limit the  probabilty of such clash  
     to occur, an empty file named NAME~# is created by the function.  
       
SEE ALSO: open  
 
 
 
img_write


             img_write, img, filename;     
 
     Writes image IMG into file FILENAME as PNM (PBM/PBM/PPM), JPEG, PNG,  
     TIFF or FITS image.  Except for a FITS file, if pixel type of IMG is  
     not 'char', the pixel values are scaled to unsigned bytes (0-255) with  
     bytscl function (which see).  The image type can be specified by the  
     keyword TYPE otherwise it is automatically guessed from FILENAME  
     extension (see img_get_type).  
   KEYWORDS  
     Keywords common to all format:  
       TYPE - Output image type, one of: "jpeg", "pnm", "png", "tiff"  
           or "fits".  
       TMP - Name of the temporary file (format PBM, PGM, or PPM, see  
           pnm_write) to creates.  Default is FILENAME~NUMBER where NUMBER is  
           the smallest integer such that no file with the same name already  
           exists (note that under race conditions the name of the default  
           temporary file is not guaranteed to be unique).  
       NOFLIP - See pnm_write -- not used for FITS format.  
       CMIN, CMAX - Optional lower/upper cutoff (see bytscl) -- not used  
           for FITS format.  
     Keywords for JPEG images:  
       EPS - If true, "jpeg2ps" is used to generate an encapsulated  
           PostScript (level 2) image named FILENAME.eps (the JPEG image is  
           not removed).  
       QUALITY - JPEG quality (default 75).  
       OPTIMIZE - Creates optimized JPEG image.  
       GRAY/GREY - Creates grayscale JPEG image.  
       PROGRESSIVE - Creates a progressive JPEG file.  
       COMMENT - Text comment.  
       SMOOTH=0-100 - Smooth the input image to eliminate dithering  
           noise, 0 (the default) means no smoothing.  
     Keywords for PNG images:  
       COMPRESSION=1-9 - Level of compression (default is 6).  
       INTERLACE - Creates an interlaced PNG file.  
         
     Keywords for FITS images:  
       BITPIX=n - Bits-per-pixel value.  
       
SEE ALSO: pnm_write,   bytscl,   system,   img_get_type,  
img_tmpnam,   expand_file_name,  
protect_file_name