Extended IDL Help

This page was created by the IDL library routine mk_html_help. For more information on this routine, refer to the IDL Online Help Navigator or type:

     ? mk_html_help

at the IDL command line prompt.

Last modified: Fri Mar 26 14:10:22 1999.


List of Routines


Routine Descriptions

ABS_PROF_XY

[Next Routine] [List of Routines]
 NAME:
       ABS_PROF_XY
 PURPOSE:
       Loop over image-rows (or -strips) of an image:
       scanning along dispersion ->  line-tracings ("scans"),
       absorption-line-parameters -> output-arrays
*CATEGORY:            @CAT-# 16 31@
       Image Processing , Spectral Analysis
 CALLING SEQUENCE:
 ABS_PROF_XY,img,dixc,wxc, xl,xr,int_cont,int_min,xmin [,eqvw] ...
             [,WDIR=1|2] [,IBISECT=intensvector] ...
             [,XSPLINE=xspline] [,TENS=tension] ...
             [,XRANGE=range] [,YRANGE=range] [,STEP=increment] ...
             [,ROWS=yvect] [AVRY=dy] [,/LINEAR] [,PLOT={'ALL' | yplot_vect} ]
 INPUTS:
       IMG = 1- or 2-dim array containing an intensity-scan or an image.
       DIXC = scalar or 2-element vector: 
              distance (pixel) x_continuum - x_line_center
              for one or two position(s) to determine the continuum intensity;
       WIXC = scalar or 2-element vector: width (pixel) of interval(s) for
              averaging intensities (in IMG) to determine the continuum-
              intensity; averaging is done over: 
              x_line_center + dixc(i) +- wixc(i)/2 (i=0 [,1]) for each scan.
 OPTIONAL INPUT PARAMETER:
      ROWS=yvect  = 1-dim integer vector containing indices of image-rows
             (direction "y" along slit) for which line -center and
             -intensity shall be determined;
             !!! On return, the date in yvect will be over-stored by
             !!! the actual y-positions of each tracing (central row) !
             !!! Will be OVER-RULED by specifying YRANGE and/or STEP !
             !!! Must be a variable, NOT a constant!
      WDIR= 1 or 2    the wavelength-direction ("x") is the 1st or 2nd
             dimension of array IMG; 
             default: WDIR=1 (WDIR=2 only meaningful if IMG is 2-dimensional).
      XRANGE=[start,end]  only data within specified index-range will be
             used along wavelength-(x)-dimension of IMG-array;
             0 <= start < end <= nx-1 (nx: size of IMG x-dir.);
             default: start=0, end=nx-1 .
      YRANGE=[start,end]  only data within specified index-range will be
             used along slit-(y)-dimension of IMG-array;
             0 <= start < end <= ny-1 (ny: size of IMG y-dir.);
             only meaningful if IMG is 2-dimensional;
             !!! Specifying YRANGE will OVER-RULE any setting in
             !!! optional input parameter YVECT !
             Default: start=0, end=ny-1 .
      STEP=increment   profile tracings will be taken at equidistant 
             steps along slit-(y)-positions with increment as specified;
             only meaningful if IMG is 2-dimensional;
             !!! Specifying STEP will OVER-RULE any setting in
             !!! optional input parameter YVECT !
             Default (if IMG is 2-dim): increment=5.
      AVRY=dy    profile tracing at slit-(y)-position y will be 
             obtained by averaging from y-dy to y+dy;
             only meaningful if IMG is 2-dimensional;  
             default (if IMG is 2-dim): dy=4.
      IBISECT=intensvector :  bi-sectors shall be obtained at relative
             line intensities specified in vector intensvector; values must
             be increasing;
             the actual intensities at k-th tracing (k >= 0) will be:
             ymin(k,1)+(ycont(k,2)-ymin(k,1))*intensvector;
             if keyword not specified or with intensvector "empty": 
             procedure will set
             intensvector = [0.05,0.1,0.2,0.3,0.4,0.5,0.7,0.8]; this vector
             will be returned if IBISECT=intensvector was specified on call
             with an "empty" intensvector.
      XSPLINE=xspline : vector containing positions (index-scale) of spline-
             nodes; if xsplin undefined or single value, spline nodes will
             be set by procedure (adjusted to line shape for each slit-
             position); ignored if keyword /LINEAR is set.
      TENS=tension : "tension" used for smooth spline (default: tension=5.);
             ignored if keyword /LINEAR is set.
      /LINEAR : if set, the line profile points will be interpolated linearly
             (not by spline).
      PLOT = yplot : If set, the profile, its spline-interpolation
             and it's parameters as determined by routine BISECT_ABS will
             be plotted for scans at y-positions specified in vector yplot;
             if yplot = 'all' (string!), plots will be done for all scans;
             (default: no plot).
 OUTPUTS:
       xl = "left" x-positions (real, fractional indices) where smoothed
               normalized profile assumes one of the "bisector"-intensites;
       xr   ditto for "right" x-position; 
            format of xl, xr:
            if IMG is 1-dim:  1-dim real, size same as vector for 
                              bi-sector-intensities (see key-word IBISECT)
            if IMG is 2-dim:  2-dim real, (n_scans , n_bisects), where
                              n_scans is number of tracings, and n_bisects =
                              number of bi-sector-intensities.
       int_cont = real array  size: [ n_scans, 4 ] if IMG is 2-dim
                              and interpolation;
                              (1-dim vector size=4 if IMG 1-dim).
               Maximal & "continuum" intensities (intensity-scale same as 
               in SCAN at k-th tracing):
               (k,0) = maximal value in scan (both interpol.-cases);
               (k,1) = maximum of smooth spline (spline case), or
                       "continuum" intensity value at "1st position" defined 
                       by dixc(0) (linear case);
               (k,2) = "continuum" intensity value at minimum of smooth
                       spline xmin(k,1) (spline case), or at minimum of scan
                       (linear case);
               (k,3) = "continuum" intensity value at "1st position"
                       defined by dixc(0) (spline case), or at "2nd position"
                       defined by dixc(1) (linear case).
       int_min  = real array  size: [ n_scans, {4 | 2} ] if IMG is 2-dim
                                    and interpolation  {splines | linear};
                                    (1-dim vector size {4 | 2} if IMG 1-dim).
               Intensity-scale same as in SCAN at k-th tracing):
               (k,0) = minimal intensity of SCAN (both interpol.-cases);
               (k,1) = minimum of smooth spline (spline case),
                       minimum of parabolic fit defining the "line center"
                       (linear case);
               (k,2) = minimum value of parabolic fit defining the
                       "line center" (spline case only);
               (k,3) = value of smooth spline at "line center" (spline case).
       xmin  = real array size: [ n_scans, {4 | 2} ] if IMG is 2-dim
                                and interpolation  {splines | linear};
                                (1-dim vector size {4 | 2} if IMG 1-dim).
               x-positions corresponding to int_min(k,0:3);
 OPTIONAL OUTPUTS:
      eqvw     = real vector or real variable:
               if this argument is provided on call, the equivalent widths 
               of the profiles will be calculated by integrating the profile
               depression of each tracing from
               x_line_center + dixc(0) to x_line_center + dixc(1)
               or x_line_center +- dixc if dixc is a single value;
               the equivalent width is in units of (delta_lambda/pixel).
      ROWS=yvect  = integer vector of y-positions (integral indices of image 
                rows) at which profile tracings have been obtained (will be
                set to 0 if IMG is 1-dim).
      IBISECT=intensvector  | if these variables were not specified on call,
      XSPLINE=xsplin        | the values set internally by the procedure
      TENS=tens             | will be returned.
      ROWS=yvect  = integer vector of y-positions (integral indices of image 
                rows) at which profile tracings have been obtained (will be
                set to 0 if IMG is 1-dim).     
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       Plots if keyword PLOT was set.
 RESTRICTIONS:
       IMG must contain a well defined absorption profile (both halves
       of profile without severe blending = blends with deeper minimum
       than the line itself).  
 PROCEDURE:
       For each requested slit-position yvect(k) of IMG a line profile 
       ("tracing") will be obtained by averaging from
       yvect(k)-width to yvect(k)+width;
       "approximate" line center x0 is determined by the minimum of a running-
       box-mean of the profile;
       Linear interpolation of "continuum"-intensity from intensity-values
       around x1,2= x0 + dixc(0,1) +- wixc(0,1)/2 
       (constant continuum assumed if dixc single value);
       normalization of intensities to continuum == 1;
       Interpolated of line profile by a smoothed spline (nodes as specified 
       in XSPLINE=xspline or set by program (with finer steps around the
       significant part of the line);
       "continuum" intensities, intensities near line center, and "left" &
       "right" positions where spline intersects
       intens = YMIN(1) + [ycritrel]*(YCONT(1)-YMIN(1)) will be determined. 
 MODIFICATION HISTORY:
       nlte, 1990-03-17 (predecessor of ABS_PROF_XY_ST)
       nlte, 1992-02-06 major update (output arrays, not structure)
       nlte, 1993-02-03 description for keyword LINEAR

(See /supple/soft/rsi/idl_5/lib/kis-lib/abs_prof_xy.pro)


AVX_Y

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       AVX_Y
 PURPOSE: 
	returns vector of rows averaged over columns ix_from to ix_to 
	of 2-dim array ("image").
*CATEGORY:            @CAT-#  0 30@
       Array Manipulation Routines , Smoothing
 CALLING SEQUENCE:
       i_y = AVX_Y(array,ix_from,ix_to)
 INPUTS:
       array   = 2-dim data array ("image").
	ix_from = 1st column to be averaged.
	ix_to   = last column to be averaged.
	(ix_from <= ix_to must be valid indices of 1st dimension of array)
 OUTPUTS:
	vector (size = size of 2nd dim of array) of array-values
	averaged from ix_from to ix_to (1st dim of array).
 PROCEDURE:
       arithmetic mean of array(ix_from:ix_to, j) for each j.
 MODIFICATION HISTORY:
       nlte, 1989-07-25 
	nlte, 1992-02-05  on_error, argument check

(See /supple/soft/rsi/idl_5/lib/kis-lib/avx_y.pro)


AVY_X

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 	AVY_X
 PURPOSE: 
       returns vector of columns averaged over rows iy_from to iy_to 
       of 2-dim array ("image").
*CATEGORY:            @CAT-#  0 30@
       Array Manipulation Routines , Smoothing
 CALLING SEQUENCE:
       i_x = AVY_X(array,iy_from,iy_to)
 INPUTS:
       array   = 2-dim data array ("image").
	iy_from = 1st row to be averaged.
	iy_to   = last row to be averaged.
	(iy_from <= iy_to must be valid indices of 2nd dimension of array)
 OUTPUTS:
       vector (size = size of 1st dim of array) of array-values
       averaged from iy_from to iy_to (2nd dim of array).
 PROCEDURE:
       arithmetic mean of array(iy_from:iy_to,i) for each i.
 MODIFICATION HISTORY:
       nlte, 1989-07-25 
	nlte, 1992-02-05  on_error, argument check

(See /supple/soft/rsi/idl_5/lib/kis-lib/avy_x.pro)


A_LT_B

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	A_LT_B
 PURPOSE:
	returns 1st index where a(k) < b(k) for more than n points
	in sequence.
	returns -1 if condition nowhere satisfied.
*CATEGORY:            @CAT-#  0@
	Array Manipulation Routines
 CALLING SEQUENCE:
	result = A_LT_B(a,b,n)
 INPUTS:
	a,b = Vectors to be compared
 OPTIONAL INPUT PARAMETER:
       LAST = keyword . If set, return the LAST index where a(k) < b(k)
	for more than n points in sequence.
 OUTPUTS:
	result = Index i of 1st (last) element where a(i+j) < b(i+j) , 
 		 j=0,1,..,n .
	result = -3 if either a or b is of size <= n or n <= 0
	result = -2 if a(k) < b(k) is nowhere satisfied
	result = -1 if a(k) < b(k) is satisfied by only less than n
		 elements
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       None.
 RESTRICTIONS:
       Size of a and b must be gt n
 PROCEDURE:
       Straightforward.
 MODIFICATION HISTORY:
	nlte, 1990-03-12 ( keyword last)

(See /supple/soft/rsi/idl_5/lib/kis-lib/a_lt_b.pro)


BANBKS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BANBKS
 PURPOSE:
       Solve a linear equation system A*X=B with a compact stored
       bandmatrix. 
*CATEGORY:            @CAT-# 22@
       Mathematical Procedures :
          Matrix operations, solution of linear equation systems
 CALLING SEQUENCE:
       BANBKS,a,al,indx,m1,m1,b
 INPUTS:
       A    : Upper tridiagonal matrix of LU-decomposition (output from
              routine BANDEC)
       AL   : Lower tridiagonal matrix of LU-decomposition (output from
              routine BANDEC)
       INDX : Record of row permutations (output from routine BANDEC)
       M1,M2: Number of sub/superdiagonals
       B    : righthand side of equation, vector to be solved for
                   ***  OVERWRITTEN BY BANBKS  ***
 OUTPUTS:
       B    : Solution vector
 SIDE EFFECTS:
       Input vector B is changed. If you want to keep it for later use,
       make a copy before calling banbks.
 PROCEDURE:
       See Press et al. Numerical Recipes - The art of scientific computing
 MODIFICATION HISTORY:
       28-02-1993  PS

(See /supple/soft/rsi/idl_5/lib/kis-lib/banbks.pro)


BANDEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BANDEC
 PURPOSE:
       Compute the LU-Decomposition of a bandmatrix
*CATEGORY:            @CAT-# 22@
       Mathematical Procedures :
       Matrix operations, solution of linear equation systems
 CALLING SEQUENCE:
       BANDEC,a,al,indx,m1,m2 [,D]
 INPUTS:
       A   : Array (N,m1+m2+1) with the bandmatrix. Storage scheme see
             below.  **Changed by the program**
       m1  : number of subdiagonals of matrix A
       m2  : number of superdiagonals of matrix A
 OUTPUTS:
       A   : Upper triangular matrix of the LU decomposition,dim(N,m1+m2+1
       AL  : Lower    "         "    "   "   "    "         ,dim(N,m1)
       indx: Vector of length n recording the row permutations from
             pivoting.
       d   : +- 1 depending on the number of permutations: parity
 SIDE EFFECTS:
       Matrix A is altered. If you want to keep it for later use, make
       a copy before calling BANDEC.
 RESTRICTIONS:
       
 PROCEDURE:
       For a complete description see 
          Press et al.  Numerical recipes - The art of scientific computing
       Storage scheme for A:
       Matrix A holds the non-zero elements of a square bandmatrix (from nowon
       (from nowon referred as A0). 
       The dimension of A is ( N , m1 + m2 + 1) with
       N,m1 and m2 as defined above. The diagonal elements of A0 are
       stored in A(*,m1), the subdiagonal Elements in A(*,0:m1-1) and
       the superdiagonal elements in A(*,m1+1:m1+m2). Nondefined
       Elements are set to zero, so the first rows for a bandmatrix with
       N=10,m1=2,m2=3 will look like this:
       
       [ 0      , 0      , A0(0,0), A0(1,0), A0(2,0), A0(3,0) ]
       [ 0      , A0(0,1), A0(1,1), A0(2,1), A0(3,1), A0(4,1) ]
       [ A0(0,2), A0(1,2), A0(2,2), A0(3,2), A0(4,2), A0(5,2) ]
       [ A0(1,3), A0(2,3), A0(3,3), A0(4,3), A0(5,3), A0(6,3) ]
            .        .        .        .        .      .
            .        .        .        .        .      .
       etc.  Last line would be

       [ A0(7,9), A0(8,9), A0(9,9), 0      , 0      , 0       ]
       
 MODIFICATION HISTORY:
       28-02-1993  PS (KIS), adapted from Numerical Recipes in C

(See /supple/soft/rsi/idl_5/lib/kis-lib/bandec.pro)


BANMUL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BANMUL
 PURPOSE:
	Multiply a vector with a compact stored bandmatrix
*CATEGORY:            @CAT-# 22@
       Mathematical Procedures :  matrix operations
 CALLING SEQUENCE:
	result = BANMUL( a, x, m1, m2)
 INPUTS:
	A   : Compact stored bandmatrix, see descriptipon of routine bandec
       X   : vector to be multiplied with A
       M1  : Number of subdiagonals of the bandmatrix
       M2  : Number of superdiagonals of the bandmatrix
 OUTPUTS:
 	RESULT: Result of the multiplication
 PROCEDURE:
 	See Press et al. Numerical Recipes - The art of scientific computing
 MODIFICATION HISTORY:
	28-02-1993  PS

(See /supple/soft/rsi/idl_5/lib/kis-lib/banmul.pro)


BISEC_ABS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BISEC_ABS
 PURPOSE:
       determines bi-sectors & central intensity of 
        **absorption** line profile. (Version using smooth spline)
*CATEGORY:            @CAT-# 31@
       Spectral Analysis
 CALLING SEQUENCE:
       BISEC_ABS,scan,dixc,wixc,xl,xr,ycont,ymin,xmin [,eqvw]
                 [,optional keyword-params]
 INPUTS:
       scan = 1-dim array, containing the absorption profile
               (intensities)
       dixc = scalar or 2-element vector: 
              1st (& 2nd) position(s) relat. to line center to determine 
              the continuum intensity:
              dixc(i) =  x_continuum(i) - x_line_center (pixel) (i=0 [,1]).
       wixc = scalar or 2-element vector: width (pixel) of interval(s) for
              averaging intensities (in scan) to determine the continuum-
              intensity; averaging is done over:
              x_line_center + dixc(i) +- wixc(i)/2 (i=0 [,1])
 OPTIONAL INPUT PARAMETER:
       IBISECT=intensvector :  bi-sectors shall be obtained at relative
              line intensities specified in vector intensvector; values must
              be increasing;
              the actual intensities will be:
              ymin(1)+(ycont(2)-ymin(1))*intensvector;
              if keyword not specified or with intensvector "empty": 
              procedure will set
              intensvector = [0.05,0.1,0.2,0.3,0.4,0.5,0.7,0.8]; this vector
              will be returned if IBISECT=intensvector was specified on call
              with an "empty" intensvector.
       XSPLINE=xsplin : vector containing positions (index-scale) of spline-
               nodes; if xsplin undefined or single value, spline nodes will
               be set by procedure (adjusted to line position).
       TENS=tens : "tension" used for smooth spline (default tens=5.).
       /PLOT : keyword . If set, the profile, its spline-interpolation
               and it's parameters as determined by this routine will
               be plotted.
 OUTPUTS:
       xl = "left" x-positions (real, fractional indices) where smoothed
               normalized profile assumes one of the "bisector"-intensites;
       xr   ditto for "right" x-position; 
       (xl,xr real vectors, same sizes as vector for bi-sector-intensities,
               see key-word IBISECT).
       ycont = vector (size=4);
               maximal & "continuum" intensities (intensity-scale same as 
               in SCAN):
               ycont(0) = maximal value in scan,
               ycont(1) = maximum of smooth spline,
               ycont(2) = "continuum" intensity value at minimum of smooth
                          spline xmin(1),
               ycont(3) = "continuum" intensity value at 1st position
                          defined by dixc(0).
       ymin  = vector (size=4); (intensity-scale same as in SCAN):
               ymin(0) = minimal intensity of SCAN
                   (1) = minimum of smooth spline,
                   (2) = minimum value of parabolic fit defining the
                         "line center";
                   (3) = value of smooth spline at "line center".
       xmin  = real vector (size=4) with x-positions corresponding to 
               ymin(0:3);
               xmin(0,1) integral index values,
               xmin(2,3) fractional index; xmin(3) = xmin(2)).
 OPTIONAL OUTPUTS:
       eqvw  = if this argument is provided on call, the equivalent width 
               of the profile will be calculated by integrating the profile
               depression from
               x_line_center + dixc(0) to x_line_center + dixc(1)
               or x_line_center +- dixc if dixc is a single value;
               the equivalent width is in units of (delta_lambda/pixel).
       IBISECT=intensvector  | if these variables were not specified on call,
       XSPLINE=xsplin        | the values set internally by the procedure
       TENS=tens             | will be returned.

 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       A plot will be produced if keyword PLOT was set.
 RESTRICTIONS:
       SCAN must contain a well defined absorption profile (both halves
       of profile without severe blending = blends with deeper minimum
       than the line itself).
 PROCEDURE:
       Linear interpolation of "continuum"-intensity from intensity-values
       around x1,2= dixc(0,1) +- wixc(0,1)/2 (constant if dixc single value);
       normalization of intensities stored in SCAN to continuum == 1;
       Interpolated of line profile by a smoothed spline (nodes as specified 
       in XSPLINE=xsplin or set by program (with finer steps around the
       significant part of the line);
       "continuum" intensities, intensities near line center, and "left" &
       "right" positions where spline intersects
       y = YMIN(1) + [ycritrel]*(YCONT(1)-YMIN(1)) will be determined.
       
 MODIFICATION HISTORY:
       nlte, 1990-03-13 (prof_shapesp)
       nlte, 1991-12-03 (new name BISEC_ABS)
       nlte, 1992-02-06 (bug if wixc 2-elements, equiv.-width, no rdcrs, 
                         indication "continuum positions" in plot)
       nlte, 1992-07-13 (simpson -> simps)

(See /supple/soft/rsi/idl_5/lib/kis-lib/bisec_abs.pro)


BISEC_ABS_LIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BISEC_ABS_LIN
 PURPOSE:
       determines  bi-sectors & central intensity of
        **absorption** line profile. 
       (Version using linear interpolation of scan)
*CATEGORY:            @CAT-# 31@
       Spectral Analysis
 CALLING SEQUENCE:
       BISEC_ABS_LIN,scan,dixc,wxc,xl,xr,ycont,ymin,xmin [,eqvw]
                 [,optional keyword-params]
 INPUTS:
       scan = 1-dim array, containing the absorption profile
               (intensities);
       dixc = scalar or 2-element vector: distance (pixel) line center - 
              1st (& 2nd) position(s) relat. to line center to determine 
              the continuum intensity:
              dixc(i) =  x_continuum(i) - x_line_center (pixel) (i=0 [,1]).
       wixc = scalar or 2-element vector: width (pixel) of interval(s) for
              averaging intensities (in scan) to determine the continuum-
              intensity; averaging is done over:
              x_line_center + dixc(i) +- wixc(i)/2 (i=0 [,1])
 OPTIONAL INPUT PARAMETER:
       IBISECT=intensvector :  bi-sectors shall be obtained at relative
              line intensities specified in vector intensvector; values must
              be increasing;
              the actual intensities will be:
              ymin(1)+(ycont(2)-ymin(1))*intensvector;
              if keyword not specified or with intensvector "empty": 
              procedure will set
              intensvector = [0.05,0.1,0.2,0.3,0.4,0.5,0.7,0.8]; this vector
              will be returned if IBISECT=intensvector was specified on call
              with an "empty" intensvector.
       /PLOT : keyword . If set, the profile, its spline-interpolation
               and it's parameters as determined by this routine will
               be plotted.
 OUTPUTS:
       xl = "left" x-positions (real, fractional indices) where
                normalized profile assumes one of specified intensity-values; 
       xr   ditto for "right" x-position;
       (xl,xr real vectors  same sizes as vector for bi-sector-intensities,
               see key-word IBISECT).
       ycont = vector (size=4) 
               maximal & "continuum" intensities (intensity-scale same as 
               in SCAN):
               ycont(0) = maximal value in scan,
               ycont(1) = "continuum" intensity value at 1st position
                          defined by dixc(0),
               ycont(2) = "continuum" intensity value at minimum of profile,
               ycont(3) = "continuum" intensity value at 2nd position
                          defined by dixc(1) 
                          (== ycont(1) if only 1 "continuum-position" 
                          specified.
       ymin  = vector (size=2); 
               ymin(0) = minimal intensity of SCAN,
                   (1) = minimum value of parabolic fit defining the
                         "line center";
              
       xmin  = vector (size=2) with x-positions corresponding to 
                   ymin(0:1) (real, fractional index).

       ycritrel = vector (size=19) of relative intensities used for
                       bi-sector determination.
 OPTIONAL OUTPUTS:
       eqvw  = if this argument is provided on call, the equivalent width 
               of the profile will be calculated by integrating the profile
               depression from
               x_line_center + dixc(0) to x_line_center + dixc(1)
               or x_line_center +- dixc if dixc is a single value;
               the equivalent width is in units of (delta_lambda/pixel).
       IBISECT=intensvector  if  variable  was not specified
               on call, the values set internally by the procedure will be
               returned.

 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       A plot will be produced if keyword PLOT was set.
 RESTRICTIONS:
       SCAN must contain a well defined absorption profile (both halves
       of profile without severe blending = blends with deeper minimum
       than the line itself).
 PROCEDURE:
       "continuum" intensity (YCONT), intensities near line center
       (YMIN=SCAN(XMIN)), and positions where scan (linearely interpolated) 
       intersects y = YMIN + [ycritrel]*(YCONT-YMIN) will be determined.
       
 MODIFICATION HISTORY:
       nlte, 1990-03-13 
       nlte, 1990-03-21  (spline-version -> non-spline version,
                          doppler shifted ycont)
       nlte, 1990-03-27  (bug interpolation xl)
       nlte, 1991-12-03  (input/output like spline-version,
                           new name BISEC_ABS_LIN)
       nlte, 1992-02-06  (bug if wixc 2-elements, equiv.-width, no rdcrs, 
                         indication "continuum positions" in plot)
       nlte, 1992-07-13  (simpson -> simps)

(See /supple/soft/rsi/idl_5/lib/kis-lib/bisec_abs_lin.pro)


BLNK2ULIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	BLNK2ULIN
 PURPOSE:
	Converts all blanks within character-string strein to _
*CATEGORY:            @CAT-# 35@
	String Processing Routines
 CALLING SEQUENCE:
	out_string = BLNK2ULIN(input_string)
 INPUTS:
	input_string : string to be converted.
 OUTPUTS:
	converted string.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	none
 PROCEDURE:
	straight
 MODIFICATION HISTORY:
	nlte, 1990-03-17
	nlte, 1992-05-06 : on_error,1 

(See /supple/soft/rsi/idl_5/lib/kis-lib/blnk2ulin.pro)


BREAKFILE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       BREAKFILE
 PURPOSE:
       Breaks file name(s) into components.
*CATEGORY:            @CAT-# 42 28@
       Files , Programming
 CALLING SEQUENCE:
       BREAKFILE, path_filename
 INPUTS:
       path_filename : input,string(-array) file name(s), 
             may be prepended by a path, may be appenden by ., 
             e.g.: ~/qwert.old/asdf/here_we.are.007.fits
               or: /dat/poofy_9/ich/here_we.are.007.fits
            
OUTPUTS:
       none  (all output via keyword parameters)
 KEYWORD PARAMETERS:
       Keywords:
         DIRECTORY=d  returned directory name (path) (ending with "/"); 
                      if path starts with:  d will start with:
                         ~/AAA/             <$HOME>/AAA/
                         ~user/AAA/         /AAA/
                         ./AAA/             /AAA/
                         AAA/               /AAA/
                      where <...> will be the full path-string.

         FILE=f       returned complete file name (without directory path).
         NAME=n       returned file name without extension.
         EXTENSION=e  returned file extension (everything following first "."
                      in filename).

         Requested values that do not occur in path_filename are returned as
         null strings.
         The following diagram show relations between components:
       
        . . . A A A / N N N N N N . E E E E 
       
       |    DIR      |   NAME    | |  EXT  |
       +-------------+-----------+ +-------+
       |             |           FILE      |
       |             +---------------------+
       |           INPUT                   |
       +-----------------------------------+
  
 EXAMPLES:
       Let /home/ich be the home-dir of user and /home/ich/curry/wurst
       the current working directory; then:

       path_filename='~/qwert.old/asdf/here_we.are.007.fits'
          -> d='/home/ich/qwert.old/asdf/' , f='here_we_are.007.fits',
             n='here_we_are' , e='007.fits'
       path_filename='catchup/here_we_are.007.fits'
          -> d='/home/ich/curry/wurst/catchup/', f='here_we_are.007.fits',  
             n='here_we_are' , e='007.fits'
       path_filename='/dat/poofy_9/ich/here_we_are.007.fits'
          -> d='/dat/poofy_9/ich/' f='here_we_are.007.fits'
             n='here_we_are' , e='007.fits'
 COMMON BLOCKS:
       none
 MODIFICATION HISTORY:
       Ray Sterner,  16 APR, 1985: FILEBREAK (JHU_APL distribution).
       Johns Hopkins University Applied Physics Laboratory.
       RES, Added DIR 29 May, 1985.
       R. Sterner, made op. sys. independent --- 11 Sep, 1991.
  1995-Mar-20 nlte, KIS: adapted for unix only; renamed from FILEBREAK to
       BREAKFILE;

 Copyright (C) 1985, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See /supple/soft/rsi/idl_5/lib/kis-lib/breakfile.pro)


CBAR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CBAR
 PURPOSE:
	Creates a rectangle with values increasing linearly from zmin to zmax
	in 1st dimension + some margin + optional tick marks; may serve to
	show correlation between z-values and colors/grey-scales.
*CATEGORY:            @CAT-# 15@
	Image Display
 CALLING SEQUENCE:
	array = CBAR ( zmin,zmax ...
	        ... [,NCOL=ncol] [,HEIGHT=h] [,MARGIN=margin] [,TICK=ntick] )
 INPUTS:
	zmin, xmax : range of values to be generated.
 OPTIONAL INPUT PARAMETER:
	NCOL=ncol : number of "color"-columns = number of z-values = length of
		    rectangle (without margin); default: ncol=256 .
       HEIGHT=h  : size of rectangle (rows) (without margin & ticks); 
		    default: h=15 .
	MARGIN=margin : size of margin surrounding the "color-strip";
	            default: margin=5 (no margin if MARGIN=0).
       TICK=ntick : number of tick marks below the "color-strip";
	            default: no tick marks;
 OUTPUTS:
	2-dim array; size 1st dim: ncol+2*margin; 
	                  2nd dim: h+2*margin + more space for ticks if necess.
	             data type same as zmin, zmax.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	
 RESTRICTIONS:
	
 PROCEDURE:
	straight
 MODIFICATION HISTORY:
	nlte, 1992-Sep-24 

(See /supple/soft/rsi/idl_5/lib/kis-lib/cbar.pro)


CDL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CDL
 PURPOSE:
       Change current working directory and list it's content (ls -FA).
*CATEGORY:            @CAT-# 40 28@
       Operating System Access , Programming
 CALLING SEQUENCE:
       CDL [,directory]
 INPUTS:
       none
 OPTIONAL INPUT PARAMETERS:
       directory : string, directory to be made current working directory;
                   if a "null"-string (cdl,''), the home directory
                   will become current; if omitted, the working directory
                   will not be changed.
 KEYWORD PARAMETERS:
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
       changes current working directory (if so specified);
       prints contents of new directory to standard-out (ls -Fa)
       and the directory-name incl. it's full path.
 RESTRICTIONS:
 PROCEDURE:
       calls CD (IDL ROUTINES), spawns UNIX command "ls -FA", 
       calls PRINTD (IDL USERLIB).
 MODIFICATION HISTORY:
       1993-Mar-12 nlte (KIS) created.

(See /supple/soft/rsi/idl_5/lib/kis-lib/cdl.pro)


CENT_LINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CENT_LINE
 PURPOSE:
        x-positions (wavelength-direction) and intensities of center of
        ABSORPTION-LINE along slit positions ("y"-direction).
*CATEGORY:            @CAT-# 31@
       Spectral Analysis
 CALLING SEQUENCE:
      CENT_LINE,img,xcent [,intcent] [,ROWS=yvect] [,WDIR=i]
              [,XRANGE=range] [,YRANGE=range] [,STEP=increment] [,AVRY=width] 
              [,NXFIT=nxfit] [,DEGFIT=degree]
 INPUTS:
      IMG     = 1-dim tracing of absorption line 
                or 2-dim image-array containing an absorption line.
 OPTIONAL INPUT PARAMETERS:
      ROWS=yvect  = 1-dim integer vector containing indices of image-rows
                (direction "y" along slit) for which line -center and
                -intensity shall be determined;
                !!! Will be OVER-RULED by specifying YRANGE and/or STEP !
                !!! Must be a variable, NOT a constant!
      WDIR= 1 or 2    the wavelength-direction ("x") is the 1st or 2nd
                dimension of array IMG; 
                default: WDIR=1 (WDIR=2 only meaningful if IMG is 
                2-dimensional).
      XRANGE=[start,end]  only data within specified index-range will be
                      used along wavelength-(x)-dimension of IMG-array;
                      0 <= start < end <= nx-1 (nx: size of IMG x-dir.);
                      default: start=0, end=nx-1 .
      YRANGE=[start,end]  only data within specified index-range will be
                       used along slit-(y)-dimension of IMG-array;
                       0 <= start < end <= ny-1 (ny: size of IMG y-dir.);
                       only meaningful if IMG is 2-dimensional;
                       !!! Specifying YRANGE will OVER-RULE any setting in
                       !!! optional input parameter Y !
                       Default: start=0, end=ny-1 .
      STEP=increment   profile tracings will be taken at equidistant 
                       steps along slit-(y)-positions with increment as
                       specified; only meaningful if IMG is 2-dimensional;
                       !!! Specifying STEP will OVER-RULE any setting in
                       !!! optional input parameter Y !
                       Default (if IMG is 2-dim): increment=5.
      AVRY=width      profile tracing at slit-(y)-position y will be 
                      obtained by averaging from y-width to y+width;
                      only meaningful if IMG is 2-dimensional; 
                      default (if IMG is 2-dim): width=4.
      NXFIT=nx        use nx points around "approximate" line center to fit
                      a polynom to determine "accurate" line center position;
                      default: all points where depression of smoothed
                      line profile is > 4/5 of maximal depression (at least
                      11 points).
      DEGFIT=degree   degree of polynom for fitting profile around line- 
                      center (recommended to be even);
                      default: degree = 2).      

 OUTPUTS:
      XCENT   = real vector of x-positions (fractional indices) of line center
                along y-direction (= position of minimum of fit-polynom); 
                if, for the k-th y-position, the fitted polynom has no minimum
                within it's fit-intervall, xcent(k) = -1.
 OPTIONAL OUTPUTS:
      INTCENT = real vector of line center intensities along y-direction 
                (= minimum of fit-polynom); intcent(k) = -1. if no minimum
                was found for the k-th y-position.
      ROWS=yvect  = integer vector of y-positions (integral indices of image 
                columns) at which profile tracings have been obtained.

      If IMG is a 1-dim tracing, XCENT, INTCENT will be scalars and Y = 0 .

 COMMON BLOCKS:
       none
 RESTRICTIONS:
       IMG should store a well defined absorption line within the specified
       x-range (no blends with deeper depression).
 PROCEDURE:
       If IMG is 2-dimensional, at each of requested slit positions yvect(k)
       (k=0,1,...) a line profile will be obtained by averaging from
       yvect(k)-width to yvect(k)+width;
       in all cases, an "approximate" line center is determined by the
       minimum of a running-box-mean of the profile; a polynom is then
       fitted to the (unsmoothed) profile points around the "approximate" 
       line center; the minimum of the polynom defines XCENT and INTCENT.
 MODIFICATION HISTORY:
       nlte, 1989-08-29 : xmin=minimum of smooth spline (integral value!).
       nlte, 1990-03-17 : minor modifications.
       nlte, 1991-12-03 : no spline but polynom around minimum of running mean
                          of profile;
                          1- & 2-dim case, optional input parameters.
       nlte, 1992-01-29 : minor update

(See /supple/soft/rsi/idl_5/lib/kis-lib/cent_line.pro)


CGS OR CGSD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CGS or CGSD
 PURPOSE:
	Returns value of a requested physical constant in cgs- (cm,g,s,esu) 
       units or displays a list of all stored constants together with their 
       key-words. CGS (CGSD) returns value in single (double) precision 
       format. This is a "wrapper" for PHYS_CONST.
       See also "wrappers" MKS(D), which return the SI-values of constants.
 CATEGORY:            @CAT-# 23@
	Misc.
 CALLING SEQUENCE:
	value = CGS ( key ) ; returns single precision value for the constant 
                             defined by .
       value = CGSD( key ) ; ditto for double precision value (although most 
                             constants don't have this accuracy).
       dummy = CGS ( )     ; outputs a list with all available constants with
                             all significant decimals (0.0 will be returned).
       dummy = CGSD( )     ; same as dummy=CGS().
 INPUTS:
	key:  string, the key-word for requested constant. Case-sensitive!
	      'help', 'list', '?', ' ' or no argument: a list of the available
             constants (key, meaning, value, units) will be displayed (and
             value zero returned).
 OUTPUTS:
	value: the cgs-value of requested constant. If key is unknown or if 
              the list of all constants was requested, zero will be returned.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	A list is written to standard out, if so requested.
 RESTRICTIONS:
	
 PROCEDURE:
	Calls PHYS_CONST with keyword /CGS
 MODIFICATION HISTORY:
	nlte, 1995-Aug-09

(See /supple/soft/rsi/idl_5/lib/kis-lib/cgs.pro)


CIRC_FIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CIRC_FIT
 PURPOSE:
	Least square fit of a circle; returns the radius and the coordinates 
       of the center of a circle which best fits the given points.
 CATEGORY:            @CAT-#  5
	Fitting Curves
 CALLING SEQUENCE:
	result = CIRC_FIT ( x,y [,w] [,STARTXYR=xyr] [,/PLOT] [,/VERBOSE] )
 INPUTS:
	x    : vector of x-coordinates of points to be fitted
       y    : vector of y-coordinates of points to be fitted
              vectors x,y must have the same length of at least 4.
 OPTIONAL INPUT PARAMETER:
	w    : vector of weights, same length as x,y. Default: w == 1. 
       STARTXYR = [xcenter, ycenter, radius] : start values for fit.
              If not specified: the 1st, middle, and last fit-point
              will be used to compute radius and center ofthe circle
              through these 3 points, calling IDL-lib routine CIR_3PNT.
       /PLOT: Plot of the x,y-points and the fitted circle.
       /VERBOSE: output of results to standard out.
 OUTPUTS:
	result : real vector size 9:
              (0:1) : xcenter , rms
              (2:3) : ycenter , rms
              (4:5) : radius , rms
              (6:7) : distance center to fit-points , rms
              (8)   : number of points used for the fit (weight > 0)
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	Plot and/or output to standard out if /PLOT and/or /VERBOSE is set.
 RESTRICTIONS:
	
 PROCEDURE:
	Cartesian coordinates x,y converted to polar coordinates r,phi.
       Non-linear fit of r(phi) using CURFIT from the "other_contribs" lib 
       of IDL distribution. (The equivalent IDL-lib routine CURVEFIT is 
       sometimes trapped in an infinite loop!)
 MODIFICATION HISTORY:
	nlte, 1996-06-27 

(See /supple/soft/rsi/idl_5/lib/kis-lib/circ_fit.pro)


COHER_PHASE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       coher_phase
 PURPOSE:
       Determination of power spectra,coherence and phase differences 
       of two time series.
*CATEGORY:            @CAT-#  4 16 33@
       Power Spectra , Image Processing , Statistics
 CALLING SEQUENCE:
       COHER_PHASE, dat1,dat2,mrun,pow1,pow2,coher,phi
 INPUT:   
       dat1    = 1- or 2-dim. array with first time series
       dat2    = 1- or 2-dim. array with second time series
               (for both: first index is temporal dimension)
       mrun  = half width of window for running means 
               (will be set to 1 internally if mrun < 1 was set by user)
 OUTPUT:
       POW1  = first power spectrum
       POW2  = second power spectrum 
       COHER = Array with coherence values
       PHI   = Array with phase differences
               (for both: first index is frequency dimension,
                length is n/2+1 of temporal dimension.) 
 REMARKS:
       A COSWIND window is applied to the data and a linear trend
       is subtracted. 
       All power spectra are smoothed by a running mean of +- MRUN 
       power points.
       Procedure will be stopped if sizes of input arrays do not agree.
 RESTRICTIONS:
       Input arrays must have identical size for both dimensions;
       the time-scale MUST be identical AND EQUIDISTANT for both data sets,
       spatial scale (in case of 2-dim. data sets) should be identical
	but need not neccessarily be equidistant.
       If these conditions are not satisfied by the original data sets,
       the data must be interpolated onto common scales BEFORE applying
       this routine. E.g., use 
        INTERP_T,tobs_i,jgood_i,datobs_i, tstart,dt,tend, dat_i [,spline=tens]
       (i="1","2") to interpolate the 2 data sets (which may be 
       non equidistant and/or have "bad" data points) onto a common t-scale
       defined by starting-, step-, & end-values tstart,dt,tend.
 PROCEDURE:
       Procedure follows Edmonds & Webb, Solar Phys. 22, 276 (1972).
       Calls POLY_FIT from IDL USER-LIB and RUN_AV1,2 from KIS_LIB.      
 MODIFICATION HISTORY:
   HOBA (KIS)  March 1992
   nlte (KIS)  Dec 1994: 1-dim case included; assume mrun=1 if called with
                         mrun < 1; faster code due by vector expressions

(See /supple/soft/rsi/idl_5/lib/kis-lib/coher_phase.pro)


COL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	COL
 PURPOSE:
	Returns color-table index for requested "special" color (one
	of the colors stored into the current c.t. by KIS_LIB procedures
	COLOR or COLSTO ).
 CATEGORY:            @CAT-# 17@
	Color Tables
 CALLING SEQUENCE:
	index = COL ( {color-name | color-no.} )
 INPUTS:
	argument : string with the name of the requested "special" color.
	           If no special colors are stored yet, COL will load
                  some standard-colors, incl. the requested one, into
                  color-table locations 2 ff (call COLSTO,/LI to get a 
                  list of all currently stored "special colors").
	           Only if "special colors" are already loaded, the sequence-
                  no. in the list of stored special colors can be sent
                  alternatively to the color-name.
 OUTPUTS:
	returns the index within the color table where the requested
	color has been stored; returns 0 if color is unknown.
	
 EXAMPLE: 
       Suppose, the 4 colors blue(0) green(1) yellow(2) red(3) are
       stored at c.t.-entries  2       3        4        5
       (this can be achieved by COLSTO,/FOUR or will be done by COL
        if no "special" color has been stored yet.)
    
       oplot,x,y,col=col('red')  or:  oplot,x,y,col=col(3)
 
       will produce a red curve (also: oplot,x,y,col=5 , since this color is
       stored at this c.t.-location).

 COMMON BLOCKS:
	common COLSTO_COM, colnams,colsindx  ; names and c.t.-locations of
	                                       stored colors.
 SIDE EFFECTS:
	
 RESTRICTIONS:
	
 PROCEDURE:
	Calls KIS_LIB procedure COLSTO,... if no "special" colors
	are stored yet.
       If argument is a color-name: searches string-array colnams 
           (common COLSTO_COM) for requested color and returns its
           c.t.-location (stored in colsindx) .
       If argument is a number: returns colsindx(argument) as c.t.-location.

 MODIFICATION HISTORY:
	nlte, 1996-03-18 

(See /supple/soft/rsi/idl_5/lib/kis-lib/col.pro)


COLOR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COLOR
 PURPOSE:
       Set a " special" color in the color table by specifying color name.
 CATEGORY:            @CAT-# 17@
	Color Tables
 CALLING SEQUENCE:
       color, name, [index, r, g, b] [,keyword-params]
 INPUTS:
       name = color name (like red, green, ...).           in
         Name may be modified by the words dark, pale,
         very dark, very pale.
         (Only one very is handled).  Default color=white.
       index = color table index for new color (def=last). in
       r, g, b = components of color table to modify.      in,out
         If r,g,b sent then table is not loaded.
 KEYWORD PARAMETERS:
       Keywords:
         FILE=f  color file to use instead of the default.
           Must be saved using save2,/xdr
         /LEARN prompts for r,g,b values of an unknown color.
         /LIST lists all available colors; user may select a color & index.
         /SHOW displays all available colors together with color number
           number and name in a separate window. Useful for color windows
           only; under X-windows, user may select a color & index.
         MAXNUMBER=mx  return number of colors known.
         NUMBER=n  Select color by color number (0 to MAXNUMBER-1).
           Index # 255 is set by default.  To set a different index
           a dummy color name must also be given.  It is ignored.
           Ex: color,'dum',50,number=7  sets index 50 to color 7.
           If no args are given default color and index used.
         NAME = nam  return name of selected color.
           Useful with NUMBER keyword.
         TEXT=txt  returns 0 or 255, whichever best with color.
         RED=r.  Return red value for specified color.
         GREEN=g.  Return green value for specified color.
         BLUE=b.  Return blue value for specified color.
         /RESET restores the original colors of the current color table.
         /EXIT exit without modifying screen color table.
         /QUIET do not report the stored colors on exit.
 OUTPUTS:
 COMMON BLOCKS:
       common COLORS  the IDL color common block
       common COLOR_COM flag, cc, rr, gg, bb  ; all known JHUAPL-colors
       common COLSTO_COM, colnams,colsindx
                          names,  c.t.-indices, for the colors stored into
                          the current  c.t.;
                          empty or colsindx=-1: no colors loaded yet.

 NOTES:
 MODIFICATION HISTORY:
       R. Sterner, 26 Dec 1989
       R. Sterner, 7 Jun, 1990 --- polished for vms.
       R. Sterner, 4 Feb, 1991 ---- made system independent.
       H. Schleicher (KIS), 18 Mar, 1996 --- local adaption, option /show 

 Copyright (C) 1989, Johns Hopkins University/Applied Physics Laboratory
 This software may be used, copied, or redistributed as long as it is not
 sold and this copyright notice is reproduced on each copy made.  This
 routine is provided as is without any express or implied warranties
 whatsoever.  Other limitations apply as described in the file disclaimer.txt.

(See /supple/soft/rsi/idl_5/lib/kis-lib/color.pro)


COLSTO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	COLSTO
 PURPOSE:
	Stores (some) colors provided by KIS_LIB-routine COLOR into
       current color table (modifies this c.t.)
 CATEGORY:            @CAT-# 17@
	Color Tables
 CALLING SEQUENCE:
	COLSTO [,start] [,incr] [,NAME=color-names] [,/FOUR] [,/EIGHT] ...
              ... [,/ALL] [,/RESET] [,/LIST]
 INPUTS:
	
 OPTIONAL INPUT PARAMETER:
	start  : location (index) within the current color table where to
	         store the first of the selected colors; 
                default: if incr > 0: 2 or (highest used location)+incr ;
                if incr < 0: !d.table_size-2 or (lowest used location)+incr.
       incr   : increment for index; default: 1 .
       NAME=color-names : string-array of requested color names known to
                routine COLOR. These colors will be stored into the
                current color table, starting at c.t.-index 
                (over-writing previous r,g,b-values at these locations).
                If not specified and none of keywords /FOUR, /EIGHT, /ALL
                is set, a separate window with all available colors will be
                displayed (if device = 'X') and the user is prompted to 
                select colors.
       /FOUR :  The four colors 'blue','green','yellow','red' will be stored
                (ignored if NAME=color-names is specified).
       /EIGHT : the eight colors 'violet','blue','cyan','green','yellow',
                'orange','red','magenta'  will be stored
                (ignored if NAME=color-names or /FOUR is specified).
       /ALL :   All 67 colors known by COLOR will be stored
                (ignored if NAME=color-names or /FOUR or /EIGHT is
                specified.)
       /RESET :  restores the original colors of the current color table.
       /LIST :  Prints all stored colors (c.t.-index, color-name). No further
                action unless NAME=color-names or /FOUR or /EIGHT is 
                specified. To get an overview of all known "special colors",
                call COLOR,/SHOW [,/EXIT] or COLOR,/LIST [,/EXIT]
                (/EXIT pevents prompts for a new color to be
                stored). 
       /QUIET : No messages printed beside errors.
 Outputs:
	none
 EXAMPLES:
       LCT,16,/over  ; loads IDL color-table 16 ("HAZE"), overwriting any
                       previously stored "special colors".

       COLSTO,/FOUR  ; stores into current c.t.: blue green yellow red
                               at c.t.-locations   2    3     4     5

       plot,x,y,col=COL('green') ; a plot with green color will be produced
                                   (the KIS_LIB fct. COL returns the c.t.-
                                   location of the requested color, here: 4).

       LCT,34        ; new color table ("RAINBOW"); /over was not set, so
                       at c.t.-locations 2,3,4,5 there ares still the
                       "special" colors blue green yellow red !

       COLSTO,30,10,/eight  ; additionally, store the eight colors
                       violet blue cyan green yellow orange red magenta
      at c.t.-locations  30    40   50   60    70      80   90   100

       tvscl,dist(512)  produces a color image with contour effect.

       COLSTO,/LIST  will now print (without c.t.-modification):
         stored colors: [ c.t.-index: color-name(altern. number for COL), ]
         2: blue(0), 3: green(1), 4: yellow(2), 5: red(3), 30: violet(4), 
        40: blue(5), 50: cyan(6), 60: green(7), 70: yellow(8), 80: orange(9),
        90: red(10), 100: magenta(11),

       In calls to COL, one of the numbers enlosed in () of above list
       can alternatively be used for referencing a color, so in this example
         oplot,x,y,col=col('yellow') or oplot,x,y,col=col(2) or
         oplot,x,y,col=col(8) or oplot,x,y,col=4 or oplot,x,y,col=70
       will all produce a yellow curve (note that yellow is now stored twice
       in the c.t. at c.t.-locations 4 and 70).
       
 COMMON BLOCKS:
	COMMON COLSTO_COM, colnams,colsindx
                colnams: string-array with loaded color names,
                colsindx: index-vector of color table where colors have been 
                         stored.
 SIDE EFFECTS:
	Current color table is modified which may effect active
	graphic windows.
 RESTRICTIONS:
	The stored colors will be overwritten when loading a new color table
       (LOADCT, XLOADCT, ...) without giving notice to COLOR, COLSTO or COL !
        KIS_LIB routine LCT,n loads a new c.t. and restores all "special" 
       colors. LCT,n,/OVER will inform obove routines that no "special" colors
       are stored now.
  
 PROCEDURE:
	Calls KIS_LIB routine COLOR.PRO (which is a modified routine from 
       JHUAPL).
 MODIFICATION HISTORY:
	nlte, 1996-03-16 

(See /supple/soft/rsi/idl_5/lib/kis-lib/colsto.pro)


COMPRESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COMPRESS
 PURPOSE:
       compresses (FITS-)files (16 bit images). 
       (use KIS_LIB-procedure UNCOMPRESS to un-compress a compressed file.)
*CATEGORY:            @CAT-# 11 37@
       FITS-Files , Tools
 CALLING SEQUENCE:
       COMPRESS,filename [,HOST=remote_host] [,/OPTIONS=opt_string]
 INPUTS:
       filename: (string) name of (FITS-)file(s) to be compressed;
                 if filename contains "wild characters", all matching files 
                 will be compressed except those which end on ".CF" .
                 ".CF" will be appended to the name of each compressed file,
                 overwriting any existing file of this name. The original
                 files will be removed.
 OPTIONAL INPUT PARAMETER:
       HOST=remote_host : (string) if set, the compressing program (COMPFITS)
                 will be executed remotely on host  to avoid 
                 net file transport.
       OPTIONS=opt_string : options passed to compressing program COMPFITS,
                 see man-pages of COMPFITS for details. Option -c will 
                 be passed in any case; do **not** specify -q (quiet mode)
                 Example:
                 OPTIONS='-nvw -N 5' : n indicates non-Fits-file, v "verbose",
                                       w print "entropy" for each bit plane,
                                       -N 5 use 5 as "partition value".
                 Default: COMPFITS is called with -c(n) -F 
                 -n is omitted if filename contains '.fits.' or ends on 
                 '.fits';
                 ("partition value" is selected by COMPFITS using internal
                 default parameters.)
 OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       messages from COMPFITS 
 RESTRICTIONS:
       see man pages for COMPFITS
 PROCEDURE:
       For each matched filename not ending on .CF :
       spawns compfits -c -F  [opt_string] ;
       checks compfits-messages for string 'Compressed'; if found, the
       original file(s) will be removed assuming that COMPFITS-action
       was successful.
 MODIFICATION HISTORY:
       nlte (KIS), 1992-04-27

(See /supple/soft/rsi/idl_5/lib/kis-lib/compress.pro)


COR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       COR
 PURPOSE:
       Correlation of 2 1-dim tracings.
*CATEGORY:            @CAT-#  4 16@
       Correlation Analysis , Image Processing
 CALLING SEQUENCE:
       c = COR(a,b,m [,/PR])
 INPUTS:
       a = 1-dim vector containing "reference" tracing;
       b = 1-dim vector containing tracing to be correlated with reference;
       m = shift b relative to a by -m to +m positions; 2*m+1 corre-
               lation coefficients will be computed.
 OUTPUTS:
       Vector of 2*m+1 correlation coefficients.
 OPTIONAL OUTPUTS:
       If keyword /PR set:
       Print output of correlation coef's together with sub-vector
       boundaries for input vectors a,b.
 SIDE EFFECTS:
       error message if invalid arguments
 RESTRICTIONS:
       Size of a may not be smaller than size of b.
 PROCEDURE:
       Subsequent calls to IDL procedure CORRELATE.
 MODIFICATION HISTORY:
       nlte, 1989-Nov-09
       nlte, 1990-Oct-26 (error message if a or b not a 1-dim vector) 

(See /supple/soft/rsi/idl_5/lib/kis-lib/cor.pro)


COR2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	COR2
 PURPOSE:
	Correlation of 2 2-dim arrays.
*CATEGORY:            @CAT-#  4 16@
	Correlation Analysis , Image Processing
 CALLING SEQUENCE:
	c = COR2(a,b,m [,/PR])
 INPUTS:
	a = 2-dim array containing "reference" image;
	b = 2-dim varray containing tracing to be correlated with 
	    reference;
	m = integer-vector size=2: shift b relative to a by
	    -m(0) to +m(0) positions in 1st dimension and
	    -m(1) to +m(1)  positions in 2nd dimension.
           (2*m(0)+1)*(2*m(1)+1) correlation coefficients will 
	    be computed.
 OUTPUTS:
	2-dim array of (2*m(0)+1)*(2*m(1)+1) correlation-
	coefficients.
 OPTIONAL OUTPUTS:
	If keyword /PR set:
       Print output of correlation coef's together with sub-array
	boundaries for input arrays a,b.
 SIDE EFFECTS:
	error message if invalid arguments
 RESTRICTIONS:
	Size of a may not be smaller than size of b.
 PROCEDURE:
	Subsequent calls to IDL procedure CORRELATE.
 MODIFICATION HISTORY:
	nlte, 1990-Oct-26

(See /supple/soft/rsi/idl_5/lib/kis-lib/cor2.pro)


CORY_AB_XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       CORY_AB_XY
 PURPOSE:
       Correlates each y-row yb of b(xb,yb) vs. each row ya of a(xa,ya)
       and determines the a-row which correlates best with b(x=xa,yb).
       x-scale of "b" can be be interpolated on x-scale of "a" before 
       performing the correlation. NO SHIFTING! (SHFTCORX_AB_XY in KIS_LIB
       shifts along x and correlates corresponding rows of a and b).
*CATEGORY:            @CAT-# 16  4@
       Image Processing , Correlation Analysis
 CALLING SEQUENCE:
       CORY_AB_XY,xa,a ,xb,b ,cm [,keyword parameters]
 INPUTS:
       xa : 1-dim vector x-scale "a".
       a  : 2-dim array with a(x,y) data ("reference")
              (size 1st dim must be == size of xa).
       xb, b : ditto for "b"-data. 
 OPTIONAL INPUT PARAMETER:
       TREND = deg : subtract trend (fit-polynom degree=deg) for each row
               before doing the correlation (default: no trend subtraction).
       /INTERPOLATE : interpolate b(xb,y) in x on x-scale of "a". This is
               neccessary if xb differs from xa. If "a" and "b" have identical
               x-scales, interpolation need not to be done; in this case,
               xa & xb must formally be specified (contents is not relevant).
       SPLINE = tens : x-interpolation is done with SPLINE (IDL-USERLIB, 
               SLOW!!) with tension factor tens; if not set (or tens <=0.) do
               tension factor tens; if not set (or tens <=0.) do linear
               interpolation; meaningless if INTERPOLATE not set.
       /VERBOSE: printing to standard out
 OUTPUTS:
       cm   : 2-dim array (ny_b,4); for each b-row j:
              cm(j,0)= maximal correlation value found;
              cm(j,1)= index of a-row which correlates best with b-row j;
              cm(j,[2,3])= index of a-rows where correlation drops to half
                       of maximal correlation;
 OPTIONAL OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       prints to standard out: j, cm(j,*)
 RESTRICTIONS:
       
 PROCEDURE:
       If requested: Linear or spline-interpolation of b(x,j) onto xa-scale
       (LININT from KIS_LIB or SPLINE from IDL-USERLIB); 
       trend subtraction for both data sets by fitting a polynom (separately
       for each row) using IDL-USERLIB routine POLY_FIT;
       calling IDL-USERLIB routine CORRELATE.
 MODIFICATION HISTORY:
       nlte, 1990-03-19 (COR_VTT_GREG)
       nlte, 1993-09-24 renamed to CORY_AB_XY; new coding; documentation.
       nlte, 1994-12-15 faster linear interpolation with LININT (KIS_LIB).

(See /supple/soft/rsi/idl_5/lib/kis-lib/cory_ab_xy.pro)


DEHAIR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DEHAIR
 PURPOSE:
       Removes slit hairs from image (2-dim spectrum).
*CATEGORY:            @CAT-# 16  6@
       Image Processing , Data Editing
 CALLING SEQUENCE:
       img_clean = DEHAIR(img,y_hair [,optional parameters])
 INPUTS:
       img = 2-dim array containing spectrum with hair(s);
       y_hair = vector with approximate slit-positions (image row numbers) of
                hair location(s).
 OPTIONAL INPUTS:
       BADLEFT=n : avoid 1st  image columns for localization of hair;
       BADRIGHT=n : avoid last  image columns for localization of hair;
       BADBOTTOM=n : avoid 1st  image rows for localization of hair;
       BADTOP=n : avoid last  image rows for localization of hair;
             defaults: take full image for localization of hair.
       WIDTH=wsearch: width of "hair search intervall" in y-direction (pixel);
                    default: 40
 OUTPUTS:
       Image with hairs "removed".
 RESTRICTIONS:
       A hair should be well positioned within "search strip" around 
       approximate position specified in vector y_hair and should deviate by
       more than 1 sigma from line-averaged run of intensity within this
       search strip.
       See begin of code for actual specifications of ixa,ixe,iya,iye,wsearch.
 SIDE EFFECTS:
       -1. will be returned if input is invalid. 
 PROCEDURE:
       for the k-th hair-position specified in y_hair(k):
       1. s(y) = average run of intensity along slit direction (avoiding 
          points near boundaries) within "search intervall" (width in y-dir.:
          wsearch) around approx. hair position y_hair(k);
       2. central hair position = minimum position in s(y);
       3. find those image rows iy* where s(iy*) gt -sigma (after an 
          additional iteration) = "non-hair lines";
       4. replace img(ix,[search-strip]) by linear least square fit of
          img(ix,[iy*]).
 MODIFICATION HISTORY:
       nlte, 1998-??-?? 
       nlte, 1990-03-19: specification wsearch and boundary at begin of code.
       nlte, 1992-02-10: bad margins, search-width : optional keyword-input,
                         bug: replacement-loop in x-dir was restricted to 319.

(See /supple/soft/rsi/idl_5/lib/kis-lib/dehair.pro)


DF_AV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DF_AV
 PURPOSE:
       Mean gradient in scan.
*CATEGORY:            @CAT-#  0  9 30@
       Array Manipulation Routines , Differentiation , Smoothing 
 CALLING SEQUENCE:
       grad = DF_AV(scan,n)
 INPUTS:
       scan = 1-dim tracing (e.g. of intensity);
       n = **half** size of running average window (pixel).
 OUTPUTS:
       grad = vector containing smooth gradient of scan (same size
               as scan).
 PROCEDURE:
       Linear least square fit of scan(i-n : i+n) for each i,
       grad(i) = gradient of fit; 1st n points are set == grad(n),
       last n points are set == grad(max -n).
 MODIFICATION HISTORY:
       nlte, 1989-08-16 

(See /supple/soft/rsi/idl_5/lib/kis-lib/df_av.pro)


DOCLIB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DOCLIB
 PURPOSE:
       Extract the documentation template of one or more procedures.
       Invokes KIS-Version of doc_lib_unix (=DOCLIBUNIXKIS) if IDL is
       running under UNIX.
*CATEGORY:            @CAT-# 13@
       Help
 CALLING SEQUENCE:
       doclib                     ;For prompting.
       doclib,'Name' [,keywords]  ;Extract documentation for procedure 'Name'
                                   using the current !PATH.
 INPUTS:
       Name = string containing the name of the procedure.
       Under Unix, Name may include "*" as "wild-character" or "*" for "all"
       (not allowed if output to paper-printers).
       
 KEYWORDS (All Versions):
       /PRINT                  : documentation is sent to the default printer:
                                 (UNIX: 'lpr -h -Pt0' = local InkJet printer);
 KEYWORDS (UNIX-Version):
       PRINT= 'te' or ='TE'    : output to 'lpr -h -PTE';
       PRINT= 'lw' or ='LW'    : output to LaserWriter (standard format);
       PRINT= 'lw2' or ='LW2'  : output to LaserWriter (2-column-format);
       PRINT= 'file' or ='FILE': output to file "./.IDL_doc[.n]";
       PRINT= '': the specified string is interpreted as a
                                 shell-command used for output with its
                                 standard input the documentation:
                                 I.e. PRINT="cat > junk";
       PRINT= 0 or not set     : output piped thru "more" to terminal screen.

       DIRECTORY= '' 
                           If omitted, use  current directory and !PATH;
                  Abbreviations for common libraries:
       DIRECTORY= '.'   :  search current directory **only**;
       DIRECTORY= 'kis' :  search in KIS_LIB **only**;
       DIRECTORY= 'user':  search in IDL-USER's Library **only**;
       DIRECTORY= 'stat':  search in IDL-STATISTICS Library **only**;
       DIRECTORY= 'widg':  search in IDL-WIDGETS Library **only**;
       DIRECTORY= 'other': search in OTHER_CONTRIBS (creaso,esrg_ucsb,windt)
                           **only**;
       DIRECTORY= 'iue' :  search in IUE-library (KIS-version) **only**;
       DIRECTORY= 'jhu' :  search in JHUAPL-library (KIS-version) **only**;
       DIRECTORY= 'nasa':  search in NASA-ASTROLIB (KIS-version) **only**.

       MULTI= flag : to allow printing of more than one file if the module
                     exists in more than one directory in the path + the
                     current directory.
 KEYWORDS VMS-Version):
       /FILE          : If present and non-zero, the output is left in the
                        file userlib.doc, in the current directory.
       PATH= '' : optional directory/library search path.  Same format
                        and semantics as !PATH.  If omitted, !PATH is used.

 OUTPUTS:
       Documentation is sent to the standard output unless /PRINT
       is specified.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       Output is produced on terminal or printer.
 RESTRICTIONS:
       The DIRECTORY and MULTI keywords are ignored under VMS. The
       FILE and PATH keywords are ignored under Unix.
 MODIFICATION HISTORY:
       Written, DMS, Sept, 1982.
       Added library param, Jul 1987.
       Unix version, DMS, Feb, 1988.
       New VMS version, DMS, Dec. 1989
       Wrapper procedure to call the correct version
               under Unix and VMS, AB, Jan 1990
       Added support for DOS, SNG, Dec, 1990
       Adapted for KIS, H.S., Jul, 1991
       1992-Jul-17: pro DOCLIBUNIX added into same file as DOCLIB
       1992-Nov-03: more libraries included
       1993-Mar-22: 'WINDT' replaced by 'OTHER' (OTHER_CONTRIBS)
       1993-Mar-31: userlib-procs DOC_LIB_VMS, DOC_LIB_DOS -> DL_VMS, DL_DOS
                    (IDL vers. 3.0.0)

(See /supple/soft/rsi/idl_5/lib/kis-lib/doclib.pro)


DSP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       DSP
 PURPOSE:
       Display and/or print 2D data with x/y-scales
*CATEGORY:            @CAT-# 15@
       Image Display
 CALLING SEQUENCE:
       DSP,array [,RANGE=[zmin,zmax]] [,/FLAG] [,CRANGE=[colmin,colmax]] ...
                ... [,XX=xax] [,YY=yax] [,XS=xsz] [,YS=ysz] ...
                ... [,HD=mtt] [,XT=xtt] [,YT=ytt] [,BAR=bar_pos]
                ... [,DV=dev] [,CO=col] [,PR=prt]
 INPUTS:
       array: 2D array to be displayed and/or plotted (1st dim is "x").
 OPTIONAL INPUT PARAMETER: 
       RANGE=[zmin,zmax] : the array-values between zmin,zmax will be
                 scaled to the range of (useful) color-indices for 
                 color-display or to [0,255] for b/w-displays (assuming 
                 grey-scales be simulated by dithering);
                 default: minimum,maximum values in array will be used for
                          scaling.
       /FLAG or FLAG=[low,high]: set color-index for values < zmin to 0 
                 (or to low) and for values > zmax to !d.table_size-1 (or
                 (or to high). This can be set to make evident "out-of-range"
                 pixels. If not set, "out-of-range" pixel get the colors
                 corresponding to zmin or zmax.
       CRANGE=[colmin,colmax] : range of color-indices onto which the
                 value-range [zmin,zmax] is to be scaled; colmin, colmax 
                 0 <= colmin < colmax <= 255 .
                 default: the "useful" color-table-range (avoiding any 
                 "special colors" in the lower part of the color-table).
       XX=xax  : vector containing x values (vector-size = x-size of array!);
                 default: indgen(nx), nx=size of 1st dim. of array.
       YY=yax  : ditto for y axis.
       XS=xsz  : x-size of printed image (*); default =18 cm.
       YS=ysz  : y-size of printed image (*); default =15 cm.
       HD=mtt  : (string) plot title; default ='' (no title).
       XT=xtt  : (string) x-axis label; default ='X'.
       YT=ytt  : (string) y-axis label; default ='Y'.

       BAR=bar_pos : a scaled bar is displayed at specified position showing
                 the corespondence between colors/grey-scale and array values;
                 bar_pos: 4-element vector [x0,y0,x1,y1] of lower left an
                 upper right corner of the sub-image (in array pix; this sub-
                 image is 2 pix longer and 2 pix wider than the colored 
                 strip); if only /BAR is specified, the bar position is
                 centered in x and set above (screen) or below the main image.
       CO=col  : to produce Color-PostScript output (*);
                 if DSP is called from a color-workstation, the active color-
                 table will be used (value of col will be ignored); otherwise,
                 color table # (0 <= col <= 45) will be loaded;
                 default: b/w PostScript output.
                 See also NOTE below.
       DV='ps' : a non-encapsulated PostScript file (for output on PS-devices)
                 is produced **additionally** to screen-display;
       DV='pse' (or 'eps'): an encapsulated PostScript file (to be inserted
                 into other documents like TeX) is produced additionally to 
                 screen-display;
         ='*!' or ='!*' (*: ps , eps , pse ): 
                 **only** a PostScript file is produced; 
                 default: output only on the device which was active before 
                 calling DSP.
       PR=prt  : meaningful only if DV='ps' (or '!ps' or 'ps!') (*):
                 idl.ps will be sent to selected printer  
                 !!! and then be removed except for PR=2 !!!
          prt = 1 (or /PR): PS-file idl.ps will be sent to local b/w Laser-
                   Jet (or -Writer) ("lw") (even if the PS-file contains a
                   color-plot); default paper feed will be used.
              = { 9 | 10 | 12 } : PS-file idl.ps will be sent to b/w 
                   LaserJet of machine AIPSOEprt,
              = 5: PS-file idl.ps will be sent to laserjet of AIPSOE (A27).
              = 6: PS-file idl.ps will be sent to deskjet of AIPSOE1 (A27).
              = 2: PS-file idl.ps file will be renamed to idl_dsp..ps
                   (no spooling to printer);
              = { 3 | 5 | 11 | 14 } : PS-file idl.ps will be sent to DeskJet 
                    of AIPSOEprt 
              = 4: PS-file idl.ps will be sent to QMS-Colorlaser

                 Key PR is meaningless in case of encapsulated PostScript.
                 Default (PR not set or prt <= 0): no action beside creating
                 PS-file idl.ps; !!! in any case, an existing idl.ps will be
                 overwritten !!!
       BP=bit  : bits per pixel; default: 4 for b/w, 8 for color (*).
       (*): these parameters do not affect screen display.
 OUTPUTS: 
       none
 OPTIONAL OUTPUTS: 
       none
 COMMON BLOCKS:
	COMMON COLSTO_COM, colnams,colsindx
              set by COLOR, COLSTO, LCT "special colors"
 SIDE EFFECTS: 
       PS-file idl.ps or idl_dsp.ps if DEV='ps' and PR=2 or not set.
       Encapsulated PS-file will be created if PR=2; the file name will be
       idl.ps_enc or idl.ps_enc.
       Use the xsize and ysize parameters to obtain the desired size of
       the output. 
 NOTE:
       The loaded color-table will be modified for 1st and last entry to make
       a white background and black lables. This modification will NOT be 
       reset on exit! When an active color-table will be interactively edited
       by, e.g., XLOADCT, or a new c.t. will be loaded after DSP finished,
       the fore- & background will change to may be unwanted colors. A new
       call of DSP will modify the 1st and last c.t.-entry again to make
       the background white and the lables black.
 RESTRICTIONS:
       Printing huge arrays takes rather long and should be avoided. 
       If the image on the screen looks strange, try a larger window.  
 PROCEDURE: 
       Combine tv and contour routines.
 MODIFICATION HISTORY:
       1991-Jul-02 ws (KIS): created.
       1992-Sep-04 ws (KIS): updates.
       1992-Sep-29 nlte (KIS): additions: zrange, bar, color table loading,
                                     more options for prt, 
                        tv,bytscl(array) (not array=bytscl(array) & tv,array).
       1993-Apr-08 nlte (KIS): special case GOOFY: no spooling to tekps.
       1993-Jun-21 nlte (KIS): PR=1: output device "LW" or "PJPS",
                               PR=3: output device DeskJet or "TEKPS";
                               coding for bar improved. 
       1993-Oct-05 nlte (KIS): mkbar: proper pixel scaling.
       1993-Oct-26 nlte (KIS): PR=3: output device DeskJet "tps" or "ctps",
                               PR=4: output device "TEKPS" or "tps"
       1993-Dec-03 nlte (KIS): PR=40...48 device "lj..."
       1994-Nov-30 nlte (KIS): print format modified for tekps,
                               time- & user- "stamp" supressed in output
                               for encapsulated PostScript.
       1995-Nov-27 nlte (KIS): bytscl replaced by internal procedure COLSCL; 
                               user-name from $LOGNAME or $USER;
                               new color bar; spawns plot-file via LOUIE
                               if IDL session runs under solaris 2.
       1996-Mar-16 nlte (KIS): "special colors".
       1996-Mar-28 nlte (KIS): key-parameters CRANGE, FLAG included.
       1996-Sep-13 nlte (KIS): made conform with OS5.x; PaintJet removed.

(See /supple/soft/rsi/idl_5/lib/kis-lib/dsp.pro)


ELLI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ELLI
 PURPOSE:
	Computes the radial vector for given position angles of an ellipse
	with specified parameters. Optionally, the partial derivatives
       of r_elli(phi; xc,yc,a,eps,psi) with resp. to the parameters are
       also returned (can be called by non-lin. fit routine CURVEFIT).
*CATEGORY:            @CAT-# 22
	Mathematical Routines 
 CALLING SEQUENCE:
	ELLI ,phi,params,r [,pder]
 INPUTS:
	phi   : real vector of position angles (rad)
       params: 5-elementt vector containing thje parameters of the ellipse:
               (0),(1): xc, yc the coordinates of the center relative to
                        the origin of the polar coordinates.
                        NOTE: the origin must lie INSIDE the ellipse
                              (else, the value for r(phi) would be ambiguous).
               (2)    : a , lenght of semi-major axis
               (3)    : eps , numerical eccentricity = sqrt( 1.-(b/a)^2)
               (4)    : psi , the angle in radian between the x-axis and
                        the major axis (positive if semi-axis is rotated
                        counter-clock-wise from x-direction).
 OUTPUTS:
	r     : the radius vector for each specified angle phi.
 OPTIONAL OUTPUTS:
	pder  : 2-dim. array pder(n,5) containing partial derivative of r
               with resp. to the 5 parameters of the ellipse for each of
               the n phi-values (as requested by non-lin. fit routine 
               CURVEFIT).
 EXAMPLE:
      To compute 100 "equaly" distributed cartesian coordinates for an 
      ellipse with xc=100., yc=200. , a=30., eps=0.7, psi=45 deg:
          phi = 0.02*!pi*findgen(100)
          ELLI, phi, [0.,0., 30., 0.7, 45.*!dtor] , r
          x=100.+r*cos(phi) & y=150.+r*sin(phi)
      Note that the poar coordinates are computed with the center of the
      ellipse as origin (since the origin for x/y is outside the ellipse!).
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	
 RESTRICTIONS:
	The origin of the polar coordinate system must lie INSIDE the ellipse
       (to avoid ambiguity for r).
 PROCEDURE:
	
 MODIFICATION HISTORY:
	nlte, 1996-06-29 

(See /supple/soft/rsi/idl_5/lib/kis-lib/elli.pro)


ELLI_FIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ELLI_FIT
 PURPOSE:
	Least square fit of an ellipse; returns the parameters of an ellipse
       which best fits the given points.
 CATEGORY:            @CAT-#  5
	Fitting Curves
 CALLING SEQUENCE:
	result = ELLI_FIT ( x,y [,w] [,START=xyaew] [,FIXPARAMS=ifix] , ...
                           [,/PLOT] [,/VERBOSE] )
 INPUTS:
	x    : vector of x-coordinates of points to be fitted
       y    : vector of y-coordinates of points to be fitted
              vectors x,y must have the same length of at least 5.
 OPTIONAL INPUT PARAMETER:
	w    : vector of weights, same length as x,y. Default: w == 1.
       START = [xcenter, ycenter, a , eps , psi] start values (estimations)
              and values for fixed parameters of the ellipse
              (a: semi-major axis, 
              eps: numerical eccentricity sqrt(1-(b/a)^2);
              psi: angle (deg) of semi-major axis from x-dir (c.c.w)).
              If not given ELLI_FIT will make a very crude estimation for
              start values from the distribution of the fit-points.
              In case that some parameters are fixed, the start-vector MUST
              be specified!
       FIXPARAMS=ifix : integer-vector with the indices of those ellipse-
              parameters which shall not be iterated. The values for these
              fixed parameters must be stored inside the 5-element start-
              vector (see keyword START above). 
       /PLOT: Plot of the x,y-points and the fitted ellipse.
       /VERBOSE: output of results to standard out.    
 OUTPUTS:
	result : real vector size 9:
              (0:1) : xcenter , rms
              (2:3) : ycenter , rms
              (4:5) : semi-major axis , rms
              (6:7) : numerical eccentricity , rms
              (8:9) : angle (rad) betw. semi-major axis and x-dir, rms
 COMMON BLOCKS:
	ELLI_FIT_COM, parstart,ivar,nvarm1
              transfer of those parameters which are "fixed"
 SIDE EFFECTS:
	Plot and/or standard output if /PLOT and/or /VERBOSE is set.
 RESTRICTIONS:
	
 PROCEDURE:
	Cartesian coordinates x,y converted to polar coordinates r,phi.
       Non-linear fit of r(phi) using CURFIT from the "other_contribs" lib
       of IDL distribution. (The equivalent IDL-lib routine CURVEFIT is 
       sometimes trapped in an infinite loop!)
 MODIFICATION HISTORY:
	nlte, 1996-06-28 

(See /supple/soft/rsi/idl_5/lib/kis-lib/elli_fit.pro)


EXTRACURV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       EXTRACURV
 PURPOSE:
       extracts values from a two-dimensional array along circles or
       ellipses.
*CATEGORY:            @CAT-# 16 29 
       image processing , resampling
 CALLING SEQUENCE:
       EXTRACURV,array,radius,phi,dat [,ix,iy] [,CENT=cent]
                 [,THETA=theta [,ALPHA=alpha] ] [,/BILINEAR]
 INPUTS:
       array : two-dimensional array with data
       radius: radius of the circle or of the long axis of the ellipse,
               [pixel]
 OPTIONAL INPUTS:     
   CENT=[x0,y0]  : coordinates of the center of the circle, 2-element vector;
           default is center of array [pixel].
   THETA=theta : angle (degrees) of projection (ellipses are treated as
           projected circles);
           theta=0 (=default action) means no projection (circle).
   ALPHA=alpha : orientation of the projection, counterclockwise from positive
           positive x-axis (degrees). 
           Only active if also keyword THETA is set.
            = 0 means long axis along y-axis. 
   /BILINAER : if set, bi-linear interpolation between the four pixels which
           surround each target point (x,y) on the circle/ellipse is done;
           default (if /BILINAER is NOT set): the value of the pixel with
           indices nearest to (x,y) is extracted ("nearest neighbor 
           sampling"). 
 OUTPUTS:
   phi  : azimuth (degrees), counterclockwise from positive x-direction;
          the step width of this vector will be calculated such that one step
          corresponds nearly to one pixel at the circumfence of the circle; 
          if =0, the phi-range will be from 0. to 360-d_phi, else
          0 < phi(0) < d_phi and 360-d_phi < phi(nphi-1) < 360 .
          Note that the data will be sampled at equidistant phi-steps which
          results in an oversampling in case of an elliptic tracing outside
          its long axis intersection.
   dat  : vector with extracted data from array along the circle or ellipse.
 OPTIONAL OUTPUTS:
   ix,iy: vectors with image-array indices for each extracted pixel on the 
          circle or ellipse;
          in case that  is too long, ix and iy are limited to the 
          array-boundaries.
 COMMON BLOCKS:
          none
 PROCEDURE: 
          A vector of equidistant phi-angles around the full circle or 
          ellipse is produced; step width corresponds to the pixel extension.
          The number of elements in this vector depends on the radius. 
          Then the corresponding array-indices are calculated and the data 
          are extracted from the array.  
 MODIFICATION HISTORY:
          hoba (H. Balthasar, KIS), June 14, 1994: created.
          nlte (H. Schleicher, KIS), June 15, 1994: 
               option BILINEAR; shift output vectors such that first point
               is near phi=0.

(See /supple/soft/rsi/idl_5/lib/kis-lib/extracurv.pro)


FITS_HDR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       FITS_HDR
 PURPOSE:
       Reads header of a FITS file from disk; extracts parameters & comments
*CATEGORY:            @CAT-# 11  2@
       FITS-Files , CCD Tools
 CALLING SEQUENCE:
       FITS_HDR,unit,dateobs,time,datemodif,project,expos_comments, ...
             ... filename,image_id,itime,expos,parameters,naxis1,naxis2, ...
             ... naxis3,nrecs
 INPUTS:
       unit:    (integer) unit-number of opened FITS-file
 OUTPUTS:
       dateobs: (string) date of observation (FITS-label DATE-OBS);
       time   : (string) time of exposure start (FITS-label TIME-BEG)
                form: hh:mm.ss with ss rounded)
       datemodif: (string) date & time of last modification of image data
                (FITS-label "DATE")
       project: (string) Comments common to a series of images; obtained
                from FITS-labels "COMMENT1" (abbrev.: "%G"), "OBSERVER", 
                "ORIGIN", "INSTRUME", "TELESCOP", "DATE-OBS"
                The contents of these FITS-"card images" will concatenated 
                after removal of superfluous blanks and enclosed by % ^ .
       expos_comments: (string) Comments specific to this image; obtained
                from FITS-labels "COMMENT" (abbrev.: "%C"), "OBJECT", 
                "        " (-> "%C"), "HISTORY" (abbrev.: "%H"), 
                "TIME-BEG", "TIME-END", "FILENAME", "DATE" (of last data 
                modification); 
       filename: (string) name of FITS-File as obtained from FITS-label 
                "FILENAME" 
       image_id: (short integer) "image-identification-no." obtained from
                 FITS-label "IMG_ID"; if no such label but 
                 "FILENAME XXXXnnnn.xxx", image_id = max. 4 digitsleft of dot 
       itime  : (long integer) start time of exposure, seconds since midnight
                calculated from FITS-label "TIME-BEG" (rounded).
       expos  : (floating) exposure time (seconds, not rounded) calculated 
                from FITS-labels "TIME-BEG", "TIME-END".
       naxis1,2,3 : Size of image-array (the 1st two dim. may be
                larger than format of "true" image data); from FITS-labels 
                "NAXIS1", "NAXIS2", "NAXIS3".
       parameters: (short integer array size 50) numeric parameters:
                (0) IMG_TYPE; (1) IMG_REDU; (2) IMG_ID; 
                (3) O_BAXIS1; (4) O_BAXIS2; (5) O_FAXIS1; (6) O_FAXIS2
                    (binning, off-sets done by CCD-AT-program);
                (7:8) co-ordinates (orig. CCD-pix) of "upper-right" corner
                      of "true image" (calculated from other parameters);
                (9) *1000 (rounded);
                (10:16) "%PAR:ii nnn" on "blank-comment" (unspecified para-
                         meters as set by user);
                (17) set = 1 (indicating parameters(9) expressed in msec);
                (18) "Tape-file-#"  obtained from "FILENAME" (4 digits 
                      left of dot : XXXXnnnn.xxx );
                (19:20) same rule as for (10:14) (may be : "loop-Id, -count");
                (21) BAXIS1; (22) BAXIS2 (actual binning); 
                (23) FAXIS1; (24) FAXIS2 : co-ordinates (orig. CCD-pix) of
                      "lower-left" corner of actual image relat. to CCD-
                      offset-point;
                (25) nximg; (26) nyimg : x,y-size of "true image" after 
                     binning;
                (27) CAMGAIN; (28) ZEROLEV;
                (29) SPEED (1='SLOW', 2='FAST', 0= else);
                (30:44) same rule as for (10:14);
                (45) nzimg = naxis3: size of 3rd dim (2-dim case: <= 1);
                (46) BITPIX; 
                (47:49) , ,  (rounded) from "TIME-BEG".
                parameters not found will be set to -9 .
       nrecs  : number of FITS-header records (a 2880 bytes) read in.
 OPTIONAL OUTPUTS:
       HEADER=header : string array containing all header lines.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       
 RESTRICTIONS:
       FITS-File must be opened (OPENR) by calling program.
 PROCEDURE:
       Associated read of one or more 2880-byte records; the FITS-file
       may or may not be byte-swapped; this procedure will do internal 
       swapping if 1st "image card" begins with "ISPMEL" instead of "SIMPLE". 
 MODIFICATION HISTORY:
       nlte, 1992-05-05 
       nlte, 1992-07-08  file, file_id from FILENAME
       nlte, 1992-08-18  bug error message (nrec -> nrecs)
       nlte, 1993-07-21  less restrictive than FITS definition (string infor-
                         mations may start after 1st blank behind keyword)
       nlte, 1996-05-01  Unknown flags -> comm2 '%C ? .....^' ('% ....^' 
                         before); nbits from BITPIX allowed: 8,16,32;
                         remove leading '=' in comment-like strings. 
       nlte, 1996-07-04  3-dim. case; FPI-header.
       nlte, 1996-07-12  1st "'" may be after "/" (to be ignored)
       nlte, 1996-10-30  keyparameter header

(See /supple/soft/rsi/idl_5/lib/kis-lib/fits_hdr.pro)


IDL_ROUTINES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	IDL_Routines
 PURPOSE:
	Returns a string-array with the names of all (?) built-in 
       IDL-routines for IDL vers. 4.0 or later.
    **** The IDL_4.0 routines are online-documented in the HyperHelp ****
    **** sytem (invoked by hitting ? or by starting separate program ****
    **** idlhelp4). Click "Alphabetic List of Routines" or "List of  ****
    **** Routines by Application".                                  ****
 CATEGORY:            @CAT-# 13@
	Help
 CALLING SEQUENCE:
	array = IDL_ROUTINES()
 INPUTS:
	none
 OUTPUTS:
	string-array
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	
 RESTRICTIONS:
	
 PROCEDURE:
	Reads file /opt/idl_local/overview40/idl40-routines 
 MODIFICATION HISTORY:
	nlte, 1995-July-04

(See /supple/soft/rsi/idl_5/lib/kis-lib/idl_routines.pro)


INTSWP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	INTSWP
 PURPOSE:
	returns short integer (-array) converted from byte-array 
	with byte-swapping
*CATEGORY:            @CAT-# 28@
	Programming
 CALLING SEQUENCE:
	ishort = INTSWP(byt_arr)
 INPUTS:
	byt_arr = 1-dim byte-array, size must be a multiple of 2
 OUTPUTS:
	short integer if byt_arr has size 2 else
	short integer array with size = (size of byt_arr)/2
 SIDE EFFECTS:
	error message if invalid argument
 RESTRICTIONS:
	none
 PROCEDURE:
	uses IDL routine BYTEORDER
 MODIFICATION HISTORY:
	nlte, 1990-Oct-26

(See /supple/soft/rsi/idl_5/lib/kis-lib/intswp.pro)


KNINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       KNINT
 PURPOSE:
       returns nearest integer of real-value x
*CATEGORY:            @CAT-# 19@
       Mathematical Functions (General)
 CALLING SEQUENCE:
       n = KNINT(x [,/LONG])
 INPUTS:
       x = real value or array ; values must be -2^31 <= x <= 2^31
 OPTIONAL KEYWORD INPUT:
       LONG - If this keyword is set and non-zero, then the result of KNINT
               is of type LONG in any case.
               (Nearest long integer is also returned from NLONG (KIS_LIB)
               or from ROUND (IDL- Routine Vers. 3.1) 
 OUTPUTS:
       next integer (single value or integer-array)
                Type is INTEGER if -32767.5 < x < 32767.5, otherwise LONG    
                Already existing output variable will be unchanged if
                x is outside the above limits.               
 PROCEDURE:
       
 MODIFICATION HISTORY:
       nlte, 1990-01-05
       nlte, 1992-05-06 : faster code, no indices 
       nlte, 1993-08-04 : keyword /LONG
       hoba, 1997-01-23 : name changed from NINT to KNINT, overflow check,
                          automatic LONG if overflow for INTEGER.  
                          

(See /supple/soft/rsi/idl_5/lib/kis-lib/knint.pro)


LABS_NECKEL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LABS_NECKEL
 PURPOSE:
       Returns continuum intensities of solar disk center I_lamb
       for specified wavelength vector >= 3300 A according to absolute 
       FTS measurements of Neckel & Labs 1984, Solar Physics 90, 205-258.
*CATEGORY:            @CAT-# 31 34@
       Spectral Analysis , Stellar Atmospheres
 CALLING SEQUENCE:
       icont = LABS_NECKEL (w)
 INPUTS:
       w : vector or single value, wavelength(s) in Angstr. ;
           for values < 3300, zero will be returned; 
           for values > 12500, brightness temperature for 12500 A will be
           used to calculate the planckian flux distribution.
 OUTPUTS:
       icont : continuum intensity [erg/s/cm^2/cm] for disk center for each
           specified wavelength. Same size as w.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       
 RESTRICTIONS:
       returns zero for w < 3300 A.
 PROCEDURE:
       Linear interpolation of T_rad(w) as provided by Neckel & Labs;
       calls IUE-lib procedure PLANCK to compute the Planck-fct. value b
       (per A) for given wavelength and temperature;
       result = 1.e8 * b /!pi
 MODIFICATION HISTORY:
       nlte, 1994-05-25 

(See /supple/soft/rsi/idl_5/lib/kis-lib/labs_neckel.pro)


LCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCT
 PURPOSE:
	Loads a color table and modifies its first and last table
	entry to black and white or as specified. 
 CATEGORY:            @CAT-# 17@
	Color Tables
 CALLING SEQUENCE:
	LCT ,ncoltab [,FIRSTCOL=cfirst] [,LASTCOL=clast] [,/OVER] [,/QUIET]
 INPUTS:
	ncoltab : number of color table to be loaded. If not specified
	          or if outside [0,45], a menu of the available color
	          tables is displayed and the user is prompted to enter
	          a table number.
 OPTIONAL INPUT PARAMETER:
	FIRSTCOL=cfirst : [r,g,b] - vector which shall replace the lowest
                 color entry of the loaded color table; a single value
                 will be interpreted as grey. The entry will be left 
                 unchanged if one of the values is outside [0,255].
                 Default: [0,0,0]. 
      LASTCOL=clast : [r,g,b] - vector which shall replace the highest
                 color entry of the loaded color table; a single value
                 will be interpreted as grey. The entry will be left 
                 unchanged if one of the values is outside [0,255].
                 Default: [255,255,255].
      /OVER :    Overwrite any "special colors" loaded by COLSTO (KIS_LIB).
                 Default: the part of the c.t. where "special colors" have
                 been loaded by COLSTO will be restored after loading a
                 new color table.
      /QUIET :   Suppress ColorTable message.
 OUTPUTS:
	
 COMMON BLOCKS:
	COMMON COLSTO_COM, colnams,colsindx
                 Set by procedure COLSTO (KIS_LIB) for special colors.
 SIDE EFFECTS:
	
 RESTRICTIONS:
	
 PROCEDURE:
	Loading requested c.t. by LOADCT; getting the r,g,b vectors by
       TVLCT,/GET ; updating locations 0 and !d.table_size-1 of r,g,b;
       loading updated c.t. by TVLCT.
 MODIFICATION HISTORY:
	nlte, 1996-03-18

(See /supple/soft/rsi/idl_5/lib/kis-lib/lct.pro)


LIEGE_ATLAS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       liege_atlas
 PURPOSE:
       extract spectral lines/ wavelength ranges from the Liege-Atlas
       (Delbouille et al. 1973)
 CATEGORY:
       
 CALLING SEQUENCE:
       LIEGE_ATLAS,DATA,LAMBDA,NBLOCKS [,XLAM=XLAM]
 INPUTS:
       DATA    : Name of variable to store the profile
       LAMBDA  : Starting wavelength in Angstroem
       NBLOCKS : Number of blocks to extract (1000 mA each) or end
                 wavelength in Angstroem 
 KEYWORDS
       XLAM    : (optional) Lambda-values for DATA
 RESTRICTIONS:
       Environment variable SPECTRAL_DATA should be set to the
       directory where the spectral data is stored
 MODIFICATION HISTORY:
       15-Okt-1990  P.Suetterlin, KIS
       24-Mar-1999  H. Balthasar f"ur AIP-SOE

(See /supple/soft/rsi/idl_5/lib/kis-lib/liege_atlas.pro)


LINEQINT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LINEQINT
 PURPOSE:
	Linear interpolation of data from one EQUIDISTANT grid to a grid 
       shifted by a FRACTIONAL amount; in case of 2-dim. data, the grid-shift
       may vary along the non-interpolation direction. 
       This routine is considerably faster than calling a 1-dim. linear 
       interpolation routine within an external loop.
*CATEGORY:            @CAT-# 18@
	Interpolation	
 CALLING SEQUENCE:
	yint = LINEQINT ( yorig, xshift [,DIR={1 | 2}] )
 INPUTS:
       yorig : 1- or 2-dimensional array of data to be interpolated;
       xshift: either scalar or vector (size = size of non-interpolation
               direction of 2-dim. array yorig). The i-th point of yint
               is the interpolation at position i + xshift of yorig.
               If yorig is 1-dim., xshift must be scalar; if yorig is 2-dim.
               and xshift a scalar, the same shift is taken everywhere.
 OPTIONAL INPUT PARAMETER:
	DIR = { 1 | 2 } : only meaningful if yorig is 2-dimensional; indicates
              dimension of interpolation; if =2, interpolation will be done
              along the 2nd dimension ("columns") of yorig for each column,
              else (default) interpolation is done along the 1st dimension
              for each "row".	
 OUTPUTS:
	yint:  array with interpolated data, same size and type as yorig.
              If yorig is integer, interpolation will be done with real
              arithmetic and the result will be rounded to next integer.
              Points outside the original grid will be set to the 1st or last
              original data value.
 COMMON BLOCKS:
	
 SIDE EFFECTS:
	
 RESTRICTIONS:
	
 PROCEDURE:
	
 REMARKS:
       For intgral grid-shift k, b=LINEQINT(a,k) is like b=SHIFT(a,-k,0)
       beside boundary effects (SHIFT is faster than LINEQINT).
       Interpolation for non-equidistant grids (or the two grids have 
       different spacings), use KIS_LIB procedure LININT.
       b=LINEQINT(a,dx) (dx a scalar) and 
       b=LININT(findgen(nx,ny),a,findgen(nx,ny)+dx)  (nx,ny the format of a)
       give the same results (except at boundary), but LINEQINT is somewhat 
       faster.
       KIS_LIB procedure SHEAR_IMG can also interpolate 2-dim data along one
       direction and has also the (SLOW) option of spline-interpolation and
       boundary treatment can be controlled by the user.
 MODIFICATION HISTORY:
	nlte (KIS), 1994-12-14 

(See /supple/soft/rsi/idl_5/lib/kis-lib/lineqint.pro)


LININT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LININT
 PURPOSE:
	Linear interpolation of data-array from one grid to an other grid;
       in case of 2-dim. data, LININT interpolates in one direction assuming
       the two grids to be identical for each data-vector of the other dir.
       This routine is considerably faster than calling a 1-dim. linear 
       interpolation routine within an external loop.
*CATEGORY:            @CAT-# 18@
	Interpolation
 CALLING SEQUENCE:
	out = LININT ( xorig, data_orig, xnew [,/REGULAR] [,DIR={1 | 2}] )
 INPUTS:
	xorig: vector of current independent variable grid; must be monotonic 
              increasing but not neccessarily equidistant;
       data_orig : 1- or 2-dimensional array of data to be interpolated;
              the size of the dimension along which to interpolate must
              be same as size of xorig.
       xnew : vector of new grid for the idependent variable;
              may be non-equidistant and/or unordered;
              for points of xnew outside range of xorig, linear extrapolation
              will be done. xnew may also be a single value.
 OPTIONAL INPUT PARAMETER:
	DIR = { 1 | 2 } : only meaningful if array data_orig is 2-dimensional
              to indicate the dimension of interpolation; if =2, interpolation
              will be done along the 2nd dimension ("columns") of data_orig
              for each column, else (default) interpolation is done along the 
              1st dimension for each "row".
       /REGULAR to indicate that the xnew-grid is "regular": constant spacing
              and increasing; this makes the interpolation (somewhat) faster,
              especially if this procedure must be called for 1-dim 
              interpolation within a loop (anavoidable if the xnew-scale 
              changes along the other direction).
 OUTPUTS:
	out :  array with interpolated data. For 1-dim. case, the size is 
              that of xnew; for 2-dim case, out is also 2-dim; 
              if xnew has size nx_new and data_orig has size (ny1, ny2) then 
              out has the size (nx_new, ny2) for dir=1 and 
                               (ny1, nx_new) for dir=2;
              if xnew is a single value, then out has size (ny2) or (ny1)
              for dir=1 or =2, rsp.
                 Type of data_orig:          |      Type of out:
               short or standard integer     |   single precis. real
               single precis. real           |   single precis. real
               double precis. real           |   double precis. real
               single/double prec. complex   |   single/double prec. complex
                     
        
 COMMON BLOCKS:
	
 SIDE EFFECTS:
	
 RESTRICTIONS:

 PROCEDURE:
       Let "x" denote the interpolation direction and "y" the other.
       Determines the nodes of original x-grid which are needed for the
       interpolation, and computes all x-dependent parameters ONCE and ONLY 
       at the needed x_orig -positions. Then computes the interpolated array 
       for each y-position, using vector expressions.
       Calls KIS_LIB procedures WFIRST, WLAST.
 REMARKS:
       For special case that BOTH grids have the SAME CONSTANT spacing
       (the grids differ only by an offset), LINEQINT (KIS_LIB) is 
       somewhat faster than LININT and considerable faster than interpolating
       with LININT in one direction and looping over the other (see EXAMPLE
       below). See also KIS_LIB procedure SHEAR_IMG.
 EXAMPLE 1:
       The original 2-d data are a0(1440,428) with both coordinates have
       non-equidistant scalings: x0(1440), y0(428). Interpolation onto a
       regular grid xint(1500), yint(600):
       ai=LININT(x0,a0,xint,/R)         ; interpol. in "x"-dir
       ai=LININT(y0,ai,yint,/R,DIR=2)   ; interpol. in "y"-dir
       Time consumed:  (on a SPARCstation 4) : 13 sec
 EXAMPLE 2: 
       As in example 1, but the original y-scale y0 is in reversed order
       (y decreasing) and the result should be in regular order. LININT
       requires that "y_orig" must be increasing. The trick is to use -y0
       and -yint as y-scales for the interpolation (the "ynew"-scale 
       (= -yint) is then non-regular, of course:
       ai=LININT(x0,a0,xint,/R)         ; interpol. in "x"-dir
       ai=LININT(-y0,ai,-yint,DIR=2)    ; interpol. in "-y"-dir
       Time consumed:  (on a SPARCstation 4) : 14 sec    
 EXAMPLE 3:
       The original 2-d data are a0(480,214) with both coordinates have
       non-equidistant scalings: x0(480), y0(214). As an additional compli-
       cation, the data in a0(i,*) are shifted relative to y0 by dy(i) for 
       each x-position (i = 0,....,479). These data shall be interpolated to 
       equidistant x/y-scales xint(500), yint(600), corrected for the y-dis-
       placements. Step-width of yint = w [ yint = const. + w*findgen(600) ].

       ai=LININT(y0,a0,yint,/R,DIR=2) ; interpol. onto "regular" y-scale but
                                      ; not correcting for the dy-shifts;
                                      ; result ai has dim. (480,600).
       ai=LINEQINT(ai,-dy/w,DIR=2)    ; "fractional shift" each column #i 
                                      ; by -dy(i)/w pixel.
       ai=LININT(x0,ai,xint,/R)       ; interpol. onto "regular" x-scale xint;
                                      ; result ai now has dim. (500,600).
       Time consumed (on a SPARCstation 4) : 6 sec (7 sec if /R not set).

       The same result can be achieved by the following sequence:
       ai=FLTARR(480,600)
       FOR i=0,479 DO ai(i,*)=LININT(y0+dy(i),REFORM(a0(i,*),yint,/R) 
                                      ; this interpolates+shifts in "y" for
                                      ; each "x" ; note the REFORM(...) !
       ai=LININT(x0,ai,xint,/R)       ; interpol. in "x".
       Time consumed:  27 sec = factor 4.5 more than first sequence!
       (If /R not set: 42 sec)
       In the 2nd sequence, most of the time is wasted in the do-loop.
       Note, that in the 1st sequence, LININT is used only for interpolation 
       where the input-scale is non-equidistant

 MODIFICATION HISTORY:
	nlte (KIS), 1994-12-14 
       nlte (KIS), 1995-08-15 added data type double precision complex.
       nlte (KIS), 1995-10-17 bug dir=2 corrected.
       nlte (KIS), 1996-03-20 special case xnew a single value.
       nlte (KIS), 1996-04-11 new, faster code, /REGULAR

(See /supple/soft/rsi/idl_5/lib/kis-lib/linint.pro)


LL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       LL
 PURPOSE:
       Long List of the contents of the current working directory
       in alphabetic order or sorted by time of last modification
       (latest last).
*CATEGORY:            @CAT-# 40 28@
       Operating System Access , Programming
 CALLING SEQUENCE:
       LL [,directory] [,/T]
 INPUTS:
 OPTIONAL INPUT PARAMETERS:
       directory : string, directory to be listed; 
                   default: current working directory.
 KEYWORD PARAMETERS:
       /T        : if set, the contents is  sorted by time of last 
                   modification (latest last); if not set, the list
                   will be in alphabetic order.
 OUTPUTS:
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
       Output on standard-out.
 RESTRICTIONS:
 PROCEDURE:
       spawns UNIX command "ls -lFAg " or (if /T set):
                           "ls -ltrFAg "
 MODIFICATION HISTORY:
       1993-Mar-12 nlte (KIS) created.

(See /supple/soft/rsi/idl_5/lib/kis-lib/ll.pro)


LONGSWP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LONGSWP
 PURPOSE:
	returns long integer (-array) converted from byte-array 
	with long-swapping
*CATEGORY:            @CAT-# 28@
	Programming
 CALLING SEQUENCE:
	long = LONGSWP(byt_arr)
 INPUTS:
	byt_arr = 1-dim byte-array, size must be a multiple of 4
 OUTPUTS:
	long integer if byt_arr has size 4 else 
	long integer array, size = (size of byt_arr)/4
 SIDE EFFECTS:
	error message if invalid argument
 RESTRICTIONS:
	none
 PROCEDURE:
	uses IDL routine BYTEORDER
 MODIFICATION HISTORY:
	nlte, 1990-Oct-26

(See /supple/soft/rsi/idl_5/lib/kis-lib/longswp.pro)


LOOKEXAB

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LOOKEXAB
 PURPOSE:
	Easy-to-use procedure to display CCD-exposures from ExaB-tape.
*CATEGORY:            @CAT-#  2 15@
	CCD Tools , Image Display
 CALLING SEQUENCE:
	LOOKEXAB
 INPUTS:
	none
 OPTIONAL INPUT PARAMETER:
	none
 OUTPUTS:
	none
 OPTIONAL OUTPUTS:
	none
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	Raster-image on display-window
 RESTRICTIONS:
	ExaByte-tape must contain FITS-images as created by AT1-software.
 PROCEDURE:
	looping of following sequence of procedures:
	rdfitsa - print header & display image (tvscl) - rdpix
 MODIFICATION HISTORY:
	nlte (KIS), 1992-08-26 created
	nlte (KIS), 1993-06-04 minor update messages

(See /supple/soft/rsi/idl_5/lib/kis-lib/lookexab.pro)


MACROBROAD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MACROBROAD
 PURPOSE:
       Returns macro-velocity -broadened line profile
*CATEGORY:            @CAT-# 34 31  3@
       Stellar Atmospheres , Spectral Analysis , Convolution
 CALLING SEQUENCE:
       r_mac = MACROBROAD(delt_lamb_vect, r_vect, v_macro, lamb_centr)
 INPUTS:
       delt_lamb_vect : Vector of (lambda - lamb_centr)/Angstr for input-
              line profile; must be monotonically increasing;
              if /HALF is set (case "half profile"), 1st element
              must be zero. Need not to be equidistant.
       r_vect : Vector of unbroadened input- line profile (line depression)
              I_continuum - I_line(delt_lamb_vect) (normalization of no
              importance); r_vect may contain either a full profile or a 
              "half-profile" starting at line center.
       v_macro : Macro-velocity / km/sec; must be > 0;
              the line profile will be convolved with a gaussian kernel
              which drops to 1/e at delta_lambda = (v_macro/c)*lamb_centr.
       lamb_centr: Absolute wavelength (Angstr.) of spectral line.
 KEYWORD PARAMETERS:
       /HALF : If set, the input line profile is a "half profile" from
              which a symmetric "full" profile will be created internally.
       DLF=step : Step-width (Angstr.) for the "fine" delta_lambda-grid
              used to compute the broadened profile; The input profile
              will be spline-interpolated onto an equidistant wavelength-
              grid of specified step width:
                 delta_lamb_fine = delta_lamb_start + 
                                   step * findgen(n_elements(r_mac))
              (delta_lamb_start see below, keyword DLS);
              the broadened profile will be returned for this wavelength-
              grid, unless keyword /OLD was set.
              Default: step=0.002 ( 2mA).
       /OLD : If set, the broadened profile will be re-interpolated onto
              the wavelength-grid of the input-profile (delt_lamb_vect).
 OUTPUTS:
       Vector of broadened line profile; unless keyword /OLD was set, the
       returned vector corresponds to the equidistant "fine" wavelength-
       grid (see descr. of keyword DLF above); if keyword /OLD was set,
       the returned vector corresponds to the wavelength-grid of the
       input-profile.
 OPTIONAL OUTPUT PARAMETERS:
       DLS=delta_lamb_start : Wavelength of 1st point of wavelength-grid
              for which the brodened profile is returned.
              delta_lamb_start == delt_lamb_vect(0) if /OLD was set or
                                  if no /HALF was set;
              delta_lamb_start == -(delt_lamb_vect(*)) if /HALF was set
                                  but not /OLD . 
 COMMON BLOCKS: 
      none
 SIDE EFFECTS: 
      none
 RESTRICTIONS:
      The input profile should drop to small values so that extrapolation
      of the wings, assuming r(x) prop x**-2 is reasonable or of no harm.
 PROCEDURE:
      1.) If /HALF was set: input-profile is reflected around delta_lamb = 0
          to create a symmetrical "full profile".
      2.) The input-profile is spline-interpolated onto an equidistant
          wavelength-grid ("fine" grid) (step-width: step, boundaries defined
          by input wavelength-grid delt_lamb_vect).
      3.) A gaussian kernel is computed for the "fine" grid; the kernel drops
          to (1/e)*kernel(0) at delta_lambda = (v_macro/c)*lamb_centr;
          the size of the kernel-vector is 2*im+1, im is determined such
          that the kernel  drops below kernel(0)*10**-6 at delta_lamb =
          im*step.
      4.) The "fine" grid is extended by  steps on both sides and the
          profile is extrapolated assumig d_lamb**-2 -dependence of line
          depression.
      5.) The unbroadened profile is convolved with the kernel using IDL-
          routine CONVOLV.
      6.) The convolved vector is truncated by the "extensions" (see 4.).
      7.) If /OLD was set: the convolved vector will be back-interpolated
          onto the input-wavelength scale (spline).
 MODIFICATION HISTORY:
      Created: 1991-Sep-23   H. S., KIS

