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: Wed Mar 17 09:47:50 1999.


List of Routines


Routine Descriptions

BIGMAP

[Next Routine] [List of Routines]
 NAME:
	BIGMAP
 PURPOSE:

	     This program takes a squared, clipped image, and projects
	it onto a square grid of latitude vs. longitude.   Currently, 
	the program is set up for polar images.

	This program is based on the simpmap program.  It uses a grid
	running from 45 to 90 deg (for north polar images) or 90 to
	45 deg (for south polar images) in y, and running from 0 to
	360 in Carrington longitude in x.

	The scale is 8 pixels per degree in each direction.

       This IDL version does not require a Fortran "core".

	The program produces one FITS image (...... size),
	which contains the map itself.  The map image name
	is the original image name with xy appended.

	Routines used:
           sun (from Johns Hopkins library) to find P, B, and Carrington long.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	BIGMAP,imname
 INPUTS:
	imname = BBSO VMG image file to map.  This image must be "squared";
	         that is, it must have square pixels.
	         The actual coordinates of Sun center (h and k in pixels)
	         must be in the FITS header keywords CENTERX and CENTERY.
	         The radius of the Sun in pixels must be in the keyword
	         RADIUS.  The pixel coordinates are based on the lower
	         left corner of the picture being (0,0).
 KEYWORD PARAMETERS:
 OUTPUTS:
	A map with the name imnamexy.  It is 2880 x 360 in size.
 COMMON BLOCKS:
 NOTES:
	The first 11 and last 8 columns in the VMGs are bad.
	The procedure does not use them and subtracts 11 from the
	h value before mapping.  Uses the procedure sunlong to
	find P, B, and the Carrington longitude of the central meridian.
 MODIFICATION HISTORY:
	J. Varsik,	19 Mar. 1996 --- Port from CMAP procedure.
       J. Varsik,      26 Feb. 1999 --- Remove Fortran core.

(See /home/hale/varsik/idl/polar/bigmap.pro)


CENLSNEW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CENLSNEW
 PURPOSE:
	Find center Sun position in BBSO polar magnetograms.
	This procedure estimates the Sun center position in pixel
	coordinates.  This procedure uses the center X, Y position
	(provided by the guider) along with image scale information
	provided by the user.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	cenlsnew(vimg,jimg,vih,jih,imgscl,gcut)
 INPUTS:
	vi     = IDL image for input magnetogram
       ji     = IDL image for input direct image
       vih    = FITS header for vimg
	jih    = FITS header for jimg
	imgscl = image scale (pixels / arcsec).
       gcut   = gradient cutoff value
	gcorr  = correction to picture center coordinates.  The
	         real coordinates are the file coordinates divided
	         by gcorr.  If gcorr is zero or not present, no correction
	         is applied.
 KEYWORD PARAMETERS:
 OUTPUTS:
	The FITS headers vih and jih have the following
	FITS keywords added:
	CENTERX, CENTERY = center Sun coordinates in pixels.
	RADIUS   = radius of Sun in pixels.
	SDCX     = standard deviation of CENTERX in pixels
	SDCY     = standard deviation of CENTERY in pixels

 COMMON BLOCKS:
	SUNRAD   contains:
	   R     = radius of Sun in pixels.
          Q     = quadrant of circle to fit
 NOTES:
	The time, date, and position information are taken from the
	V image.  The FITS keywords are added in BOTH images.
	This assumes that the time and position are the same for both
	images.
 MODIFICATION HISTORY:
	J. Varsik,	18 Mar. 1996
       J. Varsik,      12 Jan. 1999 -- numerous changes.

(See /home/hale/varsik/idl/polar/cenlsnew.pro)


CENTELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CENTELS
 PURPOSE:
	Find center Sun position in BBSO polar magnetograms.
	This procedure estimates the Sun center position in pixel
	coordinates.  This procedure uses the center X, Y position
	(provided by the guider) along with image scale information
	provided by the user.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	centerls(vfile,jfile,imgscl,gcut)
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
	imgscl = image scale (pixels / arcsec).
       gcut   = gradient cutoff value
	gcorr  = correction to picture center coordinates.  The
	         real coordinates are the file coordinates divided
	         by gcorr.  If gcorr is zero or not present, no correction
	         is applied.
 KEYWORD PARAMETERS:
 OUTPUTS:
	The FITS headers in vfile and jfile have the following
	FITS keywords added:
	CENTERX, CENTERY = center Sun coordinates in pixels.
	RADIUS   = radius of Sun in pixels.
	SDCX     = standard deviation of CENTERX in pixels
	SDCY     = standard deviation of CENTERY in pixels

 COMMON BLOCKS:
	SUNRAD   contains:
	   R     = radius of Sun in pixels.
          Q     = quadrant of circle to fit
 NOTES:
	The time, date, and position information are taken from the
	V image.  The FITS keywords are added in BOTH images.
	This assumes that the time and position are the same for both
	images.
 MODIFICATION HISTORY:
	J. Varsik,	18 Mar. 1996

