xhcs $SMEI/pro/tool/xhcs.pro
[Previous] [Next]
 NAME:
	xhcs
 PURPOSE:
	 Read a file that lists a set of Nick's WSO or NSO files.
	 Run X's code on them, and create source surface maps
 CALLING SEQUENCE:
	PRO xhcs, obs, $
	    destination     = destination   , $
	    list	    = list	    , $
	    source	    = source	    , $
	    remote_prefix   = remote_prefix , $
	    remote_postfix  = remote_postfix, $
	    local_prefix    = local_prefix  , $
	    local_postfix   = local_postfix , $
	    gzip	    = gzip	    , $
	    rss 	    = rss	    , $
	    rcp 	    = rcp	    , $
	    silent	    = silent
 INPUTS:
	obs	    scalar; type: character; default: 'wso'
			indentifies origin of magnetic field data
			Currently supported:
			wso_noaa    New Fits files from NOAA
			wso_arge    Old .dat files from NOAA
			nso_noaa    Old Fits files from NOAA
			nso_ktpk    New Fits files from Kit Peak
 OPTIONAL INPUTS:
	destination=destination
		    scalar; type: string; default: $TUB
			directory where to write resulting source
			surface magnetic field (the file name is the
			same as for the file with the input photospheric
			magnetic field.
	list=list   scalar; type: string; default: none
			name of file containing fully-qualified file names
			for all photospheric synoptic maps to be processed.
	source=source
		    scalar; type: string; default: none
			used only if keyword list is not specified.
			Name of single photospheric magnetic map to be
			processed.
 INCLUDE:
	@compile_opt.pro	; On error, return to caller
 CALLS: ***
	BRSS_CSSS_SCBF_, FILEPATH, GetFileSpec, InitVar, IsType, REURN, UNIQ, boost, destroyvar
	gzip_file, hide_env, txt_read, wso_write
 RESTRICTIONS:
	The input should not contain any holes. This sometimes happens with
	the WSO data received from NOAA when there are data gaps.
	Xuepu's code seems to return an array of zeros when this happens.
 MODIFICATION HISTORY:
	Jun 2002 (tjd, tdunn@ucsd.edu)
	Spt 2002 (tjd, tdunn@ucsd.edu) removed the intermediary
	    printing of files to /xwso/sync, which formerly
	    worked as a checking procedure, and is now commented out.
	    Made code flexible to changes in $dat dir.
	NOV-2002, Paul Hick (UCSD/CASS)
	    Modified XuePus readwsosc so that it can directly read
	    Nicks files (it now calls wso_read).
	    Writing of source surface magnetic field is now done using wso_write.
	OCT-2003, Paul Hick (UCSD/CASS)
	    Modified to intercept photospheric maps with data gaps. These are
	    now skipped. The modification required adding the keyword 'badfile'
	    to some of Xuepus original code (gh_wbrsc, readwsosc).
	OCT-2005, Paul Hick (UCSD/CASS; pphick@ucsd.edu)
	    Added keyword remote_prefix to allow for a change in prefix from
	    input file to output file (used for NSO/SOLIS maps).


xyoff $SMEI/ucsd/sat/idl/toolbox/xyoff.pro
[Previous]
 NAME:
	xyoff
 PURPOSE:
	Calculates the correlation function between two images using a box of
	size (bx,by) surrounding a point in the image. By default this point
	is the center of the image, (nx/2,ny/2). The routine calculates the
	offsets by finding the maximum of the correlation function.
 CATEGORY:
	Image processing
 CALLING SEQUENCE:
	s = xyoff(a,b,bx,by, hx,hy,fna,wdow=wdow,mask=mask,/sobel,ccf=ccf,/quiet)
 INPUTS:
	a   2D reference image.
	b   2D image that you want to track with respect to a
	bx  size of the box in the x-dimension that you wish
	    to use to generate the cross correlation function
	by  size of the box in the y-dimension that you wish
	    to use to generate the cross correlation function.
	hx  x position in the image that corresponds to the center
	    of the box. (Optional)
	hy  y position in the image that corresponds to the center
	    of the box. (Optional)
	fna fourier transform of the 256x256  (Optional)
	    subtended image from the center of a.
 OPTIONAL INPUTS:
	wdow=wdow   2-d apodization window.  (Optional; default=1)
	mask=mask   2-d mask to be applied in fourier space. (Optional;default=1)
	/sobel	    If specified, then SOBEL keyword causes this routine
		to track on the gradient of the image instead of the
		image itself.  (It uses a Sobel edge enhancement operator)
	/quiet	    if set, suppress printing of results on screen
 OUTPUTS:
	s = A vector containing the x and y offsets that should be applied
	    to an image to maximize the cross correlation.
	s[0] = The x offset.
	s[1] = The y offset.
	s[2] = max value of the correlation
	s[3] = cross correlation at 0 shift
	s[4] = maximum of the real part of absolute value of cross correlation
 INCLUDE:
	@compile_opt.pro    ; On error, return to caller
 CALLS: ***
	InitVar, MEAN, max_pos
 PROCEDURE:
	The executing program is xyoff.pro.  It performs a 2D
	cross-correlation, yielding the lag of maximum correlation, the
	coefficient of maximum correlation and the coefficient at lag 0.  In
	practice, I usually used lag 0.  Within the limits of floating point
	computation, the cross correlation at 0 shift of an image and itself is
	1.0 and the shifts are 0.0 and 0.0 as would be expected.  xyoff.pro
	calls max_pos.pro to find the maximum position within an array...the
	cross-correlation function in this case.
 MODIFICATION HISTORY:
	H. Cohl,   7 Jun, 1991 --- Initial programming.
	H. Cohl,  13 Dec, 1991 --- Added SOBEL keyword.
	H. Cohl,  13 Feb, 1992 --- Made it so that you can enter in hx or hy.
	H. Cohl,  25 Mar, 1992 --- Made documentation more understandable.
	T. Henry   December, 1993 ---  some changes made to size