(See /supple/soft/rsi/idl_5/lib/kis-lib/macrobroad.pro)


MARGIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MARGIN
 PURPOSE:
       replacing bad image-margin columns or rows by "reasonable" values
*CATEGORY:            @CAT-# 16  6@
       Image Processing , Data Editing
 CALLING SEQUENCE:
       new_image = MARGIN (raw_image [,BADLEFT=nl] [,BADRIGHT=nr] ...
                           [,BADBOTTOM=nb] [,BADTOP=nt] [,AVRAGE=navrg] )
 INPUTS:
       raw_image : 2-dim array containing an image with bad margins.
 OPTIONAL INPUT PARAMETER:
       BADLEFT=nl : 1st  columns of raw_image: raw_img(0:nl-1,*)  
                    are no good and shall be replaced;
                    default: left margin is o.k.
       BADRIGHT=nr: last  columns of raw_image are no good and 
                    shall be replaced; default: right margin is o.k.
       BADBOTTOM=nb: 1st  rows of raw_image: raw_img(*,0:nb-1)
                    are no good and shall be replaced;
                    default: bottom margin is o.k.
       BADTOP=nt  : last  rows of raw_image are no good and 
                    shall be replaced; default: bottom margin is o.k.
       AVRAGE=navrg : take the average of the 1st  pixel values
                    inside of the "bad" ones and fill the "bad" with this
                    constant value; default: navrg = 3. 
 OUTPUTS:
       new_image  : image-array (size same as input raw_image) with 
                    margins "restaurated".
       
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       error messages if invalid input
 RESTRICTIONS:
       none
 PROCEDURE:
       straight foreward
 MODIFICATION HISTORY:
       nlte (KIS), 1992-Feb-11 

