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: Tue Jan 18 02:08:37 2000.


List of Routines


Routine Descriptions

AVERAGE_CUT

[Next Routine] [List of Routines]
 NAME:
    average_cut
 PURPOSE:
    average a map along a given direction.
 CATEGORY:
    image processing
 CALLING SEQUENCE: 
	cut=average_cut(d,h,angle=angle,Ninter=Ninter,dist=dist,xval=xval, $
                     silent=silent,dval=dval,input_distance=input_distance, $
                     median=median,std=std
 INPUTS:
	d,h    = data array (2D) and fits header
 OPTIONAL INPUT PARAMETERS:
     Ninter = number of intervals for the integration along the cut (default=100)
     angle  = angle of the cut (degree) from North (default=1st diagonal)
     input_distance = a (2D) array of distance to be used in the averaging
     silent     = if set, behave silently.
     median   = if set, the median value is used instead of the average.
 OUTPUTS:
	cut   = values averaged along the cut (1D) size given by Ninter
 OPTIONAL OUTPUT PARAMETERS:
     xval = average (or median) position values (1D) along the cut (degrees).
     dval = position values (1D) used to average into (degrees).
              same as xval if no !indef values are excluded.
     dist = distance array used in the averaging.
      std = standard deviation values (1-sig)
 COMMON BLOCKS:
     None
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
     !indef values in the image (or distance array, if input_distance is used) are
        excluded from the processing.
     Uses sxpar.pro, la_median.pro, la_mean.pro
 MODIFICATION HISTORY:
      20-Aug-1998, Written by Jean-Philippe Bernard

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:average_cut.pro)


CUT_IMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       cut_image
 CALLING SEQUENCE:
       imout=cut_image(im,hin[,hout=hout][,/silent])
 PURPOSE:
    cut a fits image to trim undefined lines and columns
 INPUTS:
      im,hin = image (2D) and header
 OPTIONAL INPUT:
      silent : If set, behaves silently
 OUTPUTS:
       imout = trimmed image
 OPTIONAL OUTPUTS:
      hout = header for imout
 PROCEDURE AND SUBROUTINE USED
       Straightforward
       Uses sxpar.pro
            find_ind.pro
 RESTRICTIONS
 MODIFICATION HISTORY:
       written JPB 15-08-92

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:cut_image.pro)


DEGRADE_RES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       degrade_res
 PURPOSE:
       degrade the angular resolution of an image by convolving it
       with a 2D gaussian.
	   indef values in the original image are not considered
	   if remove_border is set, values affected by the map edge
       (closer than reso from the edge) are set to indef
 CATEGORY:
       image_processing
 CALLING SEQUENCE:
       result=degrade_res(input,h,reso,hout
                   [,/remove_border][,/remove_indef][,indef=]
                   [,get_kernel=][,/no_convol])      
 INPUTS:
       input,h        = input image (2D or 3D) and header
       reso           = angular resolution requiered (degree)
       hout           = output header
 OPTIONAL INPUTS:
       remove_border  = if set the edge of the map is set to indef
       remove_indef   = if set the edge of indef zones is set to indef
	   indef          = specify indef value to be used [default=!indef]
       no_convol      = if set no convolution is performed
 KEYWORD PARAMETERS:
 OUTPUTS:
       result of the function = smoothed image
 OPTIONAL OUTPUTS:
       get_kernel     = if set, the kernel is returned
 COMMON BLOCKS:
       None
 SIDE EFFECTS:
       The final image does not really have the resolution reso !
 RESTRICTIONS:
 PROCEDURE:
 EXAMPLE:
 MODIFICATION HISTORY:
       written JPB 09-08-92

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:degrade_res.pro)


ENLARGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       enlarge
 CALLING SEQUENCE:
       ind2=enlarge(ind,Npix,sx,sy)
 PURPOSE:
       enlarge a region pointed by ind in a 2D array by Npix pixels
	  the area selected is enlarged by neighbor pixels
 INPUTS:
       ind = index of the region
	Npix = number of pixels to extend
	sx, sy = size of the array in x and y
 OPTIONAL INPUT:

 OUTPUTS:
       modified index
 SUBROUTINE AND PROCEDURE USED

 SIDE EFFECTS:
	Should use long loop index, instead of cutting loops.
 MODIFICATION HISTORY:
       WRITTEN, J.P. Bernard, 6-11-1992
	modified JPB Jun 21 1994 to deal with large indexes sets

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:enlarge.pro)


FIX_RADEC_HEADER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	fix_radec_header
 PURPOSE:
    makes sure that the center of a header is not at center of a pixel
    useful for TAN projection headers for which coordinates cannot compute at center
 CATEGORY:
    Coordinates conversions
 CALLING SEQUENCE: 
	header=fix_radec_header(h)
 INPUTS:
    h = the input header
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
    header = modified header
 OPTIONAL OUTPUT PARAMETERS:
 ACCEPTED KEY-WORDS:
 COMMON BLOCKS:
 SIDE EFFECTS:
 RESTRICTIONS:
    applied only to RA-TAN headers.
 PROCEDURE:
 MODIFICATION HISTORY:
	Written Jan 31 1995 J.P. Bernard, IPAC.

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:fix_radec_header.pro)