(See /home/hale/varsik/idl/polar/centerls.pro)


CENTERE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CENTERE
 PURPOSE:
	Find center Sun position in BBSO polar magnetograms.
	This procedure estimates the Sun center position in pixel
	coordinates.  This procedure uses the center X, Y position
	(provided by the guider) along with image scale information
	provided by the user.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	centere(vimg,jimg,vih,jih,imgscl)
 INPUTS:
	vimg   = IDL image for input magnetogram (FITS format).
	jimg   = IDL image for input direct image (FITS format).
       vih    = FITS header for vimg
       jih    = FITS header for jimg
	imgscl = image scale (pixels / arcsec).
 KEYWORD PARAMETERS:
	gcorr  = correction to picture center coordinates.  The
	         real coordinates are the file coordinates divided
	         by gcorr.  If gcorr is zero or not present, no correction
	         is applied.
 OUTPUTS:
	The FITS headers in vfile and jfile have the following
	FITS keywords added:
	CENTERX, CENTERY = center Sun coordinates in pixels.
	RADIUS   = radius of Sun in pixels.
	SDRAD    = standard deviation of radius in pixels (always 0
	           for centere).
 COMMON BLOCKS:
 NOTES:
	The time, date, and position information are taken from the
	V image.  The FITS keywords are added in BOTH images.
	This assumes that the time and position are the same for both
	images.
 MODIFICATION HISTORY:
	J. Varsik,	13 Oct. 1995 --- Port from IRAF task
       J. Varsik,      26 Feb. 1999 --- Numerous changes.

(See /home/hale/varsik/idl/polar/centere.pro)


CGRID2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	CGRID2
 PURPOSE:

	    This program makes a coordinate grid for use with the
	output images of the CMAP program.  The grid is square in
	latitude and Carrington longitude, from 45 to 90 degrees
	for the north pole, or 90 to 45 degrees for the south pole
	in y and runs from 0 to 360 degrees in Carrington longitude
	in x.

	The scale is 4 pixels per degree in each direction.

	This program is the same as cgrid, but has narrower grid lines.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	imname = cgrid2(dir)
 INPUTS:
	dir    = either 'N' or 'S'.  Indicates which pole to use.
 KEYWORD PARAMETERS:
 OUTPUTS:
	imname = blank image with grid.
		The pixel coordinates are based on the lower left corner
		of the picture being 0,0.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	27 Nov. 1995 --- Port from IRAF task

(See /home/hale/varsik/idl/polar/cgrid2.pro)


ELEFIND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ELEFIND
 PURPOSE:
	This function finds magnetic field elements in a magnetogram.
	It returns the maximum value, the location of the maximum
	value, the size in pixels, and the element number for each
	magnetic element found.  An element is defined as a contiguous
	region in the image with the absolute value greater than
	a set cutoff value.  Only elements with a size greater than
	the minimum value are returned.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	retval = ELEFIND(mag,cutoff,minsize,maxsize,ycut)
 INPUTS:
	mag        = input magnetogram
	cutoff     = minimum field strength of a region
	minsize    = minimum size of a region
	maxsize    = maximum size of a region
	ycut       = y cutoff value
 KEYWORD PARAMETERS:
 OUTPUTS:
	retval
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	14 Mar. 1996

(See /home/hale/varsik/idl/polar/elefind.pro)


ELEFLUX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ELEFLUX
 PURPOSE:
	This function finds magnetic field elements in a magnetogram.
	It returns the maximum value, the location of the maximum
	value, the size in pixels, the average field value of
	each element (which can be related to the flux), and the element
	number for each
	magnetic element found.  An element is defined as a contiguous
	region in the image with the absolute value greater than
	a set cutoff value.  Only elements with a size greater than
	the minimum value are returned.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	retval = ELEFLUX(mag,cutoff,minsize,maxsize,ycut)
 INPUTS:
	mag        = input magnetogram
	cutoff     = minimum field strength of a region
	minsize    = minimum size of a region
	maxsize    = maximum size of a region
	ycut       = y cutoff value
 KEYWORD PARAMETERS:
 OUTPUTS:
	retval
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	13 May 1996

(See /home/hale/varsik/idl/polar/eleflux.pro)