(See /supple/soft/rsi/idl_5/lib/kis-lib/margin.pro)


MAXCORSHIFT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MAXCORSHIFT
 PURPOSE:
       returns 1-dim shift between 2 vectors wich gives maximal correlation
*CATEGORY:            @CAT-#  4 16  0@
       Correlation Analysis , Image Processing , Array Manipulation Routines
 CALLING SEQUENCE:
       d=MAXCORSHIFT(a,b [,istart,iend] [,SIGNIF=sigma] [,SHIFT=m] [,FIT=k])
 INPUTS:
       a, b = vectors to be compared;
 OPTIONAL INPUT PARAMETER:
       istart, iend : compare vectors for index-range istart to iend only
                  (default: istart=0, iend=max. index of shorter vector);
       SHIFT=m : shift vector b relat. to a from -m to +m (default =30);
       FIT=k : take maximum of cubic fit of correl.-fct from imax-k3 to
               imax+k3 (k3=max(k,3)); 
               if not specified or k < 1 : take maximum of correl-fct itself.
 OUTPUTS:
       d : (fractional) shift where a(i+d) is maximal correlated with b(i).
 OPTIONAL OUTPUTS:
       SIGNIF=sigma: vector (size=4)
                   (0) = max. value of correlation coef. found,
                   (1), (2) = correl.-coef. at 1st, last shift
                   (3) = sigma of cubic fit to correl.-fct ( == 0 if no fit).
 SIDE EFFECTS:
       d and sigma will be set  -999 on error.
 RESTRICTIONS:
       
 PROCEDURE:
       1. Subtraction of linear trends in vectors a, b (using POLY_FIT of
          IDL-USERLIB);
       2. 1-dim correlation coefficients a <-> (b, shifted by -m ... +m)
          (using KIS_LIB function COR);
       3. Maximum of coefs(k) (either direct or max. of fit-cube).
 MODIFICATION HISTORY:
       nlte, 1989-11-29  PROCEDURE Y_SHIFT created
       nlte, 1990-04-23  SHIFT, FIT as optional keyword-arguments 
       nlte, 1991-11-14  FUNCTION MAXCORSHIFT, iy1,2 & sigma optional
       nlte, 1993-01-07  Description for FIT=k.