INTEGRATED_INTENSITY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	integrated_intensity
 PURPOSE:
     compute integrated intensity map in a given vlsr range
 CATEGORY:
     Molecular data reduction
 CALLING SEQUENCE:
	ii=integrated_intensity(input,header,[vrange=])
 INPUTS:
	d = data cube
    h  = data header
 OPTIONAL INPUT PARAMETERS:
    vrange = vlsr range to be used (default=full range)
 OUTPUTS:
	ii        = ntegrated intensity map
 OPTIONAL OUTPUT PARAMETERS:
	None
 ACCEPTED KEY-WORDS:
	silent = if set, behaves silently
 COMMON BLOCKS:
	Npne
 SIDE EFFECTS:
    does not work with default vrange
 RESTRICTIONS:
 PROCEDURE:
    make_axis.pro
 EXAMPLES
    
 MODIFICATION HISTORY:
	Written by J.P. Bernard Sep 1 1998

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:integrated_intensity.pro)


MAKE_AXIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       make_axis
 CALLING SEQUENCE:
       make_axis,header,axis1,[axis2[,axis3]]
 PURPOSE:
       make 1D axis 
 INPUTS:
       header = cube or image header
 OPTIONAL INPUT:
 ACCEPTED KEY-WORDS:
 OUTPUTS:
       axis1, axis2, axis3
 PROCEDURE AND SUBROUTINE USED
       
 SIDE EFFECTS:
       ?
 MODIFICATION HISTORY:
       written Jean-Philippe Bernard 19-Mars-93

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:make_axis.pro)


MAKE_POS_VEL_MAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
    make_pos_vel_map
 PURPOSE:
    Construct a position-velocity diagram from a cube of molecular data
    from a center position along a given direction on the sky.
 CATEGORY:
    image processing
 CALLING SEQUENCE: 
	map=make_pos_vel_map(d,h,vrange,vstep,Ninter,angle,dl, $
                          cent_coord=cent_coord,vval=vval,xval=xval, $
                          xrange=xrange,dist=dist)
 INPUTS:
	d,h    = data array (3D) and fits header
	vrange = range of vlsr to be covered by map
     vstep = step in vlsr of the map
     Ninter = number of intervals for the integration along the cut
              and the y-size of map
     angle  = angle of the cut (degree) from North
     dl     = width of the cut (degree)
 OPTIONAL INPUT PARAMETERS:
     cent_coord = coordinates (degree) from the center (e.g. [ra,dec])
                  default=center of the cube
     xrange     = range of position values for map.
                  default=all values
     silent     = if set behaves silently
 OUTPUTS:
	map     = position-velocity map. x and y axis correspond to velocity and
              position respectively.
 OPTIONAL OUTPUT PARAMETERS:
     vval = vlsr values (1D) corresponding to map
     xval = position values (1D) corresponding to map
     dist = distance array used in the averaging.
   stdmap = standard deviation map (1-sig)
 COMMON BLOCKS:
     None
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
     Uses average_cut.pro, integrated_intensity.pro
 MODIFICATION HISTORY:
      20-Aug-1998, Written by Jean-Philippe Bernard

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:make_pos_vel_map.pro)


MOSAIQUE3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       mosaique3
 CALLING SEQUENCE:
       mosaique3,al,del,d,h,w,res,weight
 PURPOSE:
       create a composite image of image res (big image) and image in
	d (small image).
	Coordinates are derived from their headers and projected coreclty
	res might already have defined values, in which case (res+d)/2.
	is set in the overlaping regions
	interpolation is done bilinearily (no averaging in a beam)
 INPUTS:
      al,del = alpha & delta coord of each pix of big image (res). 2 D arrays
      d,h    = data and header of the small image
      w      = weight of the image d
      weight = current weight map for res (used as a weight in summing)
 OPTIONAL INPUT:
      undef = undefined value
	silent = if set routine is silent
	deg_res = if set the small image's angular resolution is first degraded
	          to deg_res (deg)
 OUTPUTS:
       res = res+small image, weight is updated
 PROCEDURE AND SUBROUTINE USED
	1/ input coordinates are transformed into pixels of the small image
	   input coordinates are considered to be of the type given in h
	   (accepted are RA, GLON, ECLON)
	2/ If requested, the angular resolution of the small image is
	   first degraded using degrade_res.pro
	3/ The small image is projected onto the big one using my_bilinear2
	4/ The so-projected image is added to res
	   res might already have defined values, in which case (res+d)/2.
	   is set in the overlaping regions

       interpolation is done bilinearily (no averaging in a beam)
       my_bilinear2,sxpar,degrade_res
 RESTRICTIONS
       when adding the 1st map, res should be all set to !indef
       and weight to 0.
 MODIFICATION HISTORY:
       written JPB 15-08-92
        modified JPB Aug 23 1996 to include indiv weight w

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:mosaique3.pro)