FAKEI

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	FAKEI
 PURPOSE:
	     This program makes a fake I image for use with BBSO
	VMGs.  It uses the coordinates of Sun center in a FITS
	header.  The limb darkening curve from Astrophysical
	Quantities for 6000 A is assumed.

 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	FAKEI(imname,fakeout)
 INPUTS:
	imname = BBSO VMG image file.  The Sun center coordinates
	         (added earlier with CENTERE or similar) are used.
 KEYWORD PARAMETERS:
 OUTPUTS:
	fakeout = "fake I image" scaled to 255 at disk center.
	          Stored as a FITS 8-bit image.
 COMMON BLOCKS:
 NOTES:
	This program produces a "squared up" (512 x 384 pixel) image.
 MODIFICATION HISTORY:
	J. Varsik,	04 Jan. 1996

(See /home/hale/varsik/idl/polar/fakei.pro)


FITS_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	FITS_INFO
 PURPOSE:
       This procedure looks at specified BBSO VMG FITS files on
       disk, and prints information about them.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
       FITS_INFO,gfnam
 INPUTS:
	gfnam = file name(s) for examination, may include wild cards.
 KEYWORD PARAMETERS:
       list = file name for output, if not given, output only to screen.
 OUTPUTS:
	Prints FITS info to screen.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	03 Jan. 1996
	J. Varsik,	06 Jul. 1998 Added more observation types

(See /home/hale/varsik/idl/polar/fits_info.pro)


GAINCALIB

[Previous Routine] [Next Routine] [List of Routines]
  NAME:  GAINCALIB
  PURPOSE:    Produce either a gain table or an offset table
              from a set of images
              taken shifted with respect to one another
  CALIING SEQUENCE:
          Result = gaincalib(images, additive=additive)
 INPUT:
          images    a three-dimensional array representing
                    a sequence of two-dimensional images
                    images(*,*,k) ( k=0, 1,.., N-1).
                    It is strongly recommended that the number
                    of elements in each image is a power of 2
                    for the efficent FFT processing.
 OPTIONAL INPUT:
          x0        an array of x-shift
          y0        an array of y-shift
                        
 KEYWORD:  
         additive   If set,  the program produces
                    the offset table rather than the gain table.
                    If not set, the program produces the gain
                    table. In this case, the input images should
                    be positive-definite.
         shift     if set, the program calculates the amount of shift
                   in each image. 
         adj       if set, use only the pairs two of which were $
                   taken succesively
 OUTPUT:
        Result     the gain table if the keyword  ADDITIVE is not set
                   or the offset table if the keyword is set.
 OPTIONAL OUTPUT:
          x0        an array of x-shift
          y0        an array of y-shift
 COMMENTS:
           This uses a Fouier method to determine the flat-pattern of
           of a detector. Therefore it works best when the following
           conditions are satisfied:
            
               1) negligible low frequency gain pattern. 

                  If this pattern is non-negligible, 
                  then obtain  first  the low
                  frequency pattern based on surface fittings, and 
                  devide (or  subtract in the case of additive pattern)
                  the raw image by this low frequency pattern.
                  Then it can be multiplied back to the output of
                  this routine to yield the practical gain pattern.
                
              2) pixel number which is equal to a power of 2 for
                  the efficient FFT.    

(See /home/hale/varsik/idl/polar/gaincalib.pro)


GETL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	GETL
 PURPOSE:
	Get limb points
	Find center Sun position in BBSO polar magnetograms.
	This procedure estimates the Sun center position in pixel
	coordinates.  This procedure uses the center X, Y position
	(provided by the guider) along with image scale information
	provided by the user.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	limbimg = centerls(vfile,jfile,imgscl,gcut)
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
	imgscl = image scale (pixels / arcsec).
       gcut   = gradient cutoff value
	gcorr  = correction to picture center coordinates.  The
	         real coordinates are the file coordinates divided
	         by gcorr.  If gcorr is zero or not present, no correction
	         is applied.
 KEYWORD PARAMETERS:
 OUTPUTS:
	an image includling the limb points.

 COMMON BLOCKS:
 NOTES:
	The time, date, and position information are taken from the
	V image.  The FITS keywords are added in BOTH images.
	This assumes that the time and position are the same for both
	images.
 MODIFICATION HISTORY:
	J. Varsik,	18 Mar. 1996

(See /home/hale/varsik/idl/polar/getl.pro)


HGRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	HGRID
 PURPOSE:
	     This program generates an IDL 512x384 pixel short integer
	image with a solar coordinate grid on it.  It uses information
       from a squared-up BBSO magnetogram image header to determine where
       the grid should be placed.

	This IDL version is designed to run by itself, without needing
	a Fortran "core".

	This IDL function produces an IDL short integer image (512x384),
	which contains the grid (as very bright pixels) and is otherwise
	zero.

	Routines used:
		sun  -- from Johns Hopkins IDL library to find P, B, and L0.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	outimage = HGRID,fheader
 INPUTS:
	fheader= BBSO VMG image FITS header.
	         This image must be "squared";
	         that is, it must have square pixels.
	         The actual coordinates of Sun center (h and k in pixels)
	         must be in the FITS header keywords CENTERX and CENTERY.
	         The radius of the Sun in pixels must be in the keyword
	         RADIUS.  The pixel coordinates are based on the lower
	         left corner of the picture being (0,0).
 KEYWORD PARAMETERS:
 OUTPUTS:
	outimage = IDL short integer image containing the grid.
 COMMON BLOCKS:
 NOTES:
	Uses the solar ephemeris from the Johns Hopkins library
	find P, and B.
 MODIFICATION HISTORY:
	J. Varsik,	09 Nov. 1995 --- Port from IRAF task
	J. Varsik,	24 Feb. 1999 --- Numerous changes.
	J. Varsik,	25 Feb. 1999 --- Remove Fortran "core".