(See /supple/soft/rsi/idl_5/lib/kis-lib/maxcorshift.pro)


MDOC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MDOC
 PURPOSE:
       Menu- online documentation for IDL topics ("Functional Overview", 
	IDL-Routines & Key-words, IDL-Procedure Libraries, KIS_LIB, 
	WINDT_LIB, and other procedure libs).
	Provides online documentation for IDL topics. The style
	is a cross between Unix man pages and VMS online help. The
	help is organized in a two level hierarchy --- Level 1 is the
	global subject, and Level 2 supplies help on subjects within
	each global subject. If !D.WINDOW is not -1, (window system in use)
	the mouse is used to prompt for subjects, otherwise, the normal tty
	interface is used.
	This is a KIS_LIB -version of MP_BASIC from WINDT-Library.
	This routine will be called by KIS_LIB-version of MAN_PROC.
*CATEGORY:            @CAT-# 13@
	Help
 CALLING SEQUENCE:
	MDOC [, REQUEST]
 INPUTS:
	REQUEST = A scalar string containing the item on which help is desired.
	    This string can contain 1 or two (whitespace separated) words.
	    The first word is taken as the global topic and the second
	    as the topic within the scope of the first. Missing words
	    are prompted for.
 OUTPUTS:
	Help text is sent to the standard output.
 COMMON BLOCKS:
	None.
 RESTRICTIONS:
	The help text is derived from the LaTeX files used to produce
	the reference manual. However, it is not possible to produce
	exactly the same output as found in the manual due to limitations
	of text oriented terminals. The text used is therefore considerably
	abbreviated. Always check the manual if the online help is
	insufficient. 
 MODIFICATION HISTORY:
	3 November 1988, AB
						January, 1989, AB
	Added ambiguity resolution, ability to handle multiple levels,
	and support for mouse.

       Added support for DOS           SNG, December, 1990

					3 January 1991, AB
	Renamed from MAN_PROC to make room for the widget version.

				       29 July 1991, nlte
	KIS-specific: inclusion of KIS_LIB, WINDT_LIB.
                                      03 November, 1992, nlte
	KIS-specific: inclusion of "Functional Overview"
	              and other libraries.
                                      22 March 1993, nlte
	KIS-specific: 'WINDT_LIB' replaced by 'OTHER_CONTRIBS' in string-
                      array lv1_top0 .