MY_BILINEAR2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
        my_bilinear2
 PURPOSE:
       same as bilinear of user library but can deal with big arrays
 CATEGORY:
       Coordinates conversions
 CALLING SEQUENCE: 
	my_bilinear , array, x, y
 INPUTS:
	array = array (2D) in which interpolation is to be made
	x, y = 2D array of x and y values (must be of same size)
 OPTIONAL INPUT PARAMETERS:
 OUTPUTS:
	function output=interpolated array (same size as x and y)
 OPTIONAL OUTPUT PARAMETERS:
 COMMON BLOCKS:
 SIDE EFFECTS:
	x and y values not in the target image (outside array)
	are changed to 0 or -1
 RESTRICTIONS:
 PROCEDURE:
	BILINEAR (users library)
	indef values are difficult to handle. Here values in the
	interpolated values which values are smaller than the smaller
	defined value in the original array are set to indef. This works
	for a highly <0 indef (e.g indef=-32768.) and generally >0 image
 MODIFICATION HISTORY:
      14-Aug-1992, Written by Jean-Philippe Bernard, Nagoya Univ.

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:my_bilinear2.pro)


PROJECT2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       project2
 CALLING SEQUENCE:
	im2=project2(h1,im1,h2)
 PURPOSE:
	reprojects im1,h1 into the projection specified by h2
 INPUTS:
       im1,h1 = image, header to be reprojected
       h2 = header of the output image (must have a different proj as h1)
 OPTIONAL INPUT:
	save_it=to save the project parameters
	restore_it=to restore project parameters
	previous_lut=to use the previous projection
 OUTPUTS:
       im2 = result of the reprojection
 SUBROUTINE AND PROCEDURE USED
       sxpar,create_coo2,coo2pix2,my_bilinear, coo2coo
 SIDE EFFECTS:
 RESTRICTIONS:
       Should take coord,epoch,Naxis,.... into account.
 MODIFICATION HISTORY:
       written J.P. Bernard @ IPAC Jan 31 1995 

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:project2.pro)


REBIN_IMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       rebin_image
 PURPOSE:
       scales a fits image by a given scale factor
       and update header info.
 CATEGORY:
       image_processing
 CALLING SEQUENCE:
       im=rebin_image(image,header,hout,ffact[,/sample][,/median])
 INPUTS:
       image          = input image (2D)
       header         = header for image
       ffact          = rebin factor
 OPTIONAL INPUTS:
       sample         = to keep pixel information
       median         = ?
 KEYWORD PARAMETERS:
 OUTPUTS:
       hout           = modified header (for im)
       im             = rebined image
 OPTIONAL OUTPUTS:
 COMMON BLOCKS:
       None
 SIDE EFFECTS:
 RESTRICTIONS:
 PROCEDURE:
 EXAMPLE:
 MODIFICATION HISTORY:
       written JPB 09-08-92

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:rebin_image.pro)


SET_DIST2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
       set_dist2
 CALLING SEQUENCE:
       set_dist2,sep,i0,j0,k0
 PURPOSE:
       Computes the square distance array to a center in pixels
 INPUTS:
       sep = empty array
       i0  = center position on 1st axis
       j0  = center position on 2nd axis
 OPTIONAL INPUT:
       k0  = center position on 3rd axis
 OUTPUTS:
	   sep = array containing the square distance in pixels
 PROCEDURE AND SUBROUTINE USED
       
 SIDE EFFECTS:
 EXAMPLE:
 MODIFICATION HISTORY:
       written by Jean-Philippe Bernard (?) 09-92

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:set_dist2.pro)


ZMY

[Previous Routine] [List of Routines]
 NAME:
       zmy
 CALLING SEQUENCE:
       zmarray=zmy(image,head,siz[,hout]
		   [,centcoord=[]][,centpix=[]][,/previous_lut)
 PURPOSE:
       zoom an image in various coordinate system/projection.
	A new header is generated for the zoomed array
 INPUTS:
	image, head     = original image and header
     siz            = size of the area (degrees). Can be a 2 elt set
 OPTIONAL INPUT:
	centcoord	= a set giving center coord
			  in degrees in the NEW coordinate system
	centpix		= a set giving center pixel
			  in the original image
	new_proj        = to set a new projection type
	new_coord       = to set a new coordinate system
	previous_lut    = use the previous Look-up table projection
 OUTPUTS:
	hout		= header of the zoomed image
 PROCEDURE AND SUBROUTINE USED
	A zoomed image header is produced, according to the coordinates,
	coordinate system and projection specified.
	The result image is obtained as the projection of the input
	corresponding to this new header.

       pix2coo2,coo2pix2,h2pix,project2
 COMMONS:
     @proj_common.com, @lut_proj.com 
 SIDE EFFECTS:
       ?
 MODIFICATION HISTORY:
       written JPB 05-08-92
	Modified JPB 22-01-93 to use convert_ad_pix instead of cor2pix
				and create a better output header
	Modified 19-Mar-93 to put header center @ image center
	Modified Dec 12 1993 to allow deal with l,b maps and cube inputs
	Modified MAR 22 1995 to Generalize coordinate conversion

(See MacintoshHD:IDL Libraries:JPBlib:Image_Processing:zmy.pro)