(See /home/hale/varsik/idl/polar/hgrid.pro)


IMAGSCL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      IMAGSCL
 PURPOSE:
      Procedure to find shift between two BBSO magnetograms,
      to estimate the telescope image scale.
      This is only good to the nearest whole pixel.

      This procedure, given two images a1 and a2, 
      displays a1 overlaid with a negative (pixels inverted)
      version of a2.  The relative shift of a2 over a1
      is controlled by moving the mouse and clicking.
      When done, the relative shift is printed on the screen.
 CATEGORY:
      IMAGE PROCESSING
 CALLING SEQUENCE:
      imagscl,a1,a2,...
 INPUTS:
      a1 = The first image.
        type: array, any type.
      a2 = The second image. 
        type: array, any type.
 KEYWORD PARAMETERS:
      NOBYTE = If present, then NOBYTE specifies that a bytscl
        isn't to be performed.  It assumes that the input is
        already in byte format.
 OUTPUTS:
      Prints relative shift of one image over the other.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
      J. Varsik,01 Nov, 1995 ---  Adapted from Cohl's FLICKER program.

(See /home/hale/varsik/idl/polar/imagscl.pro)


LCQXDUMSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCQXDUMSET
 PURPOSE:
	This procedure accepts two BBSO VMG FITS files, one V
	image (magnetogram) and one J or I image (direct image).
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting images are written back to the disk as FITS
	images.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Note that the old IRAF version deleted the original FITS
	files.  This version does not.

	Modified version for old QX images.  Assumes 10-bit mode images.
	Modified version for old QX images without corresponding
	I images.  Use a dummy I image (a copy of the V image is OK).
       This version does not divide by intensity.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCQXDUMSET,vfile,jfile
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
		  This image is also divided by intensity.
	jfiless = FITS file of rebinned direct image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	18 Dec. 1995 --- Modified from LCSETUP
					 for old QX images.

(See /home/hale/varsik/idl/polar/lcqxdumset.pro)


LCQXSETUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCQXSETUP
 PURPOSE:
	This procedure accepts two BBSO VMG FITS files, one V
	image (magnetogram) and one J or I image (direct image).
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting images are written back to the disk as FITS
	images.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Note that the old IRAF version deleted the original FITS
	files.  This version does not.

	Modified version for old QX images.  Assumes 12-bit images.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCQXSETUP,vfile,jfile,zpoff
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
	zpoff = zero-point offset for Quantex I image.
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
		  This image is also divided by intensity.
	jfiless = FITS file of rebinned direct image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	18 Dec. 1995 --- Modified from LCSETUP
					 for old QX images.

(See /home/hale/varsik/idl/polar/lcqxsetup.pro)


LCQXSETUP2

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCQXSETUP2
 PURPOSE:
	This procedure accepts two BBSO VMG FITS files, one V
	image (magnetogram) and one J or I image (direct image).
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting images are written back to the disk as FITS
	images.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Note that the old IRAF version deleted the original FITS
	files.  This version does not.

	Modified version for old QX images.  Assumes 12-bit images.
	This version uses my old VMG unwrap procedure, instead of the
	one from the NOAO "HSC" IDL library.  It doesn't unwrap
       everything, but it shouldn't add as many bogus horizontal lines
       to the image.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCQXSETUP2,vfile,jfile,zpoff
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
	zpoff = zero-point offset for Quantex I image.
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
		  This image is also divided by intensity.
	jfiless = FITS file of rebinned direct image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	18 Dec. 1995 --- Modified from LCSETUP
					 for old QX images.

(See /home/hale/varsik/idl/polar/lcqxsetup2.pro)


LCQXSETUP3

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCQXSETUP3
 PURPOSE:
	This procedure accepts a BBSO VMG FITS file; a V
	image (magnetogram).
	The image is first unwrapped using my unwvmg procedure.
	A 12-bit Quantex image is assumed.
	
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting image is written back to the disk as a FITS
	image.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Modified version for old QX images.  Assumes 12-bit images.
	This version uses my old VMG unwrap procedure, instead of the
	one from the NOAO "HSC" IDL library.  It doesn't unwrap
       everything, but it shouldn't add as many bogus horizontal lines
       to the image.

	A procedure like "centere" is run to estimate the center Sun
	position.  A "fake" i image is constructed and the V image is
	divided by this fake i image.

 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCQXSETUP3,vfile,imgscl
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
		  This image is also divided by intensity.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	18 Dec. 1995 --- Modified from LCSETUP
					 for old QX images.

(See /home/hale/varsik/idl/polar/lcqxsetup3.pro)


LCQXSETUP4

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCQXSETUP4
 PURPOSE:
	This procedure accepts a BBSO VMG FITS file; a V
	image (magnetogram).
	The image is first unwrapped using my unwvmg procedure.
	A 12-bit Quantex image is assumed.
	
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting image is written back to the disk as a FITS
	image.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Modified version for old QX images.  Assumes 12-bit images.
	This version uses my old VMG unwrap procedure, instead of the
	one from the NOAO "HSC" IDL library.  It doesn't unwrap
       everything, but it shouldn't add as many bogus horizontal lines
       to the image.

	A procedure like "centere" is run to estimate the center Sun
	position.
	The image is NOT divided by intensity.

 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCQXSETUP4,vfile,imgscl
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
		  This image is also divided by intensity.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	18 Dec. 1995 --- Modified from LCSETUP
					 for old QX images.

(See /home/hale/varsik/idl/polar/lcqxsetup4.pro)


LCSETUP[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCSETUP
 PURPOSE:
	This procedure accepts two BBSO VMG FITS files, one V
	image (magnetogram) and one J or I image (direct image).
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting images are written back to the disk as FITS
	images.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Note that the old IRAF version deleted the original FITS
	files.  This version does not.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCSETUP(vfile,jfile)
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
	jfiless = FITS file of rebinned direct image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	13 Oct. 1995 --- Port from IRAF task

(See /home/hale/varsik/idl/polar/bxcar.pro)


LCSETUP[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCSETUP
 PURPOSE:
	This procedure accepts two BBSO VMG FITS files, one V
	image (magnetogram) and one J or I image (direct image).
	A 50 x 50 boxcar smoothed image is generated and subtracted
	from the magnetogram to remove large-scale non-uniformities
	in the magnetogram (often due to KDP fringes).  Then,
	both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting images are written back to the disk as FITS
	images.  The letters "ss" are put in the file name before
	the extension (before the first "." in the file name or
	at the end of the name).

	Note that the old IRAF version deleted the original FITS
	files.  This version does not.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCSETUP(vfile,jfile)
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
 KEYWORD PARAMETERS:
 OUTPUTS:
	vfiless = FITS file of rebinned and "flattened" magnetogram
	jfiless = FITS file of rebinned direct image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	13 Oct. 1995 --- Port from IRAF task

(See /home/hale/varsik/idl/polar/lcsetup-old.pro)


LCSETUP[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	LCSETUP
 PURPOSE:
	This procedure accepts two BBSO VMG FITS files, one V
	image (magnetogram) and one J or I image (direct image).
	A flat-field magnetogram generated from Jongchul Chae's
	vmg_flat procedure is subtracted from the magentogram
	to remove large-scale non-uniformities in the magnetogram.

	Then, both the V and the J (or I) images are rebinned from
	512 x 481 to 512 x 384 to make the pixels square.
	The resulting images are returned in the viss and jiss
       variables.

	Note that the old IRAF version deleted the original FITS
	files.  This version does not.

	Note that the old version (using the boxcar smoothing)
	did not scale the VMG image when it was loaded.  This
	version does.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	LCSETUP,vfile,jfile,vih,jih,viss,jiss,flatfile,jflat
 INPUTS:
	vfile = file name for input magnetogram (FITS format).
	jfile = file name for input direct image (FITS format).
	flatfile = IDL variable containing VMG flatfield image.
       jflat = IDL variable containing J flatfield image.
 KEYWORD PARAMETERS:
 OUTPUTS:
	viss = IDL variable containing rebinned and "flattened" magnetogram
	jiss = IDL variable containing rebinned, flattened direct image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	13 Oct. 1995 --- Port from IRAF task
	J. Varsik,	08 Jan. 1999 --- Change to use flatfield image.
       J. Varsik,      24 Feb. 1999 --- Add J flatfield.

(See /home/hale/varsik/idl/polar/lcsetup.pro)


MBIGMAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MBIGMAP
 PURPOSE:

       This program takes a mosaic of BBSO VMG images and projects
	it onto a square grid of latitude vs. longitude.   Currently, 
	the program is set up for polar images.

	This program is based on the simpmap program.  It uses a grid
	running from 45 to 90 deg (for north polar images) or 90 to
	45 deg (for south polar images) in y, and running from 0 to
	360 in Carrington longitude in x.

	The scale is 8 pixels per degree in each direction.

       This IDL version does not require a Fortran "core".

	The program produces one FITS image (...... size),
	which contains the map itself.  The map image name
	is the original image name with xy appended.

	Routines used:
           sun (from Johns Hopkins library) to find P, B, and Carrington long.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	map = MBIGMAP,im,imhdr,h,k,imgscl
 INPUTS:
       im     = BBSO VMG image mosaic (4000x2000 size).
       imhdr  = A FITS header.  This is used to get date and time
                information.
       h,k    = X and Y position of the center of the Sun in pixels.
                This is based on the lower left corner of the mosaic
                being (0,0).  The nominal position for a north polar
                image is (2000,0), for a south polar image
                (2000,2000).
       imgscl = image scale in pixels/arcsec.
 KEYWORD PARAMETERS:
 OUTPUTS:
	A map.  It is 2880 x 360 in size.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
       J. Varsik,      12 Mar. 1999
       J. Varsik,      17 Mar. 1999 Include secant correction for
       mag. field.

(See /home/hale/varsik/idl/polar/mbigmap.pro)


MCENLS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MCENLS
 PURPOSE:
	Find center Sun position in a mosaic of BBSO polar magnetograms.
	This procedure estimates the Sun center position in pixel
	coordinates.  It also provides a revised estimate of the true
       image scale.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	imgsclnew = mcenls(jimg,jih,imgscl,gcut, xout, yout)
 INPUTS:
       ji     = IDL image for input direct image mosiac.
       jih    = FITS header for the V image taken closest to the
                middle of the frames used for the mosaic.  This is
                used to get the time for the ephemeris.
	imgscl = image scale (pixels / arcsec).
       gcut   = gradient cutoff value
 KEYWORD PARAMETERS:
       south   = if set, the image is a south polar mosaic.  If not,
                 it's a north pole mosaic.
 OUTPUTS:
       imgsclnew = new image scale value.
       xout      = position of center Sun in pixels.
       yout      = position of center Sun in pixels. 

 COMMON BLOCKS:
       SUNRAD contains:
          R      = radius of Sun in pixels.
          Q      = quadrant of circle to fit
 NOTES:
       The position of center Sun is given in pixels.  The image
       scales are in pixels/arcsec.  The origin of the coordinates
       is with (0,0) at the lower left corner of the image(s).
       The initial coordinates for Sun center are (2000,0) for the
       north polar mosaics and (2000,2000) for the south polar
       mosaics.
 MODIFICATION HISTORY:
	J. Varsik,	11 Mar. 1999

(See /home/hale/varsik/idl/polar/mcenls.pro)


MEPOSRD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MEPOSRD
 PURPOSE:

	     This program reads a file containing positions for
	magnetic field elemets measured from two BBSO polar
	VMG rectangular maps.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	MEPOSRD,filnam,feanum,x1pos,y1pos,x2pos,y2pos
	CMAP,imname
 INPUTS:
	filnam = text file containing positions to read.  This file
		 contains four lines of header information (which
		 is ignored) followed by data lines.  Each data line
		 consists of 5 integers (feature number, x pos in map 1,
		 y pos in map1, x pos in map 2, y pos in map2) and
		 a character string (which is ignored).
 KEYWORD PARAMETERS:
 OUTPUTS:
	feanum = 200 position vector with feature numbers
	x1pos  = 200 position vector for the x position in map 1
	y1pos  = 200 position vector for the y position in map 1
	x2pos  = 200 position vector for the x position in map 2
	y2pos  = 200 position vector for the y position in map 2
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	10 Jan. 1996

(See /home/hale/varsik/idl/polar/meposrd.pro)


MHGRID

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	MHGRID
 PURPOSE:
       This program generates an IDL 4000x2000 pixel short integer
       image with a solar coordinate grid on it.

	This IDL version is designed to run by itself, without needing
	a Fortran "core".

	This IDL function produces an IDL short integer image (512x384),
	which contains the grid (as very bright pixels) and is otherwise
	zero.

	Routines used:
		sun  -- from Johns Hopkins IDL library to find P, B, and L0.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	outimage = HGRID,h,k,imgscl,fheader
 INPUTS:
       h      = x-coordinate of center of Sun
       k      = y-coordinage of center of Sun
       imgscl = image scale (in pixels/arcsec).
	fheader= BBSO VMG image FITS header (used to get date and time).
       h and k are measured with (0,0) at the lower left corner of
       the image.  Correct values are around (2000,0) for north pole
       mosaics and (2000,2000) for south pole mosaics.
 KEYWORD PARAMETERS:
 OUTPUTS:
	outimage = IDL short integer image containing the grid.
 COMMON BLOCKS:
 NOTES:
	Uses the solar ephemeris from the Johns Hopkins library
	find P, and B.
 MODIFICATION HISTORY:
       J. Varsik,      11 Mar. 1999

(See /home/hale/varsik/idl/polar/mhgrid.pro)


NMOSAIC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	NMOSAIC
 PURPOSE:

       This program adds an image to a mosaic of BBSO VMG
       images, and also adds the corresponding J image to
       a J mosaic.  It is designed for polar images.

 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	nmosaic,stackimage,newimage,nhdr,imgscl,jstack,jimage
 INPUTS:
	stackimage = image containing composite map.
	             A "blank" stack can be created with the command
	             newstack = REPLICATE(-32000,xsize,ysize)
                    xsize = 4000, ysize=2000
	newimage   = image to add to stack.
       nhdr       = FITS header of new image.
       imgscl     = image scale (pix/arcsec).
       jstack     = J mosaic image (xsize=4000, ysize=2000)
       jimage     = J image to add.
 KEYWORD PARAMETERS:
 OUTPUTS:
	The stackimage and jstack are modified.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	08 March 1999

(See /home/hale/varsik/idl/polar/nmosaic.pro)


OVERG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      OVERG
 PURPOSE:
      Generates an 8-bit IDL image consisting of a BBSO VMG
      and a grid produced by the HGRID function.
 CATEGORY:
      IMAGE PROCESSING
 CALLING SEQUENCE:
      outp = overg,a1,a2,...
 INPUTS:
      a1 = The first image.
        type: array, any type.
      a2 = The second image. 
        type: array, any type.
 KEYWORD PARAMETERS:
      NOBYTE = If present, then NOBYTE specifies that a bytscl
        isn't to be performed.  It assumes that the input is
        already in byte format.  We assume a2 is always in short
        integer format (the output of HGRID).
      NBIT   = If present, NBIT indicates how the image is to be
	 scaled.  If NBIT has a value between 8 and 12, the
	 input image is raw VMG pixel values (not calibrated)
	 and the image is scaled as if it were being displayed
	 on the Datacube or Quantex.  If NBIT is less than zero,
	 the image is a calibrated floating point image.  Pixels
	 with absolute value greater than the absolute value of
	 NBIT are clipped.
 OUTPUTS:
      outp = IDL byte image
      Prints relative shift of one image over the other.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
      J. Varsik, 09 Nov, 1995 ---  Adapted from IMAGSCL program.
      J. Varsik, 25 Feb, 1999 ---  Added support for calibrated images.

(See /home/hale/varsik/idl/polar/overg.pro)


POLSTACK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	POLSTACK
 PURPOSE:

	     This program adds an image to a composite solar map.
	It works for images of type FLOAT (i.e. standard IDL floating pt.)
	only.

	     If the stack is "blank" (all pixels less than -30000)
	the new image is copied and becomes the stack.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	POLSTACK,stackimage,newimage
 INPUTS:
	stackimage = image containing composite map.
	             A "blank" stack can be created with the command
	             newstack = REPLICATE(-32000,xsize,ysize)
	newimage   = image to add to stack.
 KEYWORD PARAMETERS:
 OUTPUTS:
	The stackimage is modified.
 COMMON BLOCKS:
 NOTES:
	The newimage must be the same dimensions as the stackimage.
 MODIFICATION HISTORY:
	J. Varsik,	27 Nov. 1995 --- Port from IRAF task

(See /home/hale/varsik/idl/polar/polstack.pro)


QXDIV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	QXDIV
 PURPOSE:
	Divide a QX VMG by intensity.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
       outi = QXDIV(vin,iin)
 INPUTS:
	vin   = IDL QX VMG (which has already been converted to 16-bit)
	iin   = IDL QX I image
 KEYWORD PARAMETERS:
 OUTPUTS:
	outi  = divided image
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	04 Jan. 1996

(See /home/hale/varsik/idl/polar/qxdiv.pro)


RINGFILTER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:    ringfilter
 PURPOSE:
         To apply ring-shaped filtering to an image
 CALLING SEQUENCCE:
         result = ringfilter(image, r1, r2)
 INPUTS:
         image      input image
         r1         inner radius of the ring
         r2         outer radius of the ring
 OUTPUT:
        result     ring-filtered image

(See /home/hale/varsik/idl/polar/ringfilter.pro)


SHIFTG

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
      SHIFTG
 PURPOSE:
      Procedure to find shift between a BBSO magnetogram and a grid
      produced by the HGRID function to estimate the limb position.

      This procedure, given two images a1 and a2, 
      displays a1 overlaid with a scaled version of a2 (we assume
      a2 is a coordinate grid).
      The relative shift of a2 over a1
      is controlled by moving the mouse and clicking.
      When done, the relative shift is printed on the screen.
 CATEGORY:
      IMAGE PROCESSING
 CALLING SEQUENCE:
      shiftg,a1,a2,...
 INPUTS:
      a1 = The first image.
        type: array, any type.
      a2 = The second image. 
        type: array, any type.
 KEYWORD PARAMETERS:
      NOBYTE = If present, then NOBYTE specifies that a bytscl
        isn't to be performed.  It assumes that the input is
        already in byte format.  We assume a2 is always in short
        integer format (the output of HGRID).
 OUTPUTS:
      Prints relative shift of one image over the other.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
      J. Varsik, 09 Nov, 1995 ---  Adapted from IMAGSCL program.

(See /home/hale/varsik/idl/polar/shiftg.pro)


SIMPMAP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SIMPMAP
 PURPOSE:
	This procedure is used to convert a BBSO VMG image to
	"Peter Wilson" format for the polar fields project.
	This procedure is a port of the 6/29/95 IRAF imfort
	task.

	The procedure takes a "squared" image and projects it
	onto a square grid of latitude vs. longitude.

	The procedure determines the latitude simply by taking the
	absolute value of the latitude it finds.  Therefore,
	equatorial images, with both positive and negative latitudes,
	will not be correctly displayed.  The program also ceneters
	its longitude display to either side of center sun.

	The logfile ("Peter Wilson format" file) produced by this
	procedure contains the image data output as a formatted file.
	The image is 181 rows by 181 columns; in other words,
	a grid in which each pixel is one degree of latitude by
	one degree of longitude.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
	SIMPMAP,imname,logfile
 INPUTS:
	imname = BBSO VMG image file to map.  This image must be "squared";
	         that is, it must have square pixels.
	         The actual coordinates of Sun center (h and k in pixels)
	         must be in the FITS header keywords CENTERX and CENTERY.
	         The radius of the Sun in pixels must be in the keyword
	         RADIUS.  The pixel coordinates are based on the lower
	         left corner of the picture being (0,0).
 KEYWORD PARAMETERS:
 OUTPUTS:
	logfile = text file containing the map information output by
	          the procedure.  Each line output contains the
                 longitude (zero at center), latitude, the total
                 gray level at the pixel (summing the contribution
                 from each image pixel), the number of image pixels
                 contributing, and the final map value (the total
	          divided by the number contributing).
       imnamem = FITS image (181 x 181 pixels) version of the final
                 map.  The name of the file is imname concatenated
	          with 'm'.
	cimname = FITS image (181 x 181 pixels) containing the
	          number of pixels contributing to the map at each point.
	          The name of the file is 'c' concatenated with imname.
 COMMON BLOCKS:
 NOTES:
	The first 11 and last 8 columns in the VMGs are bad.
	The procedure does not use them and subtracts 11 from the
	h value before mapping.  Uses the procedure sunlong to
	find P, B, and the Carrington longitude of the central meridian.
 MODIFICATION HISTORY:
	J. Varsik,	19 Oct. 1995 --- Port from IRAF task

(See /home/hale/varsik/idl/polar/simpmap.pro)


SUNCLIST

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	SUNCLIST
 PURPOSE:
	This procedure makes a list of the Sun center values found
	for a set of BBSO VMGs which have been processed with
	CENTERE or similar procedures.
 CATEGORY:
	POLAR
 CALLING SEQUENCE:
       SUNCLIST,gfnam
 INPUTS:
	gfnam = file name(s) for examination, may include wild cards.
 KEYWORD PARAMETERS:
       list = file name for output, if not given, output only to screen.
 OUTPUTS:
	Prints FITS info to screen.
 COMMON BLOCKS:
 NOTES:
 MODIFICATION HISTORY:
	J. Varsik,	03 Jan. 1996

(See /home/hale/varsik/idl/polar/sunclist.pro)


VMG_FLAT

[Previous Routine] [Next Routine] [List of Routines]
 NAME: VMG_FLAT
 PURPOSE:   Produced the flat patterns for VMG observations
 INPUT: 
        files     an array of V  and J file names
                  files(*,0)       V files
                  files(*,1)       J files 
 OUPUT:
         vflat      a flat pattern for V images
         jflat      a flat pattern for J images

 RESTRICTION:
          Each pair of V files and J files should taken from
          the same integration.         
 HISTROY:
      August 1998 J. Chae

(See /home/hale/varsik/idl/polar/vmg_flat.pro)


XYINDEX

[Previous Routine] [List of Routines]

 NAME : XYINDEX
 PURPOSE : Generate  x-index and y-index  2-D arrays 
                  for a given 2-D array
 CALLING SEQUENCE :
            XYINDEX, A, X, Y
  INPUT:
            A        a  2-D array
   OUTPUT:
            X        X-index array
            Y        Y-index array
  HISTORY
     Chae, Jong-Chul  : April 1996

(See /home/hale/varsik/idl/polar/xyindex.pro)