(See /supple/soft/rsi/idl_5/lib/kis-lib/mdoc.pro)


MKFILNAM

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MKFILNAM
 PURPOSE:
	Modifies input_string such to make result a valid UNIX file-name:
	leading & trailing blanks will be removed without replacement,
	each blank substring will be replaced by a single underline;
       Characters !$&*|\(){}[];`'",<>? will be replaced by @ (several
	adjacent @ will be replaced by a single @).
*CATEGORY:            @CAT-# 35@
	String Processing Routines
 CALLING SEQUENCE:
	out_string = MKFILNAM(input_string)
 INPUTS:
	input_string : string to be converted.
 OUTPUTS:
	converted string.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	none
 PROCEDURE:
	straight
 MODIFICATION HISTORY:
	nlte (KIS), 1992-04-07
	nlte (KIS), 1992-08-26  accept /

(See /supple/soft/rsi/idl_5/lib/kis-lib/mkfilnam.pro)


MKFITSHDR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MKFITSHDR
 PURPOSE:
	Makes a FITS-header using informations in strings 
	"project", "exposure-comments",  and integer-array "parameters"
*CATEGORY:            @CAT-# 11  2@
	FITS-Files , CCD Tools
 CALLING SEQUENCE:
	header = MKFITSHDR (project, exposure-comments, parameters, ...
	                    ... naxis1,naxis2,naxis3)
 INPUTS:
	project: (string) contains "general comments" common to a
          series of images. MKFITSHDR searches for substrings of format 
	   '%

(See /supple/soft/rsi/idl_5/lib/kis-lib/mkfitshdr.pro)


MKS OR MKSD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MKS or MKSD
 PURPOSE:
	Returns value of a requested physical constant in SI- (m,kg,s,A) 
       units or displays a list of all stored constants together with their 
       key-words. MKS (MKSD) returns value in single (double) precision 
       format. This is a "wrapper" for PHYS_CONST.
       See also "wrappers" CGS(D), which return the cgs-values of constants.
 CATEGORY:            @CAT-# 23@
	Misc.
 CALLING SEQUENCE:
	value = MKS ( key ) ; returns single precision value for the constant 
                             defined by .
       value = MKSD( key ) ; ditto for double precision value (although most 
                             constants don't have this accuracy).
       dummy = MKS ( )     ; outputs a list with all available constants with
                             all significant decimals (0.0 will be returned).
       dummy = MKSD( )     ; same as dummy=MKS().
 INPUTS:
	key:  string, the key-word for requested constant. Case-sensitive!
	      'help', 'list', '?', ' ' or no argument: a list of the available
             constants (key, meaning, value, units) will be displayed (and
             value zero returned).
 OUTPUTS:
	value: the SI-value of requested constant. If key is unknown or if 
              the list of all constants was requested, zero will be returned.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	A list is written to standard out, if so requested.
 RESTRICTIONS:
	
 PROCEDURE:
	Calls PHYS_CONST
 MODIFICATION HISTORY:
	nlte, 1995-Aug-09

(See /supple/soft/rsi/idl_5/lib/kis-lib/mks.pro)


MORE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MORE
 PURPOSE:
       Reads contents of an ASCII file & prints it on screen with 
       UNIX command MORE .
*CATEGORY:            @CAT-# 14 42 40@
       I/O , Files , Operating System Access
 CALLING SEQUENCE:
       MORE, file
 INPUTS:
       file  : string, the name of the ASCII file to be read.
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       none
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
       prints file on screen via UNIX MORE
 RESTRICTIONS:
 PROCEDURE:
       spawns more.
 MODIFICATION HISTORY:
       1992-Jan-16 nlte (KIS) created.
       1993-Mar-15 nlte (KIS) documentation.

(See /supple/soft/rsi/idl_5/lib/kis-lib/more.pro)


MTREWIND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MTREWIND
 PURPOSE:
       Rewinds (and optionally unloads) tape on specified device
       (UNIX version; spawns UNIX command mt)
*CATEGORY:            @CAT-# 43 40@
       Magnetic Tape , Operating System Access
 CALLING SEQUENCE:
       MTREWIND [,dev] [,/OFFLINE] [,HOST=hostname]
 INPUTS:
       none
 OPTIONAL INPUT PARAMETERS:
       dev :  tape device number (integer) (device: /dev/nrst) or 
              tape device name (string) (leading /dev/ may be omitted)
              Example: dev=1 or dev ='nrst1' or dev ='/dev/nrst1 are
                       valid specifications of device /dev/nrst1 .
              Default: /dev/nrst0
 KEYWORD PARAMETERS:
       /OFFLINE : if set, tape will be rewound and drive unit will be taken
                  off-line (unloading the tape).
       HOST=hostname : the tape drive is not the local host but 
                       (mt command will be spawned with a remote shell).
 OUTPUTS:
       none
 SIDE EFFECTS:
       
 RESTRICTIONS:

 PROCEDURE:
       UNIX command 'mt -f  rew' or 'mt -f  offline' will be
       spawned to the local host or to remote host (rsh  mt ...).
 MODIFICATION HISTORY:
       1992-Oct-09: WS (KIS) created.
       1992-Oct-26: nlte (KIS) renamed (REWIND -> MTREWIND), new option HOST.
       1993-Dec-09: nlte (KIS) remove all blanks in  (strcompress).

(See /supple/soft/rsi/idl_5/lib/kis-lib/mtrewind.pro)


MTSKIPF

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       MTSKIPF
 PURPOSE:
       Skip tape by  EOF(s) forward  (or to End-of-Medium) 
       or backward by -1 EOF(s). (UNIX version)
*CATEGORY:            @CAT-# 43 40@
       Magnetic Tape , Operating System Access
 CALLING SEQUENCE:
       MTSKIPF [,n] [,DEVICE=device] [,HOST=hostname]
 INPUTS:
       none
 OPTIONAL INPUT PARAMETERS:
       n : if integer > 0 : tape will be skipped forward by  EOF(s);
           if integer < 0 : tape will be skipped backward by || EOF(s),
                            then be skipped forward by 1 EOF;
           if string 'EOM' : tape will be skipped forward to End-of-Medium;
           Default: n = 1 .
 KEYWORD PARAMETERS:
       DEVICE=device : tape device number (integer) (device: /dev/nrst)
                       or tape device name (string) (leading /dev/ may be 
                       omitted)
                       Example: dev=1 or dev ='nrst1' or dev ='/dev/nrst1 are
                                valid specifications of device /dev/nrst1 .
                       Default: /dev/nrst0 .
       HOST=hostname : the tape drive is not the local host but 
                       (mt command will be spawned with a remote shell).
 OUTPUTS:
       none
 SIDE EFFECTS:
       The requested action will be notified on standard print-out.
 RESTRICTIONS:

 PROCEDURE:
       UNIX command 'mt -f   || will be
       spawned to the local host or to remote host (rsh  mt ...).
       If n < 0, an additional 'mt -f  fsf 1' will be spawned.
 MODIFICATION HISTORY:
       1992-Oct-09: WS (KIS) created.
       1992-Oct-26: nlte (KIS) renamed ( SKIPF -> MTSKIPF), new option HOST,
                               option "EOM".
       1993-Dec-09: nlte (KIS) remove all blanks in  (strcompress).

(See /supple/soft/rsi/idl_5/lib/kis-lib/mtskipf.pro)


NLONG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	NLONG
 PURPOSE:
	returns next LONG integer of real-value x
*CATEGORY:            @CAT-# 19@
	Mathematical Functions (General)
 CALLING SEQUENCE:
	n = NLONG(x)
 INPUTS:
	x = real value or vector; values must be:  |x| <= 2.14748e+9
 OUTPUTS:
	next short integer (single value or integer-array);
 PROCEDURE:
	
 MODIFICATION HISTORY:
	nlte, 1992-05-06

(See /supple/soft/rsi/idl_5/lib/kis-lib/nlong.pro)


POLY_EXTR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
 	POLY_EXTR
 PURPOSE:
  	returns value of polynom and position of 
	(local) maximum or minimum if found within specified intervall.
*CATEGORY:            @CAT-# 22@
  	Mathematical Routines (no Functions)
 CALLING SEQUENCE:
	y = POLY_EXTR(coef,x1,x2,xextr [,indicator])
 INPUTS:
 	coef    : 1-dim vector containing the coefficients of polynom:
		  p_n(x) = coef(0) + coef(1)*x + coef(2)*x^2 + ...
       x1,x2   : x-intervall ( x1 < x2 ) to be searched for extremum;
		  if polynom is of degree > 2, the Newton-iteration will
		  start at 0.5*(x1+x2) and will be stopped if an iteration
		  is outside this intervall (ignored if degree = 2, but must
		  be provides formally in any case).
 OUTPUTS:
 	function-value: the value of polynom at x = xextr
 	xextr   : x-value where 1st derivative of polynom is zero (as 
		  found by Newton-iteration). If no root of 1st derivative
		  was found within x-intervall [x1,x2], xextr will be set
		  < x1 .
 OPTIONAL OUTPUT PARAMETERS:
	indicator : if an extremum was found, indicator = +1 if this is a
		    maximum, = -1 if this is a minimum; =0 if no extremum
		    was found. Argument must be a variable!
 COMMON BLOCKS:
	 none
 SIDE EFFECTS:

 RESTRICTIONS:

 PROCEDURE:
 	computes coefficients of 1st derivative;
	analytic computation of xextr, yextr if 1st deriv. is linear;
	Newton-iteration to find a root of 1st derivative within specified
	x-intervall using KIS_LIB procedure POLY_ROOT.
	If POLY_EXTR was called with 5 arguments, the 2nd derivative will
	be computed at x=xextr and checked for it's sign.
 MODIFICATION HISTORY:
	1991-Nov-18  H.S., KIS

(See /supple/soft/rsi/idl_5/lib/kis-lib/poly_extr.pro)


POLY_ROOT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POLY_ROOT
 PURPOSE:
       root of a polynom within a specified intervall
*CATEGORY:            @CAT-# 22@
       Mathematical Routines (no Functions)
 CALLING SEQUENCE:
       x= POLY_ROOT(coef,x1,x2)
 INPUTS:
       coef = vector of polynom coef(0) + coef(1)*x + coef(2)*x^2 + ...
       x1, x2 = x-intervall to be searched for root ( x1 < x2 );
                Newton-iteration will start at x=(x1+x2)/2 and will
                be stopped if an iteration is outside this intervall
                (ignored if deg=1).
 OPTIONAL INPUTS:
       MAXITER=mxiter : Newton-iteration will terminate unsuccessfull
                        after mxiter iterations (default : mxiter=20).
       CRIT=epsx :  Newton-iteration will terminate "successfull" if
                    x-value changes less than (x2-x1)*epsx between two
                    iterations (default: epsx = 1.E-5).
 OUTPUTS:
       approximate root if found inside [x1,x2] else a value < x1
       
 PROCEDURE:
       straight forward if deg=1, else Newton iteration, terminated
       if difference between 2 iterations is < (x2-x1)*epsx, or
       if an iterated x is outside [x1,x2], or after mxiter steps.
 MODIFICATION HISTORY:
       nlte, 1990-03-28 
       nlte, 1991-11-18 modified iterat.-crit., keywords MAXITER, CRIT   

(See /supple/soft/rsi/idl_5/lib/kis-lib/poly_root.pro)


POWER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POWER
 PURPOSE:  
       calculate power of a given data set.The data set can be one or
       two dimensional.There are quite a number of different data
       windows and other method available to calculate the power of
       a data series.Anyone who uses this routine is asked to provide
       himself with the necessary information about that topic.
       For further information see:
           Blackman,Tukey : The measurement of power spectra , Dover
           Chatfield      : The analysis of time series , Chapman & Hall
           Press et al.   : Numerical Recipes , p.420 ff , Cambridge U.P.
*CATEGORY:            @CAT-#  4 10@
       Power Spectra , FFT
 CALLING SEQUENCE:
       result=POWER(Data,[keywords])
 INPUTS:
       Data         : 1 or 2-dim Array with Data
 OPTIONAL INPUTS: (KEYWORDS)
       WINDOW=win   : One of the strings (case insensitive)
                      'Bartlett','Hanning','Hamming',Parzen' or 'Welch'
                      'Cosine 

' See Literature for explanation; 'Cosine

' : window with cos -edges extending over

percentage of the data vector (letting unchanged 100-2*

% of the inner part of the data); if

is omitted (WINDOW='cosine') or 0 <= p < 10, p will be set to 10; if p < 0, the cos -edges will affect the |p| innermost points of the data (each dimension of array Data). /NOMEAN : If set, don't subtract average TORDER=order : polynomial trend removal of order torder is to be applied. OUTPUTS: 1 or 2-dim Real Array of half dimensions of Data; if an error was detected, the string 'undefined' will be returned. OPTIONAL OUTPUTS: (KEYWORDS) WX=wx : return window function for 1st dimension; size of vector wx same as size of 1st dim. of dataset. WY=wy : return window function for 2nd dimension (meaningful only if dataset is 2-dim); size of vector wy same as size of 2nd dim. of dataset. COMMON BLOCKS: none SIDE EFFECTS: none RESTRICTIONS: none PROCEDURE: subtract average of data (except nomean is set) if torder is set: Trend removal (IDL-lib routine POLY_FIT (1-d) or SFIT (2-d) 1 or 2-dim FFT using built-in IDL-routine return normalized square of absolute FFT-values MODIFICATION HISTORY: AUTHORS : Robert Greimel , University of Graz,Austria, Dpt. of Astronomy Peter Suetterlin , Kiepenheuer Institut fuer Sonnenphysik, Freiburg , FRG 25-Mar-1990 changes : 1-Jan-1991 P.Suetterlin, KIS : 16-Dec-1992 H. Schleicher, KIS : use norm for normalization (not num^2); Cosine window, optional output wx, wy. 19-Mar-1996 H.S.: obsolete SURFACE_FIT replaced by SFIT .

(See /supple/soft/rsi/idl_5/lib/kis-lib/power.pro)


POWER1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       POWER1
 PURPOSE:
       Returns power spectrum of a 1-dim scan.
*CATEGORY:            @CAT-#  4 10@
       Power Spectra , FFT
 CALLING SEQUENCE:
       power = POWER1 (scan)
 INPUTS:
       scan  : real-vector (1-dim) with data.
 OUTPUTS:
       power : power-spectrum (1-dim real vector, size = size of scan)
               = | FT{scan} | **2 after linear trend beeing removed.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       none
 RESTRICTIONS:
       none
 PROCEDURE:
       linear trend (least square fit using POLY_FIT from IDL-
       USER's Library) subtraction; Fourier-transform using IDL-
       routine FFT); square of absolute Fourier-value.
 MODIFICATION HISTORY:
       1990-03-17 H.S., KIS  (power.pro)
       1991-08-09 H.S., KIS : renamed to power1

(See /supple/soft/rsi/idl_5/lib/kis-lib/power1.pro)


PRINTCCD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PRINTCCD
 PURPOSE:
     formatted print-out of a "CCD_STRUCT"-text_string
            (broken into several print lines at occurences of character "^") 
     or of "CCD_STRUCT"-parameters (together with "meaning").
*CATEGORY:            @CAT-#  2 14@
       CCD Tools , I/O 
 CALLING SEQUENCE:
       PRINTCCD [,unit] ,information [,FORMAT='(format string)']
 INPUTS:
       information: EITHER: string containing a text as stored in
                           ccd_struct.proj or or ccd_struct.txt
                           (with "^" indicating end-of-line).
                    OR    : parameter-vector (intarr, size =50) as in
                            ccd_struct.par .
 OPTIONAL INPUT PARAMETERS:
       unit : output unit number; must be 1st argument if specified;
              default: standard output: -1 .
 KEYWORD PARAMETERS:
       FORMAT='(format string)' : format string according to IDL-rules
                    (specifying output of one text-line);
                    default: text: new line after "^"; 
                             params: "(i)=  :  /" for each
                                     parameter entry with value other than -9 
 OUTPUTS:
       none
 SIDE EFFECTS:
       ASCII-output of one or several lines to file or standard-out as
       specified by unit number.
 RESTRICTIONS:
       none
 PROCEDURE:
       straight foreward       
 MODIFICATION HISTORY:
       nlte (KIS) 1992-Feb-27
       nlte (KIS) 1992-Apr-30  commented output of par(50), unit optional

(See /supple/soft/rsi/idl_5/lib/kis-lib/printccd.pro)


PROFIL_XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PROFIL_XY
 PURPOSE:
       Interactively draw row or column profiles of an image in a separate
       window.
 CATEGORY:            $CAT-# 15 16@
       Image Processing, Image Display
 CALLING SEQUENCE:
       PROFIL_XY, Image [, SX=sx, SY=sy, EX=ex, EY=ey, XOFF=xoff, YOFF=yoff]
 INPUTS:
       Image:  The variable that represents the image displayed in current 
               window.  This data need not be scaled into bytes.
               The profile graphs are made from this array.
 KEYWORD PARAMETERS:
       SX:     Starting X position (pixels) of the sub-image;  if this 
               keyword is omitted, 0 is assumed.
       SY:     Starting Y position (pixels) of the sub-image; if this
               keyword is omitted, 0 is assumed.
       EX:     Ending X position (pixels) of the sub-image; if this 
               keyword is omitted, maximum is assumed.
       EY:     Ending Y position (pixels) of the sub-image; if this
               keyword is omitted, maximum is assumed.
       Profiles are plotted for the specified sub-image only.

       XOFF:   Starting X position (pixels) of the image in the display-
               window; if this keyword is omitted, 0 is assumed.
       YOFF:   Starting Y position (pixels) of the image in the display-
               window; if this keyword is omitted, 0 is assumed.

       WSIZE:  The size of the PROFILES window as a fraction or multiple 
               of 640 by 512.
       ORDER:  Set this keyword param to 1 for images written top down or
               0 for bottom up.  Default is the current value of !ORDER.
       MINV:   minimum value in the profile. Default is the minimum of the
               selected subarea of image
       MAXV:   maximum value in the profile. Default is the maximum of the
               selected subarea of image
 OUTPUTS:
       No explicit outputs.
 COMMON BLOCKS:
       None.
 SIDE EFFECTS:
       A new window is created and used for the profiles.  When done,
       the new window is deleted.
 RESTRICTIONS:
       None.
 PROCEDURE:
       A new window is created and the mouse location in the original
       window is used to plot profiles in the new window.  Pressing the
       left mouse button toggles between row and column profiles.
       The right mouse button exits.
 EXAMPLE:
       Create and display an image and use the PROFIL_XY routine on it.
       Create and display the image by entering:
               A = DIST(256)
               TVSCL, A
       Run the PROFIL_XY routine by entering:
               PROFIL_XY, A

       The PROFIL_XY window should appear.  Move the cursor over the original
       image to see the profile at the cursor position.  Press the left mouse
       button to toggle between row and column profiles.  Press the right
       mouse button (with the cursor over the original image) to exit the
       routine.

             TVSCL, A, 300,250  ; lower left corner of image displayed at
                                  device coordinates (300,250) (pixel)
             PROFIL_XY, A, XOFF=300,YOFF=250  

 MODIFICATION HISTORY:
       DMS, Nov, 1988. (IDL-UserLib procedure PROFILES)
       Auffret,H. Jun 1993. : print true value of pixel, plot true range 
                              of image with true values for axes
       nlte, 1993-Jun-22 : keyword params xoff,yoff; re-setting of original
                          axis scaling of original raster graphic.

(See /supple/soft/rsi/idl_5/lib/kis-lib/profil_xy.pro)


PSP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PSP
 PURPOSE:
       Sends a b/w-PostScript output (idl.ps) to LaserWriter, LaserJet, 
          or to HP-DeskJet (b/w).
       Sends color-PostScript output to Color-Laserjet. 
       Encapsulated PostScript file will be re-named and kept on disk.
       Re-sets plot-device to "old_device" = active device 
*CATEGORY:            @CAT-# 25@
       Plotting
 CALLING SEQUENCE:
   for b/w-PostScript (or color=PS to be printed on b/w-printers):
       PSP [,{DESKJET=mode | LW=mode | 
             LJ0=mode | LJ1=mode | LJ2=mode | LJ3=mode}] ...
           [,KEEP=save] [,NO_PLOT]
   for color-PostScript to be printed on color-printers:
       PSP [,/COLQMS] [,KEEP=save] [,NO_PLOT]
 INPUTS:
       none   Default action: non-encapsulated PostScript file idl.ps will
              be sent to the "local" b/w- LaserJet.
              The PS-file will be removed.
 OPTIONAL INPUT PARAMETER:
       /DESKJET or
       DESKJET=mode : non-encapsulated PostScript file idl.ps will be 
                  printed with highest resolution on HP-DeskJet 
                  (300 dpi, b/w);
       /LW , /LJ0 , /LJ1 , /LJ2 , /LJ3 or
       LW=mode , LJ0=mode , LJ1=mode , LJ2=mode , LJ3=mode : 
                  non-encapsulated PostScript file idl.ps will be printed
                  on b/w -LaserWriter or -LaserJet 
                  (LJ0 : Building A27, R108;
                   LJ1 : Building A27, Library;
                   LJ2 : Building A27, Prof. Staude;
                   LJ3 : Building A27, R106;
                   LW : "local" device of above laser-printers 
       /COLQMS    non-encapsulated color-PostScript file idl.ps will be 
                  printed on QMS - colorlaserjet (Building A27, R108)
                  (always simplex mode).
       /KEEP    : PostScript file idl.ps will be NOT be removed but
                  re-named to idl.ps. 
                  (default: non-encapsulated idl.ps will be removed, 
                            encapsulated idl.ps will be renamed to 
                            idl.ps_enc.).
       KEEP=save: save (string): PostScript file idl.ps will be NOT be 
                  removed but re-named to .
       /NO_PLOT : do not send plot-file to output device
                  (default: non-encapsulated idl.ps will be sent to printer,
                            encapsulated ps will be stored on disk).
 OUTPUTS:
       none
 COMMON BLOCKS:
       ODEVCOM,old_device,old_backgrnd,old_color,old_chsz,pscolor
       old_device: string containing the name of device which was
                   active on previous call to PSS (set by PSS);
       old_backgrnd: contains !p.background as saved by previous call
                   to PSS;
       old_color:  contains !p.color as saved by previous call to PSS;
       old_chsz :  contains !p.charsize as saved by previous call to PSS;
       pscolor  : =1 if color-PS, else =0;
       psenc    : =1 if encapsulated PostScript, else =0.
 SIDE EFFECTS:
       Unless NO_PLOT was set or ENCAPSULATED was requested, the PostScript-
       file will be sent to queue of the selected printer and will
       then be removed (unless KEEP was set); 
       in case of ENCAPSULATED PostScript, the PostScript-file will be
       renamed and not be removed from disk (as in case of /KEEP).
 RESTRICTIONS:
       Plot-device must be set to 'PS' by a previous call of PSS;
 PROCEDURE:
       spawns UNIX commands        (see man pages); 

 MODIFICATION HISTORY:
       nlte, ?
       nlte, 1991-08-13 : !p.background, !p.color saved too.
       nlte, 1992-02-06 : spawning "rm idl.ps" if not /KEEP .
       R. Hammer, 1992-Aug-18 : DeskJet option.
       nlte, 1992-Aug-24: merging Reiner's version; KEEP=file.
       nlte, 1992-Sep-09: output device TEKTRONIX PHASER II if color-ps.
       nlte, 1993-Jun-18: default for color output: PaintJet; Phaser II
             only if /THERMO specified; renaming & keeping file in case 
             of encapsulated PostScript (no spooling to device).
       nlte, 1993-Aug-18: resets encapsulated-flag if this was set.
       nlte, 1993-Oct-26: additional option /CDESKJET.
       nlte, 1993-Dec-03: additional option LJ=mode.
       nlte, 1994-Mar-14: case OS5x included.
       nlte, 1995-Oct-04: case OS5X: full path of idl.ps in case of rsh
       nlte, 1996-Sep-13: spawns print-job scripts instead of lpr. Color-
                          PaintJet-printer removed. If called under OS4x,
                          the scripts are called remotely on donald.
       hoba, 1997-Jan-23, 1998-Apr-02 : Adoption to AIP-SOE

(See /supple/soft/rsi/idl_5/lib/kis-lib/psp.pro)


PSS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PSS
 PURPOSE:
       saves actual plot-device name,
       sets plot-device to 'PS' (PostScript; optionally encapsulated) 
       (b/w or color depending on !D.N_COLORS).
*CATEGORY:            @CAT-# 25@
       Plotting
 CALLING SEQUENCE:
       PSS ,/A4 [,OFFSET=[x0,y0] ] [,/LANDSCAPE] [,/COLOR] [,/ENCAPSULATED]
  or:
       PSS [,xsz ,ysz] [,OFFSET=[x0,y0] ] [,/LANDSCAPE] [,/COLOR] [,/ENCAPSULATED]
 INPUTS:
       none
OPTIONAL INPUTS:
         xsz, ysz : overall size of plot in x and y direction [cm];
                    ignored, if keyword /A4 set.
                    default: xsz=17.78 , ysz=12.7 (7" x 5").
         OFFSET=[x0,y0] : offset [cm] of lower left plot corner relat. to
                    "reference point" (lower left page corner if portrait,
                    upper right page corner if landscape);
                    default: [1.905,12.7] (7"x5" size portrait),
                             [1.905,26.035] (7"x5" size landscape),
                             [2.00,1.00] (/A4 or user- xsz,ysz ,portrait),
                             [1.00,27.70] (/A4 or user- xsz,ysz ,landscape). 
         /A4      : set xsz=18, ysz=27 ; ignore any xsz,ysz.
         /LANDSCAPE: if set, x-direction is parallel to the longer
                    paper size. Default : "portrait" mode.
         /COLOR   : if set, plot device is set to color-PostScript;
                    default: b/w-PostScript.
         /ENCAPSULATED : if set, an "encapsulated" PostScript-file
                    will be created, suitable for importing into another
                    document (e.g., TeX, LaTeX);
                    default: non-encapsulated PostScript.
 OUTPUTS:
       none
 COMMON BLOCKS:
       common ODEVCOM,old_device,old_backgrnd,old_color,old_chsz,pscolor,psenc
              string containing the old devive-name,
              background- & foreground color, character-size-factor of active
              device when entering PSS;
              pscolor: set =1 if case /color, else set =0;
              psenc: set=1 if case /encapsulated, else set =0.
              
 SIDE EFFECTS:
       plot-output generated by subsequent plot commands will be 
       written into file idl.ps until device is
       reset by calling procedure PSP.
 RESTRICTIONS:
       
 PROCEDURE:
       straight
 MODIFICATION HISTORY:
       nlte, ?
       nlte, 1991-08-13 : save !p.background, !p.color 
       hoba,nlte 1992-08-31 : optional input parameters xsz,ysz,/LANDSCAPE,/A4
       nlte, 1992-09-23 : keyword COLOR, variable character size
       nlte, 1993-06-18 : keyword ENCAPSULATED
       nlte, 1993-10-26 : keyword param. OFFSET

(See /supple/soft/rsi/idl_5/lib/kis-lib/pss.pro)


PWD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       PWD
 PURPOSE:
       Print the name of current working directory incl. it's full path
       (simulates UNIX command pwd).
*CATEGORY:            @CAT-# 40 28@
       Operating System Access , Programming
 CALLING SEQUENCE:
       PWD
 INPUTS:
       none
 OPTIONAL INPUT PARAMETERS:
 KEYWORD PARAMETERS:
 OUTPUTS:
       none
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
       1 print line to standard out.
 RESTRICTIONS:
 PROCEDURE:
       CD, CURRENT=current  ; CD is an IDL routine.
 MODIFICATION HISTORY:
       1993-Mar-15 nlte (KIS) created.

(See /supple/soft/rsi/idl_5/lib/kis-lib/pwd.pro)


RDCRS

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       RDCRS   
 PURPOSE:
       prints and optionally returns accumulated user-coordinates of graphic
       cursor if located in graphic window.
*CATEGORY:            @CAT-# 26@
       Plotting (interactive on screen)
 CALLING SEQUENCE:
       RDCRS [,xc [,yc] ] [,DELTA=delta]
 INPUTS:
       none  
 OPTIONAL INPUTS:
       DELTA = delta :  store cursor coordinates only if x or y has changed
                by more than . Meaningfull only if RDCRS is called 
                with xc,yc. Default: delta=0.
 OPTIONAL OUTPUTS:
       xc, yc = vectors containing coordinates of all cursor positions
                (user-coordinates) where a mouse button was clicked.      
 SIDE EFFECTS:
       cursor coordinates are "continuously" printed in command window;
       clicking middle button forces a new print line;
       clicking right button will exit procedure. 
 RESTRICTIONS:
       none
 PROCEDURE:
       calls IDL procedure CURSOR      
 MODIFICATION HISTORY:
       nlte (KIS), 1990-02-19 
       nlte (KIS), 1992-02-24 cursor mode /CHANGE if argument(s) specified,
                              else /DOWN; 
                              avoiding multiple output of identical positions.
       nlte (KIS), 1995-01-30 made compatible for IDL 3.6; continuos print
                              output in any case. Key-parameter DELTA.

(See /supple/soft/rsi/idl_5/lib/kis-lib/rdcrs.pro)


RDFITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RDFITS
 PURPOSE:
       Reads an FITS-CCD data-set either from ExaByte tape (e.g. written 
       by AT1/CCD-software) or from a disk-file and returns the data in an 
       ** IDL-structure ** (2- or 3-dim. image-array, comments, other 
       parameters stored in separate "structure-tags"). When reading from 
       tape, a disk-file with an unmodified copy of the FITS data-set will be
       created first. The image-data can be resampled (e.g. binning) in the 
       1st two dimensions ("x","y") before beeing loaded into the structure. 

 NOTE: If only a dump from ExaByte-tape to disk is wanted, call RDFITSA with
       no specification of an array to avoid unnecessary data transfers from
       disk to memory.

*CATEGORY:            @CAT-#  2 11@
       CCD Tools , FITS-Files
 CALLING SEQUENCE:
       RDFITS,ccd_structure [,file-name] [,/NOAPPEND] [,/EXABYTE]  ...
             ... [,/SKIP_FILE=n] [,/DELETE] [,/RESET] [,ERRFLAG=errflag]
 INPUTS:
       ccd_structure : IDL-structure containing the image-array and all
           relevant parameters (see description below under "OUTPUTS"). 
           If, on input, ccd_structure has the expected structure-format, and
           if keyword /RESET has not been set, this structure will be used 
           again; otherwise, the RDFITS will request the user to enter the
           format for the image-array and (new) sampling parameters.
           Examples (no /RESET in all cases):
               ccd=0
               rdfits,ccd, ...   RDFITS will create a structure & will query
                                 for parameters;
               rdfits,ccd, ...   RDFITS will use the same structure & 
                                 same size/sampling parameters again;
               ccd=0
               rdfits,ccd, ...   RDFITS is forced to re-create the structure &
                                 to query for new parameters.
 OPTIONAL INPUTS:
       file-name : string, name of FITS disk-file;
           If key /EXABYTE is **not** set, the name of an already existing
              disk-file (FITS-format) must be specified (absolute directory
              path or relative to actual working directory).  may
              contain "wild characters" (e.g. '*'); if more than one matching
              file is found, the user is requested to select one of the
              matching file names; if no file is found on 1st attempt, RDFITS
              will try again with '*' .
              If the (completed) file-name ends on '.gz' or '.CF', it is 
              assumed that the file was compressed by GZIP or COMPFITS; un-
              compressing will be done in this case before reading the file.
           If key /EXABYTE **is** set, file-name is optionally; 
              if file-name is specified, the FITS-file dumped from tape 
              will be named:
              //_[.].fits (or .fts)
              or, if keyword /NOAPPEND is set:
              //[.]
              where the directory path  will be taken from  if
              file_name contains a path or the "current working directory";
               will be derived from FITS-header keyword FILENAME 
              (if exists) and . will be selected from {000,001,...,999,
              1000,....,9999} to make the file name unique.
              If file-name is not specified, RDFITS will use
              '/-CCD_[.].fits' or (if /NOAPPEND
              is set) '/-CCD[.] as file-name.
       /NOAPPEND : key-word; if set, neither "FILENAME" from FITS-header 
              nor ".fits" will be appended to the output file name (only
              meaningful in case of /EXABYTE).
       /EXABYTE :  key-word; 
           ** If set **: 
              This procedure spawns a UNIX DD command to dump (and, on
              request, byte-swap) one data-set (header + image-array) from 
              ExaByte tape to disk. 
              If RDFITS is called for the 1st time with /EXABYTE set (or
              together with /RESET), the user is requested to enter host- 
              and device specific parameters.
           ** If this key-word is **not** set **: 
              Procedure reads file  directly from disk (no tape
              action). This disk-file must be a byte-swapped FITS-file.
       SKIP_FILE= n : Only meaningful if /EXABYTE was set.
           Before dumping a file from ExaByte, the tape will be forward-
           skipped over  files. Depending on the selected AT-write-mode,
           there is either 0 or 1 file-mark at the begin-of-tape and either 
           0, 1, or 2 file-marks between adjacent tape files.
           When called for the 1st time, RDFITS will consult the user how the 
           ExaByte was written. In case of 2 file-marks between files, it is 
           assumed, that the actual tape-position is either at begin-of-tape
           or between two adjacent eof-marks (this is the actual tape position
           after a file dump action). 
       /DELETE :   Only meaningful if /EXABYTE was set. 
           The FITS-disk-file dumped from tape will be removed after beeing 
           read in.
           If this key-word or key-word /EXABYTE is **not** set, the disk 
           file will **not** be deleted.
       /RESET :    If set, the procedure will request user to enter new infor-
           mations for ExaByte specific parameters (if /EXAB was set), 
           image-size, binning, etc. If not set, values from previous call of
           RDFITS will be used again. At 1st call, these parameters will be 
           requested in any case.
       
 OUTPUTS:
       ccd_structure : "anonymous" IDL-structure containing the 2- or 3-dim. 
           image and all relevant parameters; the structure will be created 
           if the calling program has **not** passed a structure of 
           appropriate format.
           Structure-tags:
           .status : string, status-info for image-data.
           .time   : string, start & end of exposure.
           .project: string, "general comment" of observer.
           .txt    : string, "image specific comment" of observer.
           .id     : integer, image-identification-number.
           .itime  : long integer, start_of-expos._time (sec since midnight). 
           .expos  : floating_point, length of exposure (sec).
           .par    : integer-array size=50, containing image parameters.
           .pic    : byte-, short- or long-integer-array containing the 
                     extracted image(s) (more than 1 in the 3-dim. case);
                     the 1st two dimensions are treated as spatial image co-
                     ordinates "x","y" and may be subject to resampling;
                     in the 3-dim. case, the 3rd dimension of the array
                     always has the same length as in the original data 
                     (=naxis3 = number of images in the "set").
                     The sizes of the 1st two dimensions can be chosen by 
                     the user; if the original image data do not fit into this
                     format, the user will be requested to specify how to 
                     extract part of the image or how to "rebin" it.
 OPTIONAL OUTPUTS:
       ERRFLAG=errflag : RDFITS returns an error-flag on return; errflg must
                       be a VARIABLE (NOT a constant) on call;
                       coding for errflag: 
                       0: successful return, 1: probably an eof found when
                       dumping from ExaByte-tape, 2: disc-file smaller than
                       2880 bytes, 3: other problems with reading the file,
                       -1: invalid input parameters.
 COMMON BLOCKS:
       COMMON FITSEXACOM,exab_host,exab_driv,dddir,neof1,neof2,nrecimg, ...
       ...  recsiz,swap,x0,y0,xmm,xm,ym,binx,biny,naxis1,naxis2,naxis3,bitpix,
       ...  n_head
           Serves to save some variables for subsequent calls and for transfer
           to auxillary routines within this file.  
           All variables are set by this procedure or in it's auxillary 
           routines.
       COMMON FITSEXACOM2,site_info,ddfildef,infildef,ddmsgfile,remhost
           For transfer to auxillary routines.
 SIDE EFFECTS:
       If this procedure is called for the 1st time within an IDL-session
       with key /EXABYTE set, the user is queried for the host-name of the
       worksation to which the ExaByte drive is attached (in a workstation-
       network, this is not necessarily the workstation on which the IDL-
       session is active);
       A disk-file (byte-swapped "FITS-format") is created if /EXABYTE is set 
       and /DELETE is not set;
       Interactive in/out-put to standard in/out; error messages on unit -2.
 RESTRICTIONS:
       Requires IDL version 3.0 or later.
       If IDL-session is active on an other workstation than the workstation
       at which the ExaByte drive is attached, "Networking software installa-
       tion option" of "Network Information Service (NIS) (formerly known as
       "Sun Yellow Pages") must be active. The disk partition of the file
       to be dumped from tape and/or to be read in to the IDL memory must
       be mounted both for the host of the IDL session and (in case of tape
       dumping) for the ExaByte-host.
 PROCEDURE:
       In case of /EXABYTE,/SKIP=n, UNIX-command MT will be spawned to skip
       over file-marks (if images are separated by file-marks) or to skip over
       m records (m calculated from n and number-of-records-per-image as 
       specified by user on request);
       In case of /EXABYTE, UNIX-command "DD" will be spawned to dump a data-
       set from ExaByte-tape and to process the data. These spawned actions 
       must be executed at the host to which the ExaByte-drive is attached; if
       the "ExaByte-host" is not the "local" host (on which this IDL-session
       is running), the UNIX-commands are spawned within a remote shell 
       command (remsh) to the "ExaByte-host".
       If DD-action was successful, the disk-FITS-file (which got a default 
       name) will be read in (associated read) and the FITS-header will be 
       interpreted by KIS_LIB-procedure FITS_HDR; the header-informations 
       will be stored into the appropriate structure-tags. 
       Image scissoring and/or binning will be done if requested by user
       or if the original image does not fit into the selected format of
       structure-array .pic . The user is requested by RDFITS to enter 
       parameters for this transformation whenever a new ccd_structure was 
       created, or the format of the image as read from disk has changed 
       from previous one. Note, that these image modifications will **not**
       affect the contents of the disk-file!
       Finally, if /DELETE was set, the disk-file created by dd will be 
       removed (spawning UNIX command "rm"), else UNIX command "mv" will be 
       spawned to rename the file.

       Data formats: 
       On ExaB-tape, the image data may have 8/16/32 bit/pix; in case of 
       16 byte/pix, the byte-order may be reversed (as written by AT1 with
       byte-swap off). In this case, the image data will be byte-swapped
       when being dumped from tape to disk. 
       On disk, the image data are expected to be in "regular" order (most 
       significant byte first); the bytes of the ASCII-header, however, may 
       or may not be "regular" (on tape, the header-bytes are always 
       "regular", this order will be reversed when the dd-dump action is per-
       formed with option "conv=swab"). When reading the header from the
       disk-file into memory, RDFITS will re-order the header bytes if neces-
       sary. 
       
 MODIFICATION HISTORY:
       1992-Apr-30  H. Schleicher, KIS
       1992-Jun-10  H. Schleicher, KIS: other default directories;
                                 ExaB-host other than venus, mars, daisy:
                                 ExaB-device name may be nrst* .
       1992-Aug-25  H. Schleicher, KIS: 
                                 code splitted in auxillary procedures +
                                 rdfits;  byte-swap can be supressed by
                                 user;
       1993-Feb-23 H. Schleicher, KIS: bug in DUMP_EXAB (case search); 
                                 bug in MAIN: if search gt 1 ...
                                 error messages on unit -2. 
       1993-Apr-08 H. Schleicher, KIS: included special case for
                                 stand-alone host GOOFY.
       1993-Jul-07 H. Schleicher, KIS: GOOFY ExaB-device name is nrst3,
                                 bug in search-loop.
       1993-Jul-21 H. Schleicher, KIS: ccd-structure anonymous, format of
                                  image array unrestricted now; keyword
                                  /NOAPPEND.
       1993-Jul-27 H. Schleicher, KIS: DEWEY ExaB-device name is nrst1.
       1993-Dec-08 H. Schleicher, KIS: allow for special ExaByte-drives
                                  to be attached at any workstation;
                                  DONALD ExaB-device name is rmt/0n. 
       1994-Mar-11 H. Schleicher, KIS: DEWEY ExaB-device name is nrst0.
       1994-Apr-07 H. Schleicher, KIS: MARS additional ExaB-device nrst2.
       1995-Mar-22 H. Schleicher, KIS: table host/ExaB-drives now read in
                                  from  $IDL_DIR/../idl_local/site_info.dat,
                                  also host of home-directory;
                                  get user-id from last part of $HOME if
                                  $USER is not set.
       1996-Jul-05  H. Schleicher, KIS: image-array bytarr, intarr or lonarr
                                        depending on BITPIX-value;
                                  3-dim. case; compression by gzip;
                                  accepts ".fts" as file-suffix.
       1996-Jul-12  H. Schleicher, KIS: bugs (input n_head,bitpix; 
                                              default fitssuff).
       1996-Nov-12  H. Schleicher, KIS: bug: x0,y0,... were not initialized
                                        under some circumstances
       1997-Jan_23  H. Balthasar, AIP: adoption to AIP

(See /supple/soft/rsi/idl_5/lib/kis-lib/rdfits.pro)


RDFITSA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RDFITSA
 PURPOSE:
       Reads an FITS-CCD data-set either from ExaByte tape (e.g. written 
       by AT1/CCD-software) or from a disk-file and returns the data in an
       ** array **. Comments and other parameters extracted from the FITS-
       header may be transferred via key-parameters. When reading from tape, 
       a disk-file with an unmodified copy of the FITS data-set will be 
       created first. The image-data can be resampled (e.g. binning) in the 
       1st two dimensions ("x","y") before beeing loaded into the array.

*CATEGORY:            @CAT-#  2 11@
       CCD Tools , FITS-Files
 CALLING SEQUENCE:
       RDFITSA,img_arr [,file-name] [,/NOAPPEND] [,/EXABYTE] ...
         ... [,FITS_HEADER=header] [,STATUS=status] [,PROJECT=proj] [,TXT=txt]
         ... [,ID=id], [,TIME=start] [,ITIME=itime] [,EXPOS=expos] 
         ... [,PARAMETERS=param_vect]
         ... [,/SKIP_FILE=n] [,/DELETE] [,/RESET] [,ERRFLAG=errflag]

 SPECIAL CALLING SEQUENCE for dumping from tape without loading image into
         array (memory):
       RDFITSA ,/EXABYTE [,file-name] [,/NOAPPEND] ... other keys as above
               (Note that setting /EXABYTE is mandatory and that no variable
                img_arr is allowed for this case!)

 INPUTS:
       img_arr : 2- or 3-dim array for storing the image (or set of images in
           case of 3-d). Type: byte, short- or long-integer, depending on 
           BITPIX-value). In the 3-d case, the first two dimensions are
           treated as the spatial ones (nx,ny).
           If, on input, img_arr is large enough to store the image (after
           applying binning/scissoring if already specified) and if keyword
           /RESET has not been set, the array will be used as it is.
           Otherwise, the procedure will request the user to enter a new 
           format for the array and (new) sampling parameters.
           Examples (no /RESET in all cases):
               img_arr=0
               rdfitsa,img_arr, ...  RDFITSA will create a new array and
                                    will query for sampling parameters;
               rdfitsa,img_arr, ...  RDFITSA will use the same array and
                                    same sampling parameters again;
               img_arr=0
               rdfitsa,img_arr, ...  RDFITSA is forced to re-create the array
                                    and to query for new sampling parameters.
           Special case with no image loading:
               rdfitsa,/exab        RDFITSA will dump a FITS-data-set from
                                    tape to disk, but the image (and infos
                                    from the FITS-header) will not be loaded
                                    into memory. This saves time if the image-
                                    array is very large (e.g. 3-dim case).
               rdfitsa,/exab,'FPI_',fits_h=fh 
                                    As above, but disk-file-name will be 
                                    modified by string 'FPI_' and the contents
                                    of the FITS-header will be stored into 
                                    string-array fh.
 OPTIONAL INPUTS:
       file-name : string, name of FITS disk-file;
           If key /EXABYTE is **not** set, the name of an already existing
              disk file (FITS-format) must be specified (absolute directory 
              path or relative to actual working directory).  may 
              contain "wild characters" (e.g. '*'); if more than one matching
              file is found, the user is requested to select one of the 
              matching file names; if no file is found on 1st attempt,
              RDFITSA will try again with '*' .
              If the (completed) file-name ends on '.gz' or '.CF', it is 
              assumed that the file was compressed by GZIP or COMPFITS; un-
              compressing will be done in this case before reading the file.
           If key /EXABYTE **is** set, file-name is optionally; 
              if file-name is specified, the FITS-file dumped from tape 
              will be named:
              //_[.].fits (or .fts)
              or, if keyword /NOAPPEND is set:
              //[.]
              where the directory path  will be taken from  if
              file_name contains a path or the "current working directory";
               will be derived from FITS-header keyword FILENAME 
              (if exists) and . will be selected from {000,001,...,999,
              1000,....,9999} to make the file name unique.
              If file-name is not specified, RDFITSA will use
              '/-CCD_[.].fits' or (if /NOAPPEND
              is set) '/-CCD[.] as file-name.
       /NOAPPEND : key-word; if set, neither "FILENAME" from FITS-header 
              nor ".fits" will be appended to the output file name (only
              meaningful in case of /EXABYTE).
       /EXABYTE :  key-word; 
           ** If set **: 
              This procedure spawns a UNIX DD command to dump (and, on
              request, byte-swap) one data-set (header + image-array) from 
              ExaByte tape to disk. 
              If RDFITSA is called for the 1st time with /EXABYTE set (or
              together with /RESET), the user is requested to enter host- 
              and device specific parameters.
           ** If this key-word is **not** set **: 
              Procedure reads file  directly from disk (no tape
              action). This disk-file must be a byte-swapped FITS-file.
       SKIP_FILE= n : Only meaningful if /EXABYTE was set.
           Before dumping a file from ExaByte, the tape will be forward-
           skipped over  files. Depending on the selected AT-write-mode,
           there is either 0 or 1 file-mark at the begin-of-tape and either 
           0, 1, or 2 file-marks between adjacent tape files.
           When called for the 1st time, RDFITSA will consult the user how
           the ExaByte was written. In case of 2 file-marks between files,
           is assumed, that the actual tape-position is either at 
           begin-of-tape or between two adjacent eof-marks (this is the actual
           tape position after a file dump action). 
       /DELETE :   Only meaningful if /EXABYTE was set. 
           The FITS-disk-file dumped from tape will be removed after beeing 
           read in.
           If this key-word or key-word /EXABYTE is **not** set, the disk 
           file will **not** be deleted.
       /RESET :    If set, the procedure will request user to enter new infor-
           mations for ExaByte specific parameters (if /EXAB was set), 
           image-size, binning, etc. If not set, values from previous call of
           RDFITSA will be used again. At 1st call, these parameters will be 
           requested in any case.
 OUTPUTS:
       img_arr: byte-, short- ,or long-integer array of 2 or 3 dimensions,
           containing the extracted image(s) (more than 1 in the 3-dim. case).
           The array will be (re-)created if the calling program has
           **not** passed an array of appropriate format.
           The first two dimensions of the array are treated as spatial image
           coordinates "x","y" and may be subject to resampling; in the 3-dim.
           case, the 3rd dimension of the array always has the same length as
           in the original data (=naxis3 = number of images in the "set").
           The sizes of the 1st two dimensions can be chosen by the user; if 
           the original image data do not fit into this format, the user will
           be requested to specify how to extract part of the image or how to
           "rebin" it.
 OPTIONAL OUTPUTS:
       FITS_HEADER=header : string-array containg the complete FITS header.
       STATUS=status : string "status-info" for image-data.
       PROJECT=proj : string "general comment" of observer.
       TXT=txt : string "image specific comment" of observer.
       ID=id : short integer, image-identification-number.
       TIME=start : string, start of exposure.
       ITIME=itime : long integer, start_of-expos._time (sec since midnight).
       EXPOS=expos : floating_point, duration of exposure (sec).
       PARAMETERS=param_vect : integer-array size=50, containing numeric
                     image parameters.
       ERRFLAG=errflag : RDFITSA returns an error-flag on return; errflg must
                       be a VARIABLE (NOT a constant) on call;
                       coding for errflag: 
                       0: successful return, 1: probably an eof found when
                       dumping from ExaByte-tape, 2: disk-file smaller than
                       2880 bytes, 3: other problems with reading the file,
                       -1: invalid input parameters.
 COMMON BLOCKS:
       COMMON FITSEXACOM,exab_host,exab_driv,dddir,neof1,neof2,nrecimg, ...
       ...  recsiz,swap,x0,y0,xmm,xm,ym,binx,biny,naxis1,naxis2,naxis3,bitpix,
       ...  n_head
           Serves to save some variables for subsequent calls and for transfer
           to auxillary routines within this file.  
           All variables are set by this procedure or in it's auxillary 
           routines.
       COMMON FITSEXACOM2,site_info,ddfildef,infildef,ddmsgfile,remhost
           For transfer to auxillary routines.
 SIDE EFFECTS:
       If this procedure is called for the 1st time within an IDL-session
       with key /EXABYTE set, the user is querried for the host-name of the
       worksation to which the ExaByte drive is attached (in a workstation-
       network, this is not necessarily the workstation on which the IDL-
       session is active);
       A disk-file (byte-swapped "FITS-format") is created if /EXABYTE is set 
       and /DELETE is not set;
       Interactive in/out-put to standard in/out; error messages on unit -2.
 RESTRICTIONS:
       Requires IDL version 3.0 or later.
       If IDL-session is active on an other workstation than the workstation
       at which the ExaByte drive is attached, "Networking software installa-
       tion option" of "Network Information Service (NIS) (formerly known as
       "Sun Yellow Pages") must be active. The disk partition of the file
       to be dumped from tape and/or to be read in to the IDL memory must
       be mounted both for the host of the IDL session and (in case of tape
       dumping) for the ExaByte-host.
 PROCEDURE:
       In case of /EXABYTE,/SKIP=n, UNIX-command MT will be spawned to skip
       over file-marks (if images are separated by file-marks) or to skip over
       m records (m calculated from n and number-of-records-per-image as 
       specified by user on request);
       In case of /EXABYTE, UNIX-command "DD" will be spawned to dump a file
       from ExaByte-tape and to process the data. These spawned actions must
       be executed at the host to which the ExaByte-drive is attached; if the
       "ExaByte-host" is not the "local" host (on which this IDL-session is 
       running), the UNIX-commands are spawned together with a remote shell-
       command (remsh) to the "ExaByte-host".
       If DD-action was successful, the disk-FITS-file (which got a default 
       name) will be read in (associated read) and the FITS-header will be 
       interpreted by KIS_LIB-procedure FITS_HDR; Extracted/interpreted 
       header-informations  will be stored into the appropriate optional
       output variables.
       Image scissoring and/or binning will be done if requested by user
       or if the original image does not fit into the selected format of
       the passed image-array. The user is requested by RDFITSA to enter 
       parameters for this transformation whenever a new image arra was 
       created, or the format of the image as read from disk has changed 
       from previous one. Note, that these image modifications will **not**
       affect the contents of the disk-file!
       Finally, if /DELETE was set, the disk-file created by dd will be 
       removed (spawning UNIX command "rm"), else UNIX command "mv" will be 
       spawned to rename the file.

       Data formats: 
       On ExaB-tape, the image data may have 8/16/32 bit/pix; in case of 
       16 byte/pix, the byte-order may be reversed (as written by AT1 with
       byte-swap off). In this case, the image data will be byte-swapped
       when being dumped from tape to disk. 
       On disk, the image data are expected to be in "regular" order (most 
       significant byte first); the bytes of the ASCII-header, however, may 
       or may not be "regular" (on tape, the header-bytes are always 
       "regular", this order will be reversed when the dd-dump action is per-
       formed with option "conv=swab"). When reading the header from the
       disk-file into memory, RDFITS will re-order the header bytes if neces-
       sary. 
       
 MODIFICATION HISTORY:
       1995-Mar-23  H. Schleicher, KIS: re-created from updated rdfits.pro
       1996-Apr-25  H. Schleicher, KIS: image-array bytarr, intarr or lonarr
                                        depending on BITPIX-value.
       1996-Jul-05  H. Schleicher, KIS: 3-dim. case, compression by gzip;
                                        accepts ".fts" as file-suffix.
       1996-Jul10   H. Schleicher, KIS: Special case "dumponly".
       1996-Jul-12  H. Schleicher, KIS: bugs (input n_head,bitpix; 
                                              default fitssuff).
       1996-Nov-12  H. Schleicher, KIS: bug: x0,y0,... were not initialized
                                        under some circumstances
       1997-Jan-23  H. Balthasar, AIP:  adoption to AIP/SOE 

(See /supple/soft/rsi/idl_5/lib/kis-lib/rdfitsa.pro)


RDTABELLE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       RDTABELLE
 PURPOSE:
       Reads from ASCII-file selected lines & columns of numeric data
       and returns the data in a 2-dim array (real).
*CATEGORY:            @CAT-# 14@
       I/O
 CALLING SEQUENCE:
       RDTABELLE,array [,FILE=file] [,COLUMNS=column-vect] [,LINES=line-vect]
                 [,FORM=format-string] [BAD_LINE=bad_value]
 INPUTS:
       none
 OPTIONAL INPUT PARAMETER:
       FILE=file : name of file to be read; if not set, procedure will
                   request user to enter a filename.
       COLUMNS=column-vect : single integer value or integer-vector with
                   indices of data-columns to be read in. "Data-columns" are
                   numeric sub-strings on an input-line separated by comma,
                   blank or tab. 
                   1st column has index =1; the number & values may not
                   exceed the number of columns in the data file.
                   in the data file. The read in data will be stored in array
                   according to the sequence in column-vect;
                   e.g: COLUMNS=[4,1,2] : there must be at least 4 data-
                   columns on each line in the data-file; array(*,0) will
                   store column 4, array(*,1) column 1, and array(*,2) col. 2;
                   column 3 of the file will not be stored. If column-vect
                   is a single integer, only one column will be stored.
                   If no column-vect specified, procedure will request user
                   to enter column-indices.
        LINES=line-vect : integer vector of size 2 containing 1st, last line
                   of data to be read in (1st line =1). 
                   Reading will stop at "last line or at "EOF"; to ensure that
                   all data lines will br read in, "last line" is allowed to
                   exceed the number of data lines in the file.
                   If not set, procedure will request user to enter a line-
                   range.
        FORM=format-string: If specified, formatted input will be performed;
                   the format-string must obey the IDL-rules for FORMAT and
                   must be compatible with the data-lines.
                   If not set: input is done with "Free Format".
        BAD_LINE=bad_value: If specified,  will be stored into
                   array(k,*) if an I/O-error was encountered for the k-th
                   input-line; on return, the size of 1st dimension of array
                   will be identical to the number of lines read in.
                   If not set: erroneous input-lines are ignored with no
                   increment of 1st index of array; on return, the size of
                   1st dimension of array will be shorter than the number of
                   input-lines read in if errors were detected.
 OUTPUTS:
       array :     2-dim floating-point array containing the data;
                   size of 1st dimension = number of (valid) data lines read
                   in; size of 2nd dimension = number of columns read in.
 OPTIONAL OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       Procedure will report number of valid data-lines read in,  
       EOF-detection, and line-numbers of invalid data-lines found.
 RESTRICTIONS:
       All data are interpreted as floating point; if a data-line contains
       less than expected number of data items, or if an I/O-error occurred
       when reading an input-line, this line will be ignored, but procedure
       will continue reading.
 PROCEDURE:
       Straight
 MODIFICATION HISTORY:
       nlte, 1991-Aug-08 

(See /supple/soft/rsi/idl_5/lib/kis-lib/rdtabelle.pro)


REFRAK

[Previous Routine] [Next Routine] [List of Routines]
 NAME: 
       REFRAK  
 PURPOSE:
       calculates the (diffrential) refraction for a set of wavelength
       in dependence of temperature, air pressure and humidity.
*CATEGORY:            @CAT-# 24@
       Observers Support
 CALLING SEQUENCE:
       REFRAK,wl,refra [,press=press] [,temp=temp] [,humi=humi]
 INPUTS:
       wl    = vector with wavelengths in Angstrom 
 OPTIONAL INPUT PARAMETER:
       press = pressure of air in TORR (=mm Hg)
               (default = 760 Torr)
       temp  = temperature in Celsius (centigrades)
               (default = 15 C) 
       humi  = partial pressure of water vapor  
               (default = 5.)
 OUTPUTS:
       refra = array with refraction values in arcsecs, 
               first index corresponds to 18 zenith distances from
               0 to 90 degrees in steps of 5 degrees.
               second index corresponds to wavelengths in WL.

 MODIFICATION HISTORY:
       H. Balthasar,   May 1992 (FORTRAN VERSION)
       hoba, March 1993, conversion to IDL
       nlte, June 1993, bug when wavelength(s) entered as integer.

(See /supple/soft/rsi/idl_5/lib/kis-lib/refrak.pro)


REPLIC1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	REPLIC1
 PURPOSE:
	Returns a 1-dim vector containing nrep replicates of a given 
       1-dim vector or scalar. The size of result is the size of the
       input vector times the number of replications.

 CATEGORY:            @CAT-# 0 28 41@
	Array Manipulation Routines , Programming , Array Creating
 CALLING SEQUENCE:
	result = REPLIC1 (vector,nrep)
 INPUTS:
	vector : a 1-dim array ("vector") or a scalar to be replicated.
	         If nrep is 1, the unmodified array will be returned (same
                format, even if not a 1-dim vector). vector may formally
                an array with more than 1 dimension with only one dimension
                of size greater than one, scince the vector will be reformed
                before beeing replicated.  
       nrep :   number of replications.
 OUTPUTS:
	a 1-dim vector (or, if nrep=1, the input array) containing nrep 
       replicas of the input vector. The type is that of the input vector.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	none
 NOTE:
       IDL-procedure REPLICATE replicates scalars only (filling into arrays of
       any format); REPLICAS (OTHER_CONTRIBS/KNIGHT) copies arrays, creating
       an array with one dimension more than the array to be copied.
 PROCEDURE:
	calls REPLICATE (IDL) if input vector is a scalar, else calls
       MAKE_ARRAY (IDL) to create an output vector of appropriate size and 
       same type as the input vector and copies the contents of the input
       vector nrep times into it.
 MODIFICATION HISTORY:
	nlte, 1996-11-05 

(See /supple/soft/rsi/idl_5/lib/kis-lib/replic1.pro)


ROOT3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ROOT3
 PURPOSE:
	root of cube within interval [x1,x2]
*CATEGORY:            @CAT-# 22@
	Mathematical Routines (no Functions)
 CALLING SEQUENCE:
	x0 = ROOT3 (coef,x1,x2)
 INPUTS:
	coef  : 1-dim vectore of size 4 containing the coefficients
	        of the cube :
               coef(0) +coef(1)*x +coef(2)*x^2 +coef(3)*x^3
	x1,x2 : boundaries where root shall be searched (x1 < x2).
 OUTPUTS:
	x0 = root (if found; else: x-value of final iteration step).
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	Warning message if root not found within intervall
 RESTRICTIONS:
	Iteration will be stopped after 20 steps.
 PROCEDURE:
	Newton-iteration
 MODIFICATION HISTORY:
	nlte, 1990-03-17 

(See /supple/soft/rsi/idl_5/lib/kis-lib/root3.pro)


RUN_AV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	RUN_AV
 PURPOSE:
	Returns running average of a 1-dim. scan.
       (Equivalent with RUN_AV1 from KIS_LIB with BOUNDARY=1 .)
*CATEGORY:            @CAT-# 30 12  0@
	Smoothing , Filtering , Array Manipulation Routines
 CALLING SEQUENCE:
	result = RUN_AV ( scan, n_half )
 INPUTS:
	scan    : 1-dim vector of input data.
	n_half : half-width of running window (average over i-n_half,...,
                i+n_half for i-th point of scan).
 OUTPUTS:
	result : 1-dim vector (same type and size as scan) containing 
	         the smoothed data.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:  
       
 REMARKS:  
        Use RUN_AV2 if 2-dim data shall be smoothed by a running average
        in one direction for each position of the other direction,
        which is faster than calling RUN_AV within a loop.
        RUN_AV1 from KIS_LIB with BOUNDARY=1 is equivalent to RUN_AV.
 PROCEDURE:
	straight
 MODIFICATION HISTORY:
       nlte, 1994-12-01
       nlte, 1995-08-15 : include type double precision complex 

(See /supple/soft/rsi/idl_5/lib/kis-lib/run_av.pro)


RUN_AV1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	RUN_AV1
 PURPOSE:
	Returns running average of a 1-dim. scan.
*CATEGORY:            @CAT-# 30 12  0@
	Smoothing , Filtering , Array Manipulation Routines
 CALLING SEQUENCE:
	result = RUN_AV1 ( scan, n_half [,BOUNDARY={0|1|2}] )
 INPUTS:
	scan    : 1-dim vector of input data.
	n_half : half-width of running window (average over i-n_half,...,
                i+n_half for i-th point of scan).
 OPTIONAL INPUTS:
       BOUNDARY =0 : (or not set) average-interval increasing from 0 to
                    full interval size at the first and last +1 
                    points;
                =1: fixed average-interval of constant full size at
                    boundary (constant values for the first and last 
                    +1 points of result);
                =2: running average-interval of constant full size for
                    full running-range; intervall points outside the
                    boundaries of thge input-array will be replenished by
                    "mirroring".
 OUTPUTS:
	result : 1-dim vector (same type and size as scan) containing 
	         the smoothed data.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:  
       
 REMARKS:  
        Use RUN_AV2 if 2-dim data shall be smoothed by a running average
        in one direction for each position of the other direction,
        which is faster than calling RUN_AV1 within a loop.
        RUN_AV from KIS_LIB is equivalent to RUN_AV1 with BOUNDARY=1 .
 PROCEDURE:
	straight
 MODIFICATION HISTORY:
       nlte, 1994-12-01
       nlte, 1995-08-15 : include type double precision complex 

(See /supple/soft/rsi/idl_5/lib/kis-lib/run_av1.pro)


RUN_AV2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	RUN_AV2
 PURPOSE:
       Smoothes data of a 2-dim. input array by running average (1-dim.) 
	along rows or columns for each column or row.
*CATEGORY:            @CAT-# 30 12  0@
	Smoothing , Filtering , Array Manipulation Routines
 CALLING SEQUENCE:
	result = RUN_AV2 ( img, n_half [,idir] [,BOUNDARY={0|1|2}] )
 INPUTS:
	img    : 2-dim array of input data.
	n_half : half-width of running window (average over i-n_half,...,
                i+n_half for i-th point in running-direction).
 OPTIONAL INPUTS:
       idir   : dimension of array img of running average direction
                =1 (default): running average along rows (1st dim) for each
                   row;
                =2: running average along columns (2nd dim) for each column.
       BOUNDARY =0 : (or not set) average-interval increasing from 0 to
                    full interval size at the first and last +1 
                    points;
                =1: fixed average-interval of constant full size at
                    boundary (constant values for the first and last 
                    +1 points of result);
                =2: running average-interval of constant full size for
                    full running-range; intervall points outside the
                    boundaries of thge input-array will be replenished by
                    "mirroring".

 OUTPUTS:
	result : 2-dim array (same type and size as img) containing 
	         the smoothed data.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	Input array must be 2-dimensional; call RUN_AV1 for 1-dim. input.
 PROCEDURE:
	straight
 MODIFICATION HISTORY:
       nlte, 1994-12-01 
       nlte, 1995-08-15 : include type double precision complex

(See /supple/soft/rsi/idl_5/lib/kis-lib/run_av2.pro)


SHEAR_IMG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHEAR_IMG
 PURPOSE:             
       De-shears images, e.g. spectra with tilted entrance slit or
       curved lines due to optical problems.
 CATEGORY:            @CAT-#  0 16 29@      
       Arr+VectBasic, ImageProcessing, Resampling
 CALLING SEQUENCE:
       cimg = SHEAR_IMG(img,beta [,dir] [,FIXPOS=r0] [,FILL=fill_value] ...
                        ... [,POLY=polyc] [{,/SHIFT | ,SPLINE=tension}])
 INPUTS:
       img   : 2-dim array containing the sheared image
       beta  : shear angle (degrees) if shear-displacement shall vary 
               linearly along "non-sheared" direction, -90 < beta < 90
               (see keyword POLY for non-linear shearing);
               dir=1: a line clockwise inclined by beta with y-axis
                      will become parallel to y-axis after de-shearing
                      (shift in x-dir);
               dir=2: a line counter-clockwise inclined by beta with x-axis
                      will become parallel to x-axis after de-shearing
                      (shift in y-dir);
             
 OPTIONAL INPUT PARAMETER:
       dir   : integer =1: shear direction is 1st dimension of img ("x")
                       =2: shear direction is 2nd dimension of img ("y")
                       (default: dir=1).
       /FIXPOS=r0 :    this position (row if dir=1, column if dir=2) will 
                       remain unshifted; ignored if shifts are defined
                       by a polynom (key-parameter POLY, see below);
                       default: central position in non-shear direction.    
       /SHIFT :        if set, shearing will be done by shifting (no inter-
                       polation, keyword parameter SPLINE will be ignored 
                       if also set).
       SPLINE=tension : if set, interpolation is done using IDL function
                       SPLINE with tension as specified;
                       if key-parameter not specified, linear interpolation 
                       will be done.
       FILL=fill_value : the specified value will be taken for those
                       points of returned image which origin from
                       outside of the input image;
                       Default: take value of corresponding edge-point
                       for filling.
       POLY=polyc      To be specified if non-linear shearing is requested
                       e.g. to straighten curved spectral lines; 
                       vector  contains the polynomial coefficients
                       for dx(y) (dir=1) or dy(y) (dir=2). The values 
                       specified by input variable beta or keyword FIXPOINT
                       have no meaning in this case (however, beta must be 
                       set with a dummy by formal reasons). The user must
                       take care that the shifts defined by  varies
                       around zero in order to avoid unnecessary losses
                       of image information.
                       
 OUTPUTS:
       returns de-sheared image, returned array same size as on input;
 OPTIONAL OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       
 RESTRICTIONS:
       
 PROCEDURE:
       If shear-direction is 1st dimension "x" (dir=1) (else same actions
       in the other direction):
       For each y-row j the necessary x-shift dx(j) (fractional value)
       will be calculated;
       If /SHIFT is not set: 
          Linear or spline interpolated pixel value of img(i+dx(j), j)
          will be stored to result(i,j) (i=0,...,nx-1); if i+dx(j) falls
          outside the array boundaries, result(i,j) will be set as described
          for keyword FILL.
       IF /SHIFT is set: 
          The j-th row of img will be shifted by -NINT(dx(j)) calling 
          IDL-routine SHIFT. Pixels from outside the original img will be
          set as described for keyword FILL.

       Note that shifting is faster than interpolation but will create 
       stair-case effects in the returned array.        

 EXAMPLES:
       Example 1:
       Spectral lines tilted by 10 deg perpendicular to dispersion
       (1st dim of image-array img0) can be made perpendicular by calling:
       img1 = SHEAR_IMG(img0,10.)  ; linear interpolation, filling with
                                       pixel values at orig. margin, the
                                       central image row will be unshifted.
       The spectral lines in img1 can be made tilted again by:
       img2 = SHEAR_IMG(img1,-10.) ; img2 should be alike img0 beside margin
                                     effects.
       Example 2:
       The dispersion is the 2nd dimension of array img0 and the center of
       a typical spectral line varies along 1st dimension (slit-position)
       y_center(x)=poly(x,coefs) (coefs may be obtained from POLY_FIT, e.g.),
       then the lines can be straightened by:
       coefs(0)=coefs(0)-avg(y_center)       ; !! to avoid a net displacement
       img1 = SHEAR_IMG(img0,0,2,POLY=coefs) ; note that 3rd arg. has been
                                          set =2 to shift in 2nd dim of img0
                                          and that 2nd arg is just a dummy.
       To make the spectral lines curved again:
       img2 = SHEAR_IMG(img1,0,2,POLY=-coefs)
       
       Timing: Fastest mode is shearing by integer-shifting (8 sec),
               second is linear interpolation (the default) (15 sec),
               spline-interpolation is very slow (492 sec).
               (time measured on SUN 10/402 for a 1024x1024 integer 
               image array, lin. interpol., POLY-case).

 MODIFICATION HISTORY:
       hoba (KIS)  92-jan
       nlte (KIS)  93-jan-20 shearing x- or y-direction, 
                             options SPLINE, FILL.
       nlte (KIS)  93-oct-23 option FIXPOS.
       hoba (KIS)  94-nov-22 option POLY.
       nlte (KIS)  94-nov-25 fast linear interpolation (no call to INTERPOL)

(See /supple/soft/rsi/idl_5/lib/kis-lib/shear_img.pro)


SHFT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SHFT
 PURPOSE:
	Shift 1-dim vector a by d integer-positions, no wrap around
*CATEGORY:            @CAT-#  0@
	Array & Vector Manipulation
 CALLING SEQUENCE:
	result = SHFT (a , m)
 INPUTS:
	a : 1-dim vector to be shifted
       d : integer (or real), shift by m=nint(d)
           if < 0, result is vecor a shifted to the "left"
           ( returns copy of a if m=0)
 OPTIONAL INPUT PARAMETER:
	none
 OUTPUTS:
	shifted vector. Same size & type as input a. With m=nint(d):
           If m >0, the first  elements of result are copies of a(0);
           if m <0, the last  elements of result are copies of a(last).
 OPTIONAL OUTPUTS:
	none
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	
 PROCEDURE:
	calls IDL routine SHIFT, copies 1st & last  elements.
 MODIFICATION HISTORY:
	nlte, 1989-11-15
       nlte, 1993-11-01 shift parameter input may be real.  

(See /supple/soft/rsi/idl_5/lib/kis-lib/shft.pro)


SHFTCORX_AB_XY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SHFTCORX_AB_XY
 PURPOSE:
       Correlation b(x+dx,y) vs. a(x,y) in x-dim "row by row" by shifting
       b(x,y) in x-dir by dx= +-m x-steps ("a" x-scale).
       The correlation coefs for the 2*m+1 x-shifts will be returned
       for each "b"-row or (if /MAXCOR is set) the maximal values and the 
       corresponding x-lags. x,y-scales can be interpolated on common equi- 
       distant scales. 
*CATEGORY:            @CAT-#  4 16@
       Correlation Analysis , Image Processing
 CALLING SEQUENCE:
       SHFTCORX_AB_XY ,xa,ya,aa, xb,yb,bb, correl ...
                ... [,CSHIFT=m] [,MAXCOR=method] [,XRANGE=tr] [,TREND=deg] ...
                ... [,INTERPOL={0|1|2}] [,SPLINE=tens] [,/VERBOSE]
 INPUTS:
       xa  vector x-scale for 1st dim of array aa; must monoton. increase;
           size must be same as 1st dim of aa.
           If not (nearly) equidistant, INTERPOL=2 should be specified
           so that a(x) will be interpolated on an equidistant x-scale.
       ya  vector y-scale for 2nd dim of array aa; must increase or decrease
           monotonically; 
           size must be same as 2nd dim of aa; if aa is 1-dim, ya is unused
           but an argument must formally be specified.
       aa  1- or 2-dim array, its 1st dim is to be correlated with that of bb.
       xb, yb, bb : same for other array to be correlated (bb will be shifted
           in the 1st (x-) dimension);
           "b" may have other sizes & step-widths than "a";
           if xb is not identical to xa, INTERPOLATE=1 or =2 should be set.
 OPTIONAL INPUT PARAMETER:
       CSHIFT = m : amount of shift for determination of correl.-coefs:
           bb(x,y) is shifted from -m to +m x-steps (equidist. xa-scale) to 
           compute 2*m+1 correl.-coefs. Default: m=5.
       MAXCOR = {1|2|3}: if set, the maximum of the correl.-coefs will be 
           returned instead of the coefficients. 
           Methods:
           =1: fit a cube around the maximal corr.-coef. and compute its 
               maximum;
           =2: compute "center of gravity" of all corr.-coefs. > 0.1*c_max
           =3: maximum of corr.-coefs. only (will always be returned if
               MAXCOR is set).
       XRANGE = [x_start,x_end] : cut aa,bb for x-values outside this range
           before doing correlation. Default: cut to overlapping x-range.
       TREND = deg : subtract trend (fit-polynom degree=deg) for each row 
           before doing the correlation (default: no trend subtraction).
       INTERPOLATE = i : interpolation in x-direction:
          i=0  : no interpolation (both xa and xb are assumed to be
                 identical and equidistant) (this is default);
          i=1  : interpolate b(xb,*) on the x-grid of xa (xa should be nearly 
                 equidistant);
          i=2  : interpolate both b(x,*) and a(x,*) on an equidistant x-scale;
                 this is recommended if xa is not equidistant. The step-width
                 of this equidistant x-scale is the average step-width of the
                 input xa-scale.
       SPLINE = tens : x-interpolation of "x-b" onto x-scale of "a" by SPLINE
           with tension factor tens; if not set (or tens <=0.) do linear 
           interpolation; meaningless if INTERPOLATE=0.
       /VERBOSE : If set, some parameters are printed out.
       
 OUTPUTS:
       correl : 1- or 2-dim. array: 
           Default (if keyword /MAXCOR NOT set):
                correl(j,k) =correlation coef. of 
                     shift(bb(*,j),d) vs. aj(*) , d=-m...+m, j=0,...,ny_b -1
                (0 <= k <= 2*m) where aj is the row of aa corresponding to 
                bb-row j (ya(?)=yb(j)) (after linear interpolation of aa in y
                onto yb-scale).
                For the 2-dim case, the size of the 1st dim of correl is
                1 + ny_b (ny_b = size of 2nd dim. of bb);
                for j=ny_b, correl(ny_b,k) are the row-averaged correlation
                coefficients.
                The correl.-coefs are set zero for bb-rows outside the 
                y-range of aa.
           If MAXCOR IS set:
               for all bb-rows j=0,...,ny_b-1 and for the row-average of the 
               correl.-coefs. (j=ny_b) (see above description of the default 
               case):
               correl(j,0) = maximal value of the 2*m+1 correlation coefs;
               correl(j,1): x-lag corresponding to this maximum;
               correl(j,2): x-lag corresponding to the maximum of a cubic
                   fit or of "center of gravity" of the correl.-coefs. around 
                   the maximal correl.-coef.
               correl(j,3): flag; =0.:  all correl.-coefs < 0;
                                  =0.1: fit was possible but its maximum is
                                        50% outside the shift range,
                                  =0.2: too few coefs >0 around maximum,
                                        maximum itself is taken;
                                        shift-range boundary +50% was taken.
                                  =0.5: no fit possible or cube has no max,
                                        "center of gravity" instead of max;
                                  =1.:  regular (maximum of cube found).
 OPTIONAL OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       Messages to standard printout if /VERBOSE is set.
 RESTRICTIONS:
       x-scales must increase monotonically, 
       y-scales must BOTH either increase or decrease monotonically;
       x- & y-ranges of aa, bb must overlap. 
       (Restrictions for y-scales only for 2-dim. case)
 PROCEDURE:
       If aa, bb are 2-dim., aa will be interpolated linearly onto yb-scale
       (calling LININT from KIS_LIB).
   For each b-row (or for the one row in 1-dim. case):
     ** Linear or spline interpolation of b-row onto xa-scale (LININT from 
        KIS_LIB or SPLINE from IDL USER-LIB).
     ** Subtraction of linear trends both for a- & b-row to be correlated.
     ** Successive shifts along x of row b + correlation (COR from KIS_LIB)
     ** and, if MAXCOR was set:
        If MAXCOR=1: determine suitable range around peak of correlation
          and fit a cube through this peak (in case m=1, there are only 3 
          points and the parabola through these points is computed).
          and the parabola throu these points is computed).
          The maximum of the cube is computed from the cube coefficients;
          if cube has no maximum or if correlation peak is ill defined,
          the "center of gravity" of all correl.-coefs cc > max(cc)/3 
          is calculated.
        If MAXCOR=2: The "center of gravity" sum{dx*cc}/sum{cc} is computed 
          for all corr.-coefs. cc > max(cc)/3.
 MODIFICATION HISTORY:
       nlte, 1990-04-24 (vtt_greg_cor)
       nlte, 1993-09-24 generalized code, documentat., > shftcorx_ab_xy.pro 
       nlte, 1994-12-16 faster code for linear interpolation (LININT).

(See /supple/soft/rsi/idl_5/lib/kis-lib/shftcorx_ab_xy.pro)


SIMPS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SIMPS
 PURPOSE:
	Returns [f(0)+4*f(1)+2*f(2)+4*f(3)+...+4*f(n-1)+f(n)]/3
	        = Simpson-integral of **vector** f if sampled equidistant
		  with stepwidth =1.
       (See also function "SIMPSON" in "USER_LIB" which returns
	 the value of a definite integral of a ** function ** (user-
	 written code accepting 1 argument)
*CATEGORY:            @CAT-#  9@
	Integration
 CALLING SEQUENCE:
	sum = SIMPS(f)
 INPUTS:
	f : 1-dim array of function values; size: >= 3, should be
	    odd if f(n) contributes significantly to the result.
 OUTPUTS:
	sum : value of Simpson-sum.
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	none
 PROCEDURE:
	straight foreward
 MODIFICATION HISTORY:
	nlte, 1990-03-17 
	nlte, 1992-07-13 name changed from SIMPSON to SIMPS to avoid 
	                 conflict with IDL-USER_LIB.

(See /supple/soft/rsi/idl_5/lib/kis-lib/simps.pro)


SMOOTHER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       SMOOTHER
 PURPOSE:
       Returns a smoothed copy of the input data. 
*CATEGORY:            @CAT-# 30  5@
       Smoothing , Curve fitting
 CALLING SEQUENCE:
       result = SMOOTHER( data [,p1] [,p2] [,keywords] )
 INPUTS:
       DATA  : (1 or 2-dim) array to smooth. Shoud be
               ***  EQUIDISTANT  ***
 OPTIONAL INPUT PARAMETER:
       p1,p2 : smooth-parameters as described below. Default to 10
 KEYWORDS:
       SMOOTHDIM= 1 | 2  : For 2-dim arrays, the dimension for wich the
                    smoothing should be performed. Possible values are
                    1 for (horizontal) x-direction and 2 for (vertical)
                    y-direction. Default is 1 (horizontal).
       /DOUBLE    : For 2-dim arrays: Perform a double pass smoothing,
                    i.e. first in vertical, then in horizontal
                    direction. Actually, it makes no difference whether
                    smoothing is applied first in x and then in y or
                    vice versa. Nevertheless, you can specify both the
                    DOUBLE and SMOOTHDIM keyword. Smoothing will then
                    be done first in the direction orthogonal to the
                    specified one. This is, if you call with
                    SMOOTHDIM=2 and /DOUBLE, first pass smoothing will
                    be in horizontal, and second pass in vertical
                    direction. 
       /INIT      : must be set if SMOOTHER is called for the 1st time with
                    NEW data-format, and/or new values for p1, p2, 
                    AND the result of the LU-decomposition SHALL BE RETURNED
                    TO THE USER. 
                    If this is an other call to SMOOTHER with the SAME
                    data-format and p1, p2, this key should NOT be set
                    in order to save computing time.
       AU=au, AL=al, INDX=indx : 
                    Passes the upper and lower triangular matrices and
                    the permutation vector index of the LU decomposition
                    of the bandmatrix A to the user (output!) if keyword 
                    INIT IS set or (if INIT NOT set) again as input to 
                    SMOOTHER, resp. This is particularly usefull if the 
                    user wishes to smooth different datasets of 
                    ** SAME LENGTH ** and with the same set of parameters 
                    P1,P2. The main computational work of this routine 
                    lies in the LU-decomposition of the matrix that 
                    describes the linear equation system. This matrix 
                    depends only on the parameters P1, P2 and the length 
                    of the dataset. Therefore one can call SMOOTHER once 
                    with keywords AU=au,AL=al and /INIT set. For later use, 
                    passing AL and AU with INIT NOT set will skip the 
                    computation of the LU decomposition and will save a 
                    lot of time.
 OUTPUTS:
       result : array of same dimension and type as array data with the
                smoothed data.
 SIDE EFFECTS:
       Temporary diskfiles are created.
 RESTRICTIONS:
       
 PROCEDURE:
       This is an IDL-implementation of a FORTRAN code written by U.
       Grabowski (Kiepenheuer-Institut fuer Sonnenphysik, FRG). It
       minimizes the following functional:  

       SUM { (Yi-Fi)^2 + p1*[(F"i-F"i-1)^2 + (F"i-F"i+1)] + p2*(F"i)^2 }

       where i (i=1...n) denotes the index of the point, Y the data
       values F the points of the smoothed data set and F" the second
       derivative. 
       p1 and p2 are parameters the user is free to choose
       according to his personal requirements. It is recommended to
       begin with both values equal and of order 1 to 10. Larger values
       force the routine to generate a smoother approximation.  Both
       values zero will mainly reproduce the original data set. Setting
       p1 larger than p2 reduces the variation of the curvature from
       point to point, p2 greater than p1 forces the routine to find a
       smoothed set with a small curvature.  
       Remark: For fitting of spectral data it is recomended NOT to use
       large values for P2.  This is because a small curvature produces
       a bad fit of the line center of spectral lines or other features
       with localy high (true) curvature.

 MODIFICATION HISTORY:
       Dec 1992    Basic idea and FORTRAN-subroutine from U.Grabowski
       18-02-1993  First IDL-Implementation: Calling an external
                   Program. FORTRAN main routine by U.Grabowski,
                   IDL-code P.Suetterlin
       28-02-1993  Solution of the band-diagonal equation system in
                   IDL (routines BANDEC and BANBKS from Numerical
                   Recipes)                                  PS

(See /supple/soft/rsi/idl_5/lib/kis-lib/smoother.pro)


SMSPLINE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SMSPLINE
 PURPOSE:
	Smoothing a 1-dim scan by a spline; the spline-nodes
	are determined by least-square-cubes fitted thru
	segments of the scan.
*CATEGORY:            @CAT-# 30  5@
	Smoothing , Curve Fitting
 CALLING SEQUENCE:
	smooth = SMSPLINE (scan [,tens] [,nodes] [,xspl] [,/PLOT] )
 INPUTS:
	scan   : 1-dim vector of data to be smoothed.
 OPTIONAL INPUT PARAMETER:
	tens : "tension"-parameter used for spline:
	       tens -> 0 : spline -> cubic spline,
	       tens -> inf (e.g. 20): spline -> polygon;
	       default: tens=5.
       nodes: number of spline nodes to be used;
	       default: nodes = max([3,n/20]), n=number of data.
       xspl : real-vector containing x-positions for spline-nodes,`
	       (x-scale == subscripts of data);
	       default: equidistant nodes.
       /PLOT: if set, the scan-data, the spline-nodes, and the spline
	       will be plotted. 
 OUTPUTS:
	smooth: vector of spline-values (at each scan-point).
 OPTIONAL OUTPUTS:
	tens, nodes,xspl : as used for smoothing.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	A color-plot if /PLOT was set.
 RESTRICTIONS:
	scan must contain enough values (more than 3 per node).
 PROCEDURE:
	a) at each node-position: least-square cube from next node
	   "to the left" to next node "to the right" (using "POLY_FIT"
	   from IDL-USER's Library);
	   y-value of spline-node = value of cube at node-position.
       b) spline with "tension" thru spline-nodes (using "SPLINE"
	   from IDL-USER's Library).
 MODIFICATION HISTORY:
	nlte, 1990-03-17
       nlte, 1993-03-29  colored overplot only if !d.table_size > 0 

(See /supple/soft/rsi/idl_5/lib/kis-lib/smspline.pro)


STATIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	STATIST
 PURPOSE:
 Invokes IDL-routine "help",
	prints minimum, maximum, r.m.s., and arithmetic mean 
	of data.
*CATEGORY:            @CAT-# 33@
	Statistics
 CALLING SEQUENCE:
	STATIST,data
 INPUTS:
	data : 1- or more-dimensional array containing numerical
	       data.
 OUTPUTS:
	none
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	print line to standard output.
 RESTRICTIONS:
	none
 PROCEDURE:
	straight (using IDL-routines help,min,max)
 MODIFICATION HISTORY:
	nlte, 1990-03-17 
	nlte, 1992-02-05  on_error
       nlte, 1995-06-30  no call to former IDL-routine stdev

(See /supple/soft/rsi/idl_5/lib/kis-lib/statist.pro)


STDEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	STDEV

 PURPOSE:
	Compute the standard deviation and, optionally, the
	mean of any array.

*CATEGORY:            @CAT-# 33@
	Statistics

 CALLING SEQUENCE:
	Result = STDEV(Array [, Mean])

 INPUTS:
	Array:	The data array.  Array may be any type except string.

 OUTPUTS:
	STDEV returns the standard deviation (sample variance
	because the divisor is N-1) of Array.
		
 OPTIONAL OUTPUT PARAMETERS:
	Mean:	Upon return, this parameter contains the mean of the values
		in the data array.

 COMMON BLOCKS:
	None.

 SIDE EFFECTS:
	None.

 RESTRICTIONS:
	None.

 PROCEDURE:
	Mean = TOTAL(Array)/N_ELEMENTS(Array)
	Stdev = SQRT(TOTAL((Array-Mean)^2/(N-1)))

 MODIFICATION HISTORY:
	DMS, RSI, Sept. 1983.
       nlte, KIS, 29-june-1995 copied from IDL 3.6 lib/stat 

(See /supple/soft/rsi/idl_5/lib/kis-lib/stdev.pro)


TVBS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	TVBS
 PURPOSE:
	Byte-scales array values (min, max or as specified) to a 
       user-specified range of color indices and displays array onto device. 
       Note:
       TV,BYTSCL(arr,low,high) scales always [low,high] to [0,255] ,
       TVSCL,arr scales [min(arr),max(arr)] to [0,!d.table_size-1] .
*CATEGORY:            @CAT-# 15@
	Image Display
 CALLING SEQUENCE:
	TVBS ,arr [,low,high] [,CRANGE=crange] [,OFF=xyoff]
 INPUTS:
	arr  : 2-dim image array to be scaled & displayed.
 OPTIONAL INPUT PARAMETER:
	low, high  : scale array values such that [low,high] -> color-range;
                    def.: low=min(arr), high=max(arr).
       CRANGE = [first_color, last_color] : the color-range (color-indices);
                first_color >= 0, last_color < !d.table_size ;
                default: [c1,!d.table_size-2] for color-devices with more than
                         64 colors (c1 =2 if no "special colors" are
                         stored in c.t.-locations 2 ff, else the lowest
                         c.t.-location where no "special color" is stored);
                         [0,!d.table_size-1] for other color devices;
                         [0,255] for b/w-devices, assuming dithering is 
                         activated.
       OFF = [xoff, yoff] : off-sets in x- and y-direction.          
 OUTPUTS:
	none
 COMMON BLOCKS:
	COMMON COLSTO_COM, colnams,colsindx
              set by COLOR, COLSTO, LCT "special colors"
 SIDE EFFECTS:
	Displays scaled image onto device.
 RESTRICTIONS:
	
 PROCEDURE:
	Determins scaling parameters; TV,scaled_image [,xoff(0),yoff(0)]
 MODIFICATION HISTORY:
	nlte, 1996-Mar-15 

(See /supple/soft/rsi/idl_5/lib/kis-lib/tvbs.pro)


UNCOMPRESS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	UNCOMPRESS
 PURPOSE:
	un-compresses (FITS-)files (16 bit images) which were compressed by
	IDL-KIS_LIB-procedure COMPRESS or by program COMPFITS.
*CATEGORY:            @CAT-# 11 37@
	FITS-Files , Tools
 CALLING SEQUENCE:
	UNCOMPRESS,filename [,HOST=remote_host] [,/OPTIONS=opt_string]
 INPUTS:
	filename: (string) name of (FITS-)file(s) to be un-compressed. Only
		  files ending on ".CF" will be un-compressed; if 
		  does not end on ".CF", the routine will append this suffix
		  internally.
		  If filename contains "wild characters", all matching files 
		  which end on ".CF" will be un-compressed. 
		  The name of the un-compressed file(s) will be obtained from
		  the compressed one(s), but with ".CF" omitted, overwriting
		  any existing file(s) of this name. The compressed files
		  will be removed.
 OPTIONAL INPUT PARAMETER:
	HOST=remote_host : (string) if set, the compressing program (COMPFITS)
		  will be executed remotely on host  to avoid 
		  net file transport.
	OPTIONS=opt_string : options passed to compressing program COMPFITS,
		  see man-pages of COMPFITS for details. Option -d will 
		  be passed in any case; do **not** specify -q (quiet mode)
		  Example:
		  OPTIONS='-nv' : n indicates non-Fits-file, v "verbose";
		  Default: COMPFITS is called with:
		                    -d(n) -f .CF -F 
		  -n is omitted if filename ends on '.fits.CF' .
		  (COMPFITS reads the parameters which were used for 
		  compression from the FITS-header, therefore **no** such
		  values must be specified for un-compression).
 OUTPUTS:
	none
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	Un-compressed file(s) will be created, compressed version deleted
	if action was successful; messages from COMPFITS to standard-output.
 RESTRICTIONS:
	see man pages for COMPFITS
 PROCEDURE:
       For each matched filename ending on .CF :
	spawns compfits -d -f .CF -F  [opt_string] ;
	checks compfits-messages for string 'Expanded:'; if found, the
	compressed file(s) will be removed assuming that COMPFITS-action
	was successful.
 MODIFICATION HISTORY:
	nlte (KIS), 1992-04-27

(See /supple/soft/rsi/idl_5/lib/kis-lib/uncompress.pro)


UNSHMASK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	UNSHMASK
 PURPOSE:
	Returns contrast enhanced image(s) using the unsharp masking method.
 CATEGORY:            @CAT-# 16 12 
	Image Processing , Filtering
 CALLING SEQUENCE:
	new_image = UNSHMASK (orig_image [,WINDOW=w] [,RATIO=r] [,/MEDIAN]
 INPUTS:
	orig_image:  2- or 3-dim array containing one or more images for
                    which contrast enhancement shall be done. 
                    If orig_image is a 3-dim array, the first 2 dimensions 
                    of the array must correspond to the image format (nx,ny),
                    the size of the 3rd dim. is then the number of images.
 OPTIONAL INPUT PARAMETER:
	WINDOW=w  :  w is the pixel-size of the smoothing window (smoothing is
                    done with IDL routine SMOOTH or MEDIAN, using a
                    w*w-box; w should be an odd number; 
                    default: w = (n/50) > 3 , n the smaller of the two image 
                                                dimensions.
       RATIO=r   :  r is the ratio of smoothed image to original image; if
                    sm is the smoothed image, then 
                         ( orig_image - r * sm ) / (1.-r)
                    will be returned as contrast enhanced image.
                    Default: r = 0.8
       /MEDIAN   :  If set, median filtering (IDL MEDIAN) will be used to 
                    instead of boxcar averaging (IDL SMOOTH) to create the 
                    smoothed image sm. The advantage of median filtering is
                    that large-scale edges (e.g. the solar limb of a full 
                    disk image) will not be blurred.Median filtering is,
                    however, much slower than boxcar averaging.
                    
 OUTPUTS:
	new_image :  the array containing the contrast enhanced image(s),
                    same type and size as orig_image.
 COMMON BLOCKS:
	none
 SIDE EFFECTS:
	none
 RESTRICTIONS:
	The image-size should be at least 3 im both spatial dimensions;
       Byte-arrays should contain only non-negative values.
 PROCEDURE:
	calls IDL-routine SMOOTH with /EDGE_TRUNCATE set or, if /MEDIAN is
       set, IDL-routine MEDIAN, to compute the smoothed image sm and returns
         ( orig_image - r * sm ) / (1.-r)  , where sm is the smoothed image.

 MODIFICATION HISTORY:
	nlte (KIS), 1996-05-19 created
       nlte (KIS), 1996-06-27 option median filtering

(See /supple/soft/rsi/idl_5/lib/kis-lib/unshmask.pro)


USPA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       USPA
 PURPOSE:
        Extracts data from digitized version of Umbra Spectral Atlas "USpA"
        (H.Woehl, A.D.Wittmann, E.H.Schroeter, Solar Physics 13,104 (1970))
*CATEGORY:            @CAT-# 31 32 25@
        Spectral Analysis , Spectral Lines Identification , Plotting
 CALLING SEQUENCE:
        USPA,data [,FROM=wstart [,TO={ wend | delta_w }] [,XLAM=x] [,/PLOT]
 INPUTS:
       none
 OPTIONAL INPUT PARAMETER:
       FROM = wstart : start wavelength (blue end of requested
            wavelength intervall) in Angstroem. Unless /EXACT is set, the
            actual start-
            value will be the largest integer <= wstart;
            If ** not ** set: procedure will request user to enter
            start wavelength.  must be >=4500 .
       TO = wend : end wavelength (red end of requested wavelength-
            intervall) in Angstroem;  must be > , <= 6998.52 .
       TO = delta_w : end wavelength =  +  Angstroem;
            in this case,  must be < 4500.
       Key parameter "TO" only meaningful if FROM=wstart was set.
       If FROM=wstart is set but ** not ** TO=wend:
            wend= actual  +5.1A will be assumed.
       /PLOT : The extracted spectrum will be plotted.
 OUTPUTS:
       data : (short) integer-array containing the spectral intensities
            of the requested wavelength intervall. Atlas-continuum =10000;
            wavelength step size: 20 mA.
 OPTIONAL OUTPUT:
       XLAM=wscale : wscale must be a named variable; the wavelength scale 
            corresponding to vector  is returned.
 SIDE EFFECTS:
       If FROM=wstart not set, the procedure will request for input;
       a scratch file 'tmp_uspa_atlas_idl' under the current working 
       directory will be created and removed afterwards.
 RESTRICTIONS:
       The digitized atlas covers wavelength region 4500 A to 6998.52 A.
 PROCEDURE:
       Spawns UNIX-command dd to dump & swap requested part of atlas
       to ./tmp_uspa_atlas_idl
 MODIFICATION HISTORY:
       nlte, 1994-Mar-23  created.
       nlte, 1995-Mar-27: location & host of atlas-file from environment
                          variables $IDL_LOCAL_DATA[_HOST];
                          scratch file named "tmp_uspa_atlas_idl"; font !6
       hoba, 1999-Mar-24  adoption for AIP-SOE

(See /supple/soft/rsi/idl_5/lib/kis-lib/uspa.pro)


VORZERL_MASKEN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	 VORZERL_MASKEN
 PURPOSE:
	 Computes the Positions of spectral lines in the focal plane of
	 the VTT Echelle Spectrograph, including the neccessary
        dimensions for the predisperser mask.
*CATEGORY:            @CAT-# 24 37@
	 Observer Support , Tools
 CALLING SEQUENCE:
	 VORZERL_MASKEN
 INPUTS:
	 None. You are prompted for all necessary input
 OUTPUTS:
 	 Results are printed to STDOUT or a file resp.
 COMMON BLOCKS:
        common block MASK_DATA
 SIDE EFFECTS:
 	 Common Block MASK_DATA is created.
	 Procedures VORZERL_AUX1 and VORZERL_AUX2 are compiled (if not
	 already present) 
 RESTRICTIONS:
        The program doesn't check for all unreasonable results. For
        example the observer himself should avoid predisperser mask
        slitwidths of less than 0.2mm or distances lower than about
        1-2mm (this because of technical difficulties in manufacturing.
 	 If any problems arise, please contact ps@kis.uni-freiburg.de
 PROCEDURE:
 	 You will be asked to type in the wavelengths of those lines you wish
	 to observe. The results are printed to standard output.
	 A more detailed manual is available in our local info-system:
	 >info vorzerl_masken.dvi
 MODIFICATION HISTORY:
        ps (KIS), 1992-02-13
        nlte (KIS) 1992-02-17 : minor updates (MASKE -> VORZERL_MASKE)
        ps (KIS)  1992-05-05 : include variation of predisperser
           dispersion with wavelength. Allow for wavelengths > 9999 A.
	    possibility of output in File. update of device dependent
	    parameters (list of D. Soltau, april 16,1992)
        ps (KIS) 1992-06-05 : correction of wrong output when using
           wavelength ranges
        ps (KIS) 1992-06-12 updated version 3.0
           New features: Search for alternative Wavelengths by Position
	    in the focal plane. Selection of alternative order also for bad
	    cases (out of blaze) possible (marked by negative order).
	    Change language to english
        ps (KIS) 1992-06-30 new variable BRANGE: half of usuable range 
           around blaze angle. used for determining the possibility of
	    alternative order. can be changed by the user
        ps (KIS) 1993-07-20  new predisperser parameters
        ps (KIS) 1995-01-11  Adaption to IDL 3.6
                             Multiple Gratings

(See /supple/soft/rsi/idl_5/lib/kis-lib/vorzerl_masken.pro)


WFIRST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WFIRST
 PURPOSE:
       Returns 1-dim array-index of FIRST OCCURENCE
       where specified array expression is non-zero
       (is TRUE if expression can be interpreted as 
       a logical expression) (Note: IDL-function WHERE
       returns ALL indices, KIS_LIB WLAST the last index).
 CATEGORY:            @CAT-#  0 28@
       Array Manipulation Routines , Programming
 CALLING SEQUENCE:
       i = WFIRST (array_expression)
 INPUTS:
       array_expression : array expression to be searched.
 OPTIONAL INPUT PARAMETER:
       none
 OUTPUTS:
       returns long integer beeing the first (1-dimensional)
       array-index where the given array expression is non-zero.
       if all elements of  are zero, -1 will be
       returned.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       none
 RESTRICTIONS:
       
 PROCEDURE:
       calls IDL routine WHERE
 MODIFICATION HISTORY:
       nlte, 1994-03-28 

(See /supple/soft/rsi/idl_5/lib/kis-lib/wfirst.pro)


WHERE2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WHERE2
 PURPOSE:
       returns 2 integer-vectors containing the subscripts of all
       non-zero elements of $$ 2-dimensional $$ input-expression.
*CATEGORY:            @CAT-#  0 16 28@
       Array Manipulation Routines , Image Processing , Programming
 CALLING SEQUENCE:
       WHERE2,expr,ixvec,iyvec,nvec
 INPUTS:
       expr : 2-dimensional expression
 OUTPUTS:
       ixvec : integer-array (1-dim, size=nvec+1) containing the
               values of 1st index of non-zero elements; 
               if expr has no non-zero elements, -1 will be returned.
       iyvec : integer-array (1-dim, size=nvec+1) containing the
               values of 2nd index of non-zero elements;
               if expr has no non-zero elements, -1 will be returned.
       nvec  : expr has nvec+1 non-zero elements:
               expr( ixvec(0:nvec) , iyvec(0:nvec) ) ;
               if expr has no non-zero elements, -1 will be returned.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       none
 RESTRICTIONS:
       none
 PROCEDURE:
       straight
 MODIFICATION HISTORY:
       nlte, 1990-03-17 

(See /supple/soft/rsi/idl_5/lib/kis-lib/where2.pro)


WLAST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WLAST
 PURPOSE:
       Returns 1-dim array-index of LAST OCCURENCE
       where specified array expression is non-zero
       (is TRUE if expression can be interpreted as 
       a logical expression) (Note: IDL-function WHERE
       returns ALL indices, KIS_LIB WFIRST the first index).
 CATEGORY:            @CAT-#  0 28@
       Array Manipulation Routines , Programming
 CALLING SEQUENCE:
       i = WLAST (array_expression)
 INPUTS:
       array_expression : array expression to be searched.
 OPTIONAL INPUT PARAMETER:
       none
 OUTPUTS:
       returns long integer beeing the last (1-dimensional)
       array-index where the given array expression is non-zero.
       if all elements of  are zero, -1 will be
       returned.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       none
 RESTRICTIONS:
       
 PROCEDURE:
       calls IDL routines REVERSE, WHERE
 MODIFICATION HISTORY:
       nlte, 1994-03-28 

(See /supple/soft/rsi/idl_5/lib/kis-lib/wlast.pro)


WNEAREST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WNEAREST
 PURPOSE:
       Returns 1-dim array-index of the element of a given numeric array
       whose value has the smallest absolute difference to a given value
       (if there are several array elements having the same numeric distance
       to the given value, the smallest index is returned).
 CATEGORY:            @CAT-#  0 28@
       Array Manipulation Routines , Programming
 CALLING SEQUENCE:
       i = WNEAREST (array, value)
 INPUTS:
       array : array to be searched;
       value : value 
 OPTIONAL INPUT PARAMETER:
       none
 OUTPUTS:
       returns long integer beeing the first (1-dimensional)
       array-index i where ABS( array(i) - value ) is minimal.
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       none
 RESTRICTIONS:
       
 PROCEDURE:
       calls IDL routines MIN, ABS
 MODIFICATION HISTORY:
       nlte, 1994-03-28 

(See /supple/soft/rsi/idl_5/lib/kis-lib/wnearest.pro)


WRFITS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WRFITS
 PURPOSE:
       Writes contents of "ccd-structure" on disk in FITS-format. 
*CATEGORY:            @CAT-# 11  2@
       FITS-Files , CCD Tools
 CALLING SEQUENCE:
       WRFITS,ccd_struc [,out_file] [,/OVER] [,/NOAPPEND]
 INPUTS:
       ccd_struc : IDL-structure containing the image (2-d case) or a
       set of images (3-d case) and all relevant parameters;
           The procedure recognizes structures wich have the following
           Structure-tags:
           .status : string, status-info for image-data.
           .time   : string, start & end of exposure.
           .project: string, "general comment" of observer.
           .txt    : string, "image specific comment" of observer.
           .id     : integer, image-identification-number.
           .itime  : long integer, start_of-expos._time (sec since midnight). 
           .expos  : floating_point, length of exposure (sec).
           .par    : integer-array size=50, containing image parameters.
           .pic    : integer-array containing the extracted image(s).
 OPTIONAL INPUT PARAMETER:
       out_file  : (string) file name for FITS-file to be created;
                   if out_file does'nt end on ."fits" or ".fts", the procedure
                   appends ".fits" to the file name unless /NOAPPEND is set; 
                   if such a file already exists, and unless /OVER was set, 
                   the file name will be modified by ".nnn." (nnn from {000,
                   001,...,999}) to avoid overwriting.
                   Default file name: 
                   if ccd_struc.txt contains sub-string "%FILENAME ^":
                      out_fil = './[.nnn].fits' 
                      or      = './_ID[.nnn].fits'
                      (second form if fname contains a counter unequal 
                       ccd_struc.id)
                   else: 
                      out_fil = './-CCD_ID[.nnn].fits'
                   (id= ccd_struc.id, ".nnn" only if to avoid overwriting.)
                   (".fits" will not be appended if /NOAAPPEND was set).
      /NOAPPEND    if set, the name of the output file will not be appended
                   by ".fits".
      /OVER      : Allows overwriting existing FITS-file.
 OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       A file (FITS-format) will be written on disk; the (modified) file-
       name will be written to standard output.
 RESTRICTIONS:
       
 PROCEDURE:
       Uses KIS_LIB procedures MKFITSHDR, MKFILNAM; Associated write to disk.
 MODIFICATION HISTORY:
       nlte (KIS), 1990-04-23 
       nlte (KIS), 1992-08-26 : new code for output file name.
       nlte (KIS), 1993-07-22 : keyword /NOAPPEND .
       nlte (KIS), 1996-05-07 : accepts byte- & long-array (BITPIX = 8,16,32)
                                for image.
       nlte (KIS), 1996-07-09 : 3-dim. case; 
                                accepts also ".fts" as file-suffix

(See /supple/soft/rsi/idl_5/lib/kis-lib/wrfits.pro)


WRFITSA

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       WRFITSA
 PURPOSE:
       Creates a FITS-file on disk.
*CATEGORY:            @CAT-# 11  2@
       FITS-Files , CCD Tools
 CALLING SEQUENCE:
       WRFITSA,img_array,fits_header [,out_file] [,/OVER] [,/NOAPPEND]
 INPUTS:
       img_array : 2- or 3-dim integer array (byte/short/long)
                      containing the image (or a set of images, 3-d case).
       fits_header: string array containing the FITS header.
 OPTIONAL INPUT PARAMETER:
       out_file  : (string) file name for FITS-file to be created;
                   if out_file does'nt end on ."fits" or ".fts", the procedure
                   appends ".fits" to the file name unless /NOAPPEND is set;
                   if such a file already exists, and unless /OVER was set, 
                   the file name will be modified by ".nnn." (nnn from {000,
                   001,...,999}) to avoid overwriting.
                   Default file name: 
                   if header contains label "FILENAME ":
                      out_fil = './[.nnn].fits' 
                      or      = './_ID[.nnn].fits'
                      (second form if fname contains a counter unequal 
                       ccd_struc.id)
                   else: 
                      out_fil = './-CCD_ID[.nnn].fits'
                   (id= ccd_struc.id, ".nnn" only if to avoid overwriting.)
      /NOAPPEND    if set, the name of the output file will not be appended
                   by ".fits".
      /OVER      : Allows overwriting existing FITS-file.
 OUTPUTS:
       none
 COMMON BLOCKS:
       none
 SIDE EFFECTS:
       A file (FITS-format) will be written on disk; the (modified) file-
       name will be written to standard output.
 RESTRICTIONS:
       
 PROCEDURE:
       The values for FITS-header-lines "BITPIX", "NAXIS1", "NAXIS2" will 
       be updated from contents of input fits_header according to actual
       size and type of img_array.
       Uses KIS_LIB procedure MKFILNAM; Associated write to disk.
 MODIFICATION HISTORY:
       nlte (KIS), 1992-08-26 : created from wrfits
       nlte (KIS), 1993-07-22 : keyword /NOAPPEND .
       nlte (KIS), 1996-05-07 : accepts byte- & long-array (BITPIX = 8,16,32)
                                for image.
       nlte (KIS), 1996-07-09 : 3-dim. case; 
                                accepts also ".fts" as file-suffix

(See /supple/soft/rsi/idl_5/lib/kis-lib/wrfitsa.pro)


ZOOM4

[Previous Routine] [List of Routines]
 NAME:
	ZOOM4
 PURPOSE:
	creates a "4x -zoomed" copy of an image array
*CATEGORY:            @CAT-# 15@
	Image Display
 CALLING SEQUENCE:
	ZOOM4,small,big
 INPUTS:
	small = image array (2-dim) to be zoomed;
 OUTPUTS:
	big   = zoomed image array .	
 RESTRICTIONS:
	size of "small": 512 x 512
 PROCEDURE:
	each pixel in small will be copied 2x2 -times into big.
 MODIFICATION HISTORY:
	nlte, 1990-01-15
	nlte, 1990-08-02  max size 512x512 of "small"
	nlte, 1993-07-17  only one loop; on_error

(See /supple/soft/rsi/idl_5/lib/kis-lib/zoom4.pro)