Varosi code AstroContrib Library

This page is a listing of the entire contents of this library for IDL. This listing is the long version. Viewing the much more compact listing may be handier.

[Go Back to Main IDL Libraries Search Page]


Last modified: Thu Dec 21 21:17:57 2000.

List of Routines


Routine Descriptions

ADD_NEW_MOSAIC

[Next Routine] [List of Routines]
 NAME:
	add_new_mosaic
 PURPOSE:
	Add new averaged/spliced mosaic to the common block of mosaics,
	also creates a default entry in the mosaic_specs structure array.
 CALLING:
	add_new_mosaic, mosaic, mosaic_info, mtitle, MAGF=Magf
 INPUTS:
	mosaic, mosaic_info, mtitle
 KEYWORDS:
	MAGF =
 OUTPUTS:
	All thru common mosaic_array.
 EXTERNAL CALLS:
	function N_struct
	function mosaic_struct
	pro display_mosaic
	pro image_insert
 COMMON BLOCKS:
	common mosaic_array, mosaics, mosaic_specs, mosaic_infos
	common display_option2, rotation		;default image rotation.
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1992. (code used to be in mosaic.pro)

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/add_new_mosaic.pro)


ALIGN_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
select a group of images and align them at the points of selection.
Frank Varosi NASA/GSFC 1989
F.V. 1991, added wait,0.1 in SELECT Loop to avoid duplicate cursor reads.
F.V. 1991, added define_origin at alignment point.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/align_images.pro)


ALIGN_MOSAICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	align_mosaics
 PURPOSE:
	select mosaic images and align them at the points of selection.
 CALLING:
	align_mosaics, mosaic_List, imscaled, ZOOM=zoomf
 INPUTS:
	mosaic_List = array of structures containing image locations
			and pointers into the pooled-array "imscaled".
	imscaled = pooled-array of scaled images, pointers to by mosaic_List.
 KEYWORDS:
	ZOOM=zoomf
 RESULTS:
 EXTERNAL CALLS:
	function check_struct
	function select_image
	function get_imscaled
	pro border_images
	pro define_origin
	pro screen_coordin
	pro display_images
 PROCEDURE:
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1990.
	F.V.1991, added wait,0.1 in SELECT Loop to avoid duplicate cursor reads.
	F.V. 1991, option to zoom mosaics during alignment point selections.
	F.V. 1991, added define_origin at alignment point.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/align_mosaics.pro)


ALLOWED_TRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Allowed_Trans
 PURPOSE:
	Determine which bound-bound transitions between Levels of different 
	energies are allowed (radiative), according to quantum LS rules.
 CALLING:
	wa = Allowed_Trans( ELevs, ix_from, ix_to )
 INPUTS:
	ELevs = array of structures with tags for level energies,
		quantum numbers, graphics Locations, etc.
	ix_from = integer array, indices of ELevs from which transitions occur.
	ix_to = single integer, index of ELevs to which transition may occur.
 OUTPUTS:
	Function returns indices of which elements in ELevs(ix_from)
	are allowed transitions to ELevs(ix_to). Specifically, if
	variable "wa" is result of function then transitions from
	ELevs(ix_from(wa)) to ELevs(ix_to) are allowed (others are forbidden).
 EXTERNAL CALLS:
	function N_struct
 PROCEDURE:
	Return result of big where function call.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/allowed_trans.pro)


ANALYSIS_ADDMOS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	analysis_addmos
 PURPOSE:
	Add a mosaic image to the math-mosaic List structure,
	and apply any required rotation and/or geometric scaling.
 CALLING:
	analysis_addmos, imos, imath
 INPUTS:
	imos = integer, mosaic image number.
	imath = integer, image number in math_List.
 INPUT and OUTPUT:
	All other input/output is thru:
		common mosaic_array, mosaics, mosaic_specs, mosaic_infos
		common math_mosaics, math_List, math_images, math_imscaled
 KEYWORDS:
	/RESET causes imath image to be reset to original values of imos image.
 EXTERNAL CALLS:
 	function N_struct
 	function RotMag
 	function scale_mosaic
 	function image_extract
	pro copy_struct_inx
 	pro image_replace
 	pro image_remove
 	pro image_insert
 COMMON BLOCKS:
	common math_mosaics, math_List, math_images, math_imscaled
	common mosaic_array, mosaics, mosaic_specs, mosaic_infos
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1990
	F.V. 1993, added rotation & geometric scaling of image data.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analysis_addmos.pro)


ANALYSIS_DUPMOS

[Previous Routine] [Next Routine] [List of Routines]
 Frank Varosi NASA/Goddard 1992

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analysis_dupmos.pro)


ANALYSIS_SELECT

[Previous Routine] [Next Routine] [List of Routines]
 Select mosaic images for Math_mosaics & Analysis.
 Frank Varosi NASA/Goddard 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analysis_select.pro)


ANALYSIS_TASK

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

 PURPOSE:
	Process button events which are user requests to display,
	analyze, store/Load, etc..., the image data aquired.
	This is the next event handler routine,
	called by Analyze_Event for additional generic processing.

 CALLING:
	Analysis_Task, event, imspec, imaged, im_hdr, imscaled, imdisp, hfits

 INPUT:
	event = structure variable defining the widget event.
	imspec = structure variable specifying how the image is displayed.
	imaged = the image data array
	im_hdr = structure variable containing header info about image.
	imscaled = the image array scaled into bytes.
	imdisp = the byte image array magnified or reduced for display.
	hfits = the FITS header if an image file is read or written.

 KEYWORDS:
	UVALUE = user value of widget event,
		if not given it is retrieved from event.
	MAGF = desired magnification (or reduction) of image display.

 EXTERNAL CALLS:
	functions get_words, get_window, scale_image, probe_image
	pro box_erase
	pro gscat_box_draw	(to tell get_Scat_Data when it is new display)
	pro X_Var_Edit
	pro analysis_info
	functions get_text_input, check_dir, substwid
	function PickFile
	functions store_image, Load_image
 COMMON BLOCKS:
	common Analysis_Task, def_hdr	;default header for files.
	common adjct_map, color_map
 PROCEDURE:
	Big CASE statement.
 HISTORY:
	Frank Varosi NASA/GSFC 1993.
	F.V. 1993: added default structure template for file headers.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analysis_task.pro)


ANALYZE_CURSOR

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

 PURPOSE:
	Check if cursor is in either the image or subimage window,
	and if so, display the cursor Location and pixel value.
	This routine is called in "timer" mode when the
	cursor-pixel label widget generates a timer event.

 CALLING:
	Analyze_Cursor, analyze_widget

 INPUT:
	analyze_widget = structure variable containing all info
			about the pro Analyze_Image widget.

 EXTERNAL CALLS:
	function get_cursor_win
 COMMON BLOCKS:
	common opticon0, imaged, imhead, imhist
	common opticon1, subimage, subhead, subhist
 PROCEDURE:
	Find out if cursor is in either image or sub-image window, and if so,
	get value of pixel at cursor location and display in label widget.
	In any case, reset the label widget timer (for longer time if
	cursor was not in either window).
 HISTORY:
	Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analyze_cursor.pro)


ANALYZE_FLUXSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	analyze_fluxset
 PURPOSE:
	Set fluxes at 2 points in stack of mosaic images,
	for comparing (mosaic math) different wavelengths,
	or averaging mosaics of same wavelength.
 CALLING:
	analyze_fluxset
 INPUT & OUTPUT:
	all thru common math_mosaics.
 COMMON BLOCKS:
	common math_mosaics, math_List, math_images, math_imscaled
 EXTERNAL CALLS:
	pro match_mos_apply
	pro box_draw2
	pro box_erase2
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1990.
	F.V. 1991, use match_mos_apply to factor and offset the mosaic images.
	F.V. 1999, option to use TOTAL or AVERAGE fluxes in SOURCE/SKY box.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analyze_fluxset.pro)


ANALYZE_IMAGE

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

 PURPOSE:
	Create a widget to interactively control/execute the display & analysis
	of images obtained from MAMA or CCD detector integrations.

 CALLING:
	Analyze_Image

 KEYWORD INPUTS:

	GROUP = the ID of the widget that calls this procedure,
		if specified, death of caller results in death of this widget.

	PARENT = the ID of the widget which is to be the top level base of the
		new widget created by this procedure. If specified,
		this Analyze_Image widget is just defined but not realized.

	XPOS, YPOS = desired position on screen of free base (no parent) widget.

 EFFECTS:
	Initiates the Xmanager if it is not already running.

 EXTERNAL CALLS:
	pro Xmanager
	pro widget_Location
	function CW_Bgroup
	function widget_Tree_Map
 COMMON BLOCKS:
	common Analyze_Image, analyze_widget
 PROCEDURE:
	Create the analyze_widget structure variable.
	Create and register the widgets with the Xmanager.
	Selection events are then processed by pro Analyze_Event.
 HISTORY:
	Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analyze_image.pro)


ANALYZE_MARKSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	analyze_markset
 PURPOSE:
	Define marks in overlap of mosaic images.
	For use by the compute equation option of analyze mosaics (mosaic math).
	The defined marks will appear in computed image.
	Marks can also be transferred to/from the separate mosaic images.
 CALLING:
	analyze_markset
 INPUTS:
	All INPUT and OUTPUT is thru common math_mosaics & contour_marks.
 EXTERNAL CALLS:
	pro contour_markset
	pro contour_marks
	pro display_images
	pro pop_mosaics
	function pop_image
	function N_struct
 COMMON BLOCKS:
	common math_mosaics, math_List, math_images, math_imscaled
	common contour_marks, sources, Labels
 PROCEDURE:
	Compute linear mappings from image pixels to normalize coordinates
 HISTORY:
	Written, Frank Varosi NASA/Goddard 1990
	F.V. 1991, added new options: pop, get source Locs, define origin.
	F.V. 1992, added transfer source Locs option.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analyze_markset.pro)


ANALYZE_MOSAICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	analyze_mosaics
 PURPOSE:
	Interactively create a mosaic of arbitrary size images
	(called "mosaic" images, which are created in pro mosaic) and:
	compute algebraic expression involving fluxes in overlayed pixels,
	(after appropriately scaling fluxes in the images),
	or compute average of the mosaic.
	Can also just arrange a collection of images for
	deconvolution of mosaic & PSF image pairs,
	or modeling the IR spectrum at each pixel with heated dust emission
	and line-of-sight absorption.
 CALLING:
	analyze_mosaics, math_result, math_spec, Return_Task
 INPUTS:
	All INPUT and most of OUTPUT is thru

	common math_mosaics:

		math_List = array of structures containing image locations and
			pointers into the arrays: math_images & math_imscaled.
		math_images = array of image data, pointed to by math_List.
		math_imscaled = image data scaled into bytes for display.

	common mosaic_array:

		mosaics = array of image data, pointed to by mosaic_specs.
		mosaic_specs = array of structures containing specs. and
					pointers into the array: mosaics.
		mosaic_infos = array of structures containing info about
				how each mosaic image was formed.

	Elements of math_images are extracted from array mosaics.
 OUTPUTS:
	math_result = 2D array (image) result of computations.
	math_spec = structure defining the math_result.
	Return_Task = string, next task requested by user.
 COMMON BLOCKS:
	common math_mosaics, math_List, math_images, math_imscaled
	common mosaic_array, mosaics, mosaic_specs, mosaic_infos
	common analyze_mosaics, math_window,result_window,contour_window,border
	common analyze_mosaic2, mathmos_colors
	common dir_names, dirinv, dirmos_raw, dirmos_aver
	common dir_name2, dirmos_math
 EXTERNAL CALLS:
	functions:	calc_im_stack	DeConv_images	average_mosaics
	pros:	restore_MathMos	restore_mosaic	display_images	centroid_images
		align_mosaics	contour_mosaic	scale_mosaics	pop_mosaics
		mosaic_correls	mosaic_coordin	mosaic_task	get_window...
 PROCEDURE:
	Menu with loop around big CASE statement,
	and pro mosaic_task gets leftovers.
 HISTORY:
	Written, Frank Varosi NASA/Goddard 1990  (started as: ratio_mosaics).
	F.V.1991, generalized into mosaic Math & Analysis.
	F.V.1991, added option: Match_Levels.
	F.V.1992, added options: align by centroids, De-Convolve mosaics.
	F.V.1994, call mosaic_correls for more cross-correlation options.
	F.V.1998, option to display images in wavelength/maximum order.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/analyze_mosaics.pro)


APPLY_FACTORS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	apply_factors
 PURPOSE:
	Match image names and apply factors & offsets
			of old_images to new_images.
 CALLING EXAMPLE:
	apply_factors, old_images, new_images, /REDISPLAY
 INPUTS:
 KEYWORDS:
 OUTPUTS:
 EXTERNAL CALLS:
 COMMON BLOCKS:
 PROCEDURE:
 MODIFICATION HISTORY:
	Written, Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/apply_factors.pro)


APPROX_XSECS

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

 PURPOSE:
	Create a widget to approximate a cross-section by interactively
	selecting points for piece-wise Linear interpolation.
	Events are handled by pro Approx_Xsecs_Ev.
	State of widget is stored in user value so multiple instances
	can be running simultaneously.
	Called by Build_BFree_Tr which is called by Modion_Event (pro modion).
 CALLING:
	Approx_Xsecs

 INPUT:
	ELevs = array of structures with tags for energy of level,
		quantum numbers, and handles pointing to
		full and approximate photo-ionization cross-sections.	
		This array is stored via handle of the widget base state.
 OUTPUT:
	ELevs = returned with updated x-secs if /MODAL when widget is DONE,
		otherwise, if not /MODAL then widget is never destroyed
		and the user must retrieve it from the state structure
		in the user-value of the base widget.
 KEYWORDS:
	/MODAL : causes Xmanager to wait until this widget is destroyed,
		so that events from all other widgets are suspended.

	GROUP = optional, the ID of the widget that calls this procedure,
		if specified, death of caller results in death of this widget.

	XPOS, YPOS = optional, desired position on screen of the widget.

	PLOT_SIZE = [xsize,ysize] of draw widget for plotting of X-secs.,
		default = [640,640].

 EXTERNAL CALLS:
	pros:	Xmanager, widget_Location
	funcs:	CW_Bgroup, CW_pdmenu, widget_Tree_Map
 PROCEDURE:
	Create the state structure variable.
	Create and register the widgets with the Xmanager.
	Events are then processed by pro Approx_Xsecs_Ev (above in same file).
 HISTORY:
	written: Frank Varosi HSTX @ NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/approx_xsecs.pro)


APPROX_XSEC_CUR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Approx_Xsec_Cur
 PURPOSE:
	Process cursor events of draw widget in Approx_Xsecs widget.
	Left button = insert a point into approximate cross-section,
	right button = delete nearest point.
	Called by pro Approx_Xsecs_Ev (in file approx_xsecs.pro).
 CALLING:
	Approx_Xsec_Cur, event, state
 INPUTS:
	event = structure variable defining the widget event.
	state = structure variable, state of the widget.
 OUTPUTS:
	state = new state of the widget.
 EXTERNAL CALLS:
	function Level_info
 PROCEDURE:
	Check the draw event.type in case statement:
		0 = insert/delete a point (when a button is pressed),
			Left button = insert,
			Middle button = delete nearest point.
		1 = freeze the List widget (when a button is released).
		2 = display cursor coordinates (motion events).
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/approx_xsec_cur.pro)


APXSEC_HARDCOPY

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	ApXsec_Hardcopy
 PURPOSE:
	Create hardcopy of the graph of currently selected cross-section
	with approximation points overplotted.
 CALLING:
	ApXsec_Hardcopy, HC_request
 INPUTS:
	HC_request = string array (optional).
 OUTPUTS:
	Writes graphics to a file.
 COMMON BLOCKS:
	common Modion_Widget, modion_widget
	also see: modion_common.pro
 EXTERNAL CALLS:
	function N_struct
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/apxsec_hardcopy.pro)


AVERAGE_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	average_images
 PURPOSE:
	Average the images in raw_mosaic and return the averaged_mosaic image.
 CALLING:
	mosaic = average_images( raw_mosaic )
 INPUTS:
	raw_mosaic = structured array of images with relative Location info.
 KEYWORDS:
      /BACK_SET : for pixels with no data, set the value < minimum of data,
		This allows them to be distinguished from all other data pixels.
			Default is to leave them = 0.
      /FRAC_PIX : if relative offsets between images are in fractional pixels,
			use this info in creating final average mosaic.
			Default is to round off to nearest pixel offset.
	BORDER = width of border of each image to ignore (exclude from average),
			default = 0.
	GROUP = average only image in specified group number (default is all).
	WHICH_IMAGES = the indices of images in raw_mosaic to average (def=all).
	WEIGHT_IMAGES = weighting to use for each image when averaging,
			default = 1 for all image.
 OUTPUTS:
	total_weight = an image of the sum of weight in each pixel of
			the final averaged mosaic. Thus if weights = 1,
			each element of total_weight is the count of
			how many images overlapped at that pixel.
	imxmin, imymin = the location of bottom left corner of final image,
			in relative offset coordinate.
 RESULT:
	Function returns image with each pixel = average of overlapping pixels,
	and this image is converted to the same type as the raw images.
 EXTERNAL CALLS:
	function frac_pix_shift
	function round_off
	function conv_vartype
 PROCEDURE:
	Loop thru images in raw_mosaic and add into big mosaic array,
	also accumulating the total_weight array, then divide by it.
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1989.
	F.V.1989, added keywords for BORDER = pixel border to ignore,
				GROUP=group # to average,
				/BACK_SET to set background empty pixels.
	F.V.1991, optimized and added conv_vartype at end.
	F.V.1991, added keyword WHICH_IMS= subscripts of images.
	F.V.1992, option /FRAC_PIX to use fractional pixel offsets
				in averaging (func frac_pix_shift()).

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/average_images.pro)


AVERAGE_MOSAICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	average_mosaics
 PURPOSE:
	Average a raw-mosaic of mosaics into one big mosaic image.
 CALLING:
	average_mosaics, mosaic_List, mosaic_images
 INPUTS:
	mosaic_List = array of structures containing images and information.
	mosaic_images = pooled-array containing the image data,
			mosaic_List has pointers into this array.
 KEYWORDS:
	BORDER=
	/BACK_SET
	GROUP=
	WHICH_IMS=
	WEIGHTS=
 OUTPUTS:
	Function returns the averaged mosaic image.
 EXTERNAL CALLS:
	function round_off
	function image_extract
 PROCEDURE:
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1991.
	F.V. 1991, optimized and added conv_vartype at end.
	F.V. 1992, added keyword WHICH_IMS= subscripts of images.
	F.V. 1993, exclude pixels having no data using the "weight" array.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/average_mosaics.pro)


BORDER_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	border_images
 PURPOSE:
	Display border of selected images in respective window.
	Interactive mode:
		Left button to select images, middle/right button to quit.
	Automatic mode:
		image #'s specified by INUMS or /ALL are bordered.
 CALLING:
	border_images, image_List, color
 INPUTS:
	image_List = array of structures containing images and Locations.
	color = color table index for drawing borders, def = !D.table_size-1
 KEYWORDS:
	INUMS =
	COLOR =
	/ALL_IMAGES
	/SHOW_NUMBERS
	OFFSET_XY =
 OUTPUTS:
	none.
 EXTERNAL CALLS:
	function select_image
	pro border_image
 PROCEDURE:
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1989.
	F.V. 1991, added keyword /SHOW_NUMBERS to print image #s within borders.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/border_images.pro)


BORDER_NOISE

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

 PURPOSE:
	Determine standard deviation and mean of border pixels in CCD image.

 CALLING:
	border_noise, image, bxu, byu, bsigma, bmean

 INPUTS:
	image = 2-D matrix.
	bxu = Left & Right column #'s for statistics: [[xL1,xR1],[xL2,xR2]].
	byu = Bottom & Top row #'s for statistics: [[yB1,yT1],[yB2,yT2]].

	Note: bxy & byu are defined by pro get_CCD_status.

 OUTPUTS:
	bsigma = standard devation of border pixel values.
	bmean = mean of border pixel values.

 EXTERNAL CALLS:
	function stdev
 HISTORY:
	Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/border_noise.pro)


BUILD_BB_TRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Build_BB_Trans
 PURPOSE:
	Build the array of bound-bound transitions between selected Levels,
	between selected single energy Levels and SuperLevels,
	and between all SuperLevel combinations.
 CALLING:
	Build_BB_Trans

 INPUTS:
	All thru common blocks in file: ~/modion/code/modion_common.pro

	ELevs = array of structures with tags for energy of level,
		quantum numbers, graphics Locations, etc.

	Rad_Trans = array of structures, radiative transitions, with tags for
		levels, oscillator strength (gf), quantum numbers, etc.

	SupLevs = array of SuperLevel structures with tags for
		average energy, effective temperature, etc.

 OUTPUT (common block):

	BB_Trans = array of structures, the calculated bound-bound transitions,
		with tags for "gf" values, wavelengths, quantum numbers, etc.
		(see code below for complete structure).
 COMMON BLOCKS:
	common Build_BB_Trans, bbTran	(structure template)
	common Build_BB_Tran1, Line_Styles, Line_Thicks   (options)
		and see file: ~/modion/code/modion_common.pro
 EXTERNAL CALLS:
	function Allowed_Trans
	function N_struct
	function Fsort
	function fosc_approx
	pro match
 PROCEDURE:
	Loop over the selected Levels and find out which combinations
	are allowed, then get the gf values for those allowed transitions.
	For the case of SuperLevels (energy Levels in groups) process all
	transitions between the energy Levels to get the needed "gf" values
	and then add up "gf" for each SuperLevel group, creating a new set
	of transitions involving SuperLevels, keeping only those single
	energy Levels transitions that are not any SuperLevel group.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.
	F.V. 1995, vectorized using function Allowed_Trans.
	F.V. 1995, added computation of SuperLevel transitions.
	F.V. 1995, further vectorized using pro match.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/build_bb_trans.pro)


BUILD_BFREE_TR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Build_BFree_Tr
 PURPOSE:
	Build bound-free transitions from selected energy Levels to the
	ionization continuum by creating an approximate/simplified
	photo-ionization cross-section for each selected Level.
	Accomplished interactively with the widget: Approx_Xsecs.
 CALLING:
	Build_BFree_Tr, ELevs, BFree_Trans

 INPUT & OUTPUT:	All thru common blocks:

	ELevs = array of structures with tags for energy of level,
		quantum numbers, and handles pointing to
		full and approximate photo-ionization cross-sections.
		Updated with new approximate photo-ionization cross-sections,
		(full cross-sections are unchanged).

 COMMON BLOCKS:
	see file: ~/modion/code/modion_common.pro
 EXTERNAL CALLS:
	function N_struct
	function Approx_Xsecs	(~/modion/code/widgets/approx_xsecs.pro)
	pro Modion_Status
 PROCEDURE:
	Just call Approx_Xsecs widget and then check the "disp" tag for changes.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/build_bfree_tr.pro)


BUILD_BFSUP_TR

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Build_BFsup_Tr
 PURPOSE:
	Build bound-free transitions for SuperLevels by first merging
	the photo-ionization cross-sections for Levels in each group
	(if not already done). Then an approximate/simplified
	photo-ionization cross-section is created/modified for each SuperLevel,
	interactively with the widget: Approx_Xsecs.
 CALLING:
	Build_BFsup_Tr

 INPUT & OUTPUT:	All thru common blocks:

	ELevs = array of structures with tags for energy of level,
		quantum numbers, and handles pointing to
		full and approximate photo-ionization cross-sections.

	SupLevs = array of structures with tags for average energy,
		quantum numbers, and handles pointing to
		full and approximate photo-ionization cross-sections.
		Updated with new approximate photo-ionization cross-sections,
		(full cross-sections are merged from ELevs).

 COMMON BLOCKS:
	see file: ~/modion/code/modion_common.pro
 EXTERNAL CALLS:
	pro Merge_Xsecs
	pro Modion_Status
	pro Handles_Free
	function N_struct
	function Approx_Xsecs	(~/modion/code/widgets/approx_xsecs.pro)
 PROCEDURE:
	Just call Approx_Xsecs widget and then check the "disp" tag for changes.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/build_bfsup_tr.pro)


CALC_EFFICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Calc_Effics
 PURPOSE:
	Compute efficiency of a grating using List of flux measurements.
 CALLING:
	Calc_Effics, eff_meas, effics
 INPUTS:
	eff_meas = array of structures, efficiency measurements
		collected by pro get_Eff_Data.
 KEYWORDS:
	REF_MIRROR = array of structures with mirror reflectivity,
			from function Read_Reflect (default = unity).
	REF_GRATING = array of structures with grating reflectivity,
			from function Read_Reflect (default = unity).
 OUTPUTS:
	effics = array of structures containing absolute & groove efficiency
		of grating and all measurements/errors used in computation.
 EXTERNAL CALLS:
	function unique
	function def_imhd_struct
	pro copy_struct_inx
	function spline
	function stdev
 COMMON BLOCKS:
	common Calc_Effics, efft	;structure template.
 PROCEDURE:
	Match wavelengths, average, interpolate reflectances, compute effic.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/calc_effics.pro)


CALC_IM_STACK

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	calc_im_stack
 PURPOSE:
	Compute an algebraic expression (entered by user)
	involving the intersection regions of a stack of mosaic images.
 CALLING:
	image_result = calc_im_stack( image_List, calc, names, imsel )
 INPUT:
	image_List = array of structures containing image location info,
		and either the image data or pointers to image data.
 KEYWORDS:
	DATA = pooled-array containing image data (e.g. image_data).
 OUTPUT:
	Function returns the result of algebraic expression of images.
 OPTIONAL OUTPUTS:
	calc = string, the algebraic expression that was computed.
	names = string array, the names of images used in computation.
	imsel = integer array, indices of images used in computation.
 EXTERNAL CALLS:
	pro overlap_images
	pro write_images
	pro printw
	pro box_erase
	function box_create
	function Trp3D
	function intersection
	function N_struct
	function round_off
	function conv_ascii_time
	function next_word
	function get_image
	function frac_pix_extrac
 PROCEDURE:
	Parse the text typed in by user, substitute arrays for capital letters,
	extract the images, then execute the statement in current environment.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1990.
	F.V.1991, compute arbitrary algebraic expression, as entered by user.
	F.V.1992, use new function frac_pix_extrac( image ).
	F.V.1993, added MINIMAL, SPECIFIC, and VARIABLE intersection options.
	F.V.1994, modified to reject data less than thresholds specified by >.
	F.V.1994, added keyword options which bypass menus.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/calc_im_stack.pro)


CANCEL_XSEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Cancel_Xsec
 PURPOSE:
	Cancel the new approximate cross-section in the widget state structure.
	Stop events from the draw widget (x-sec plot) and
	start accepting events from the energy level list widget.
	Called by pro Approx_Xsecs_Ev (in file approx_xsecs.pro).
 CALLING:
	Cancel_Xsec, state
 INPUTS:
	state = structure variable, state of the widget.
 OUTPUTS:
	state = new state of the widget.
 EXTERNAL CALLS:
	function Level_info
 PROCEDURE:
	Free the handles, replot the original x-secs, enable List selection.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/cancel_xsec.pro)


CENTROID_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	centroid_images
 PURPOSE:
	Select images containing the same star (maximum bright source),
	and automatically find the centroids of the maxima in selected images
	Align the images at centroids, if requested.
	Returns structure array containing centroid information.
 CALLING:
	centroid_images, image_List, image_data, image_scaled
 INPUTS:
	image_List = array of structures containing image locations,
		and the image data and scaled byte arrays for display.
		Optionally, may instead have pointers into the arrays
		"images" and "imscaled".

	image_data = optional pool-array of image data,
				pointed to by image_List.
	image_scaled = optional pool-array of scaled images,
				pointed to by image_List.
 OUTPUTS:
	image_List = array of structures containing new image locations.
 EXTERNAL CALLS:
	pro centroid    (which first finds the maximum pixel).
	function FullWid_HalfMax
				and more...
 COMMON BLOCKS:
 PROCEDURE:
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1991.
	F.V.1992, round off centroid coordinates to nearest hundreth of a pixel.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/centroid_images.pro)


CHECK_IMSCALED

[Previous Routine] [Next Routine] [List of Routines]
check the scaled image if just central subset of image is to be displayed,
	(so unsmoothed borders are not displayed when image is smoothed).
Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/check_imscaled.pro)


CHECK_MAG_FACT

[Previous Routine] [Next Routine] [List of Routines]
code written by Frank Varosi NASA/GSFC 1989.
F.V.1990, mod to handle case when image data is not in structure, just sizes.
F.V.1991, mod to handle magnification < 1.
F.V.1991, keyword /ALL_MAGS for when image data is not in structure.
F.V.1992, keywords TAG_* to get flags about image data structure.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/check_mag_fact.pro)


CHECK_MENU_SIZE

[Previous Routine] [Next Routine] [List of Routines]
This is only needed for SunView on the Sun386i (when using Large wmenu font).

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/check_menu_size.pro)


CHECK_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi NASA/GSFC 1989.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/check_struct.pro)


CHECK_SUBIMAGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Check_Subimage
 PURPOSE:
	Check for existence, save-status, or display of subimage.
	If needed, force appropriate event to occur.
	Called by Analyze_Event if EFFICIENCY/SCATTER measurement was selected.
 CALLING:
	status = Check_Subimage( uval )
 INPUT:
	uval = string, the task to be performed on subimage.
 OUTPUT:
	Function returns subimage status: 1 = OK to proceed, 0 = do not proceed.
 EXTERNAL CALLS:
	pro Force_Events
 HISTORY:
	written: Frank Varosi HSTX/NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/check_subimage.pro)


COMMIT_XSEC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Commit_Xsec
 PURPOSE:
	Copy the new approximate cross-section into the energy levels array.
	Interpolate/extrapolate the cross-section at the edge frequency.
	Stop events from the draw widget (x-sec plot) and
	start accepting events from the energy level list widget.
	Called by pro Approx_Xsecs_Ev.
 CALLING:
	Commit_Xsec, state
 INPUTS:
	state = structure variable, state of the widget.
 OUTPUTS:
	state = new state of the widget.
 EXTERNAL CALLS:
	function Level_info
	function scalar
 PROCEDURE:
	If approx. x-secs were modified then just move the handles,
	otherwise just free the handles.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/commit_xsec.pro)


CONTOUR_AXES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_axes
 PURPOSE:
	Draw the axes for pro contour_mosaic
 CALLING:
	contour_axes, image_spec, xtit, xtickv, xtickLab, xticm, $
				  ytit, ytickv, ytickLab, yticm
 INPUTS:
	image_spec = structure containing coordinate specifications.
	xtit, ytit = title strings.
	xtickv, ytickv = float arrays.
	xtickLab, ytickLab = string arrays of tick Labels.
	xticm, yticm = # of minor tick marks.
 KEYWORDS:
	TICKLEN = optional, size of tick marks
		(default is the IDL default, negative means outward)
 PROCEDURE:
	Call axis and xyouts, depending on coord.-spec. case.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1990.
	F.V. 1991, adjusted postion of absolute R.A. and DEC. labels.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_axes.pro)


CONTOUR_CALIB

[Previous Routine] [Next Routine] [List of Routines]
 PURPOSE:
	Set fluxes at 2 points in mosaic image,
	then setting factor and offset fields in mosaic_spec structure.
 CALLING:
	contour_calib, mosaic_spec
 INPUT & OUTPUT:
	mosaic_spec = structure with contour display specifications.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1997.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_calib.pro)


CONTOUR_COORDIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_coordin
 PURPOSE:
	Setup up coordinate axes for contour/display of mosaic image.
	Called by pro contour_mosaic.
 CALLING EXAMPLE:
	contour_coordin, mosaic_spec, xcoor, xtit, xtickv, xticm, xtickLab, $
				      ycoor, ytit, ytickv, yticm, ytickLab
 INPUT:
	mosaic_spec = structure containing all needed info.
 KEYWORDS:
	/PLATE_SCALE_SET : to change the arcsec/pixel stored in mosaic_spec.
	/CHANGE_ABSOLUTE : to change the absolute RA-DEC of origin.
 OUTPUTS:
	[x,y]coor = coordinates used in call to plot/contour.
	[x,y]tit = axis titles.
	[x,y]tickv = values for tick marks.
	[x,y]ticm = # of minor tick marks between major ticks.
	[x,y]tickLab = labels for ticks (for RA and DEC option only).
 COMMON BLOCKS:
	common contour_coordin, nticrel, nticabs
	nticrel = approx. # of tick marks to use for relative coordinates.
	nticabs = approx. # of tick marks to use for absol. RA & DEC coord.
 PROCEDURE:
 HISTORY:
	written, Frank Varosi STX @ NASA/GSFC 1990.
	mod, F.V. 1991, use mosaic_spec structure.
	mod, F.V. 1991, define origin and zoom info self consistently.
	mod, F.V. 1991, added common block contour_coordin with defaults.
	mod, F.V. 1996, added options for relative arcmins & degrees.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_coordin.pro)


CONTOUR_DRAW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_draw
 PURPOSE:
	Draw the contours of image as requested in structure image_spec.
	(this is called by pro contour_mosaic)
 CALLING:
	contour_draw, image, xcoor, ycoor, image_spec
 INPUTS:
	image = 2-D array of data
	xcoor, ycoor = x & y coordinate vectors from contour_mosaic.
	image_spec = structure with contour display specifications.
 KEYWORDS:
	HARDCOPY = optional structure variable giving hardcopy specifications.
 RESULTS:
	Contours of image are drawn.
 COMMON BLOCKS:
	common adjct_map, color_map
	common HC_color, grey_map, color_trans
 EXTERNAL CALLS:
	function Min_Curv_Surf		(to get smoother contours)
 PROCEDURE:
	Call "contour" with appropriate parameters, or if Spline is requested,
	first call Min_Curv_Surf to get higher resolution image,
	and then call contour draw recursively, to get smoother contours.
 HISTORY:
	written: Frank Varosi NASA/GSFC 1990-92.
	F.V.1991, added contour Line thickness and spline options.
	F.V.1992, added contours on/off option.
	F.V.1994, generalized contour specs for Lin/Log.
	F.V.1997, use Min_Curv_Surf to get smoother contours when "Spline" set.
	F.V.1998, verify that levels are unique.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_draw.pro)


CONTOUR_INIT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_init
 PURPOSE:
	Setup constants and menu for pro contour_mosaic.
 CALLING:
	menu = contour_init( callers, mosaic_spec )
 INPUTS:
	callers = strarr
	mosaic_spec = structure
 OUTPUTS:
	Function returns string array of menu options.
	All other output thru common blocks.
 COMMON BLOCKS:
	common contour_init, site_name
	common contour_mosaic, Nhc, ArcSec_inch, set_scale
	common contour_options, TickLen, bitspix
	common cursor_scale, cmin_y, cmax_y
	common adjct_map, color_map
	common HC_color, grey_map, color_trans
	common PS_Layout, xoff, yoff, xpap, ypap, Left, Right, Top, Bottom
 EXTERNAL CALLS:
	function the_date
	function reverse
	pro check_menu_size	(for Sun386i/SunView only)
 PROCEDURE:
	Straightforward.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1990.
	F.V.1991, now uses mosaic_spec structure (remembers all settings).
	F.V.1996, incr. yoff & decr. Bottom by 0.2 to fit new Tek color printer.
	F.V.1999, added lager paper size options for a newer Tek color printer.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_init.pro)


CONTOUR_LEVELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_Levels
 PURPOSE:
	Define contour Levels by
	calling function cursor_scale to get user input.
 CALLING:
	contour_Levels, mosaic_spec
 INPUT and OUTPUT:
	mosaic_spec =
 EXTERNAL CALLS:
	function cursor_scale
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1992.
	F.V.1994, generalized contour specs for Lin/Log.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_levels.pro)


CONTOUR_MARKS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_marks
 PURPOSE:
	Draw the Marks (of sources) and Labels on contour-display of mosaic,
	as set interactively by pro contour_markset.
 CALLING EXAMPLE:
	contour_marks, posxy, identify, id2, IMAGE_SPEC=mosaic_spec
 INPUTS:
	posxy
	identify
	id2 =
 KEYWORDS:
	IMAGE_SPEC =
	ROTATE=
	SHOW_SOURCES=
	SHOW_LABELS=
	HC_MODE=
 RESULTS:
	Source marks and Labels are draw on window display or hardcopy file.
 EXTERNAL CALLS:
	function draw_marks
	pro rotate_coordin
 COMMON BLOCKS:
	common contour_marks, sources, Labels
	common HC_color, grey_map, color_trans
 PROCEDURE:
	Setup coordinates, display image, draw axes, draw contours, ....
 MODIFICATION HISTORY:
	written, Frank Varosi NASA/GSFC 1990.
	F.V. 1991, merged code for PostScript & windows into function draw_mark.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_marks.pro)


CONTOUR_MARKSET

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_markset
 PURPOSE:
	Interactively set Marks (of sources) and Labels,
	which will appear on contour-display of image by pro contour_marks.
 CALLING:
	contour_markset, what, posxy, ident1, ident2, IMAGE_SPEC=mosaic_spec
 INPUTS:
	what = string, "SOURCES" or "LABELS"
	posxy = normalized position of contour plot of image in window,
		(2 x 2 matrix).
	ident1 = string, identification of image ( default = image_spec.name ).
	ident2 = string, optional secondary I.D. (default=image_spec.directory).
 KEYWORDS:
	IMAGE_SPEC = structure with display specifications for:
			rotation, coordinate system, window number.
	ROTATE = rotation index (0-7).
	COORDSYS = string array, type of coordinate system.
	WINDOW = window number containing image.
	RELX, RELY = 2 element arrays contain [min,max] of (x,y) coordinates.
	RA_ORIGIN = R.A. of origin when coord.sys. is absolute.
	CALLER = string, name of calling routine.
	/INITIALIZE
	STATUS = integer, output, to indicate user selected return option.
 OUTPUTS:
	None, except for STATUS keyword output.
 RESULTS:
	Source marks and Labels are drawn/deleted/modified on window display,
	and the information is stored in common contour_marks.
 COMMON BLOCKS:
	common contour_marks, sources, Labels	;these are actually drawn.
	common contour_mark1, source_T, Label_T	;these are default templates.
	common contour_mark2, source_Ts		;template for each symbol.
 EXTERNAL CALLS:
	pros:	cursor_coordin	rotate_coordin	contour_mark_op
	funcs:	N_struct	get_words	draw_mark
 PROCEDURE:
	Setup coordinates, display image, draw axes, draw contours, ....
 HISTORY:
	written: Frank Varosi NASA/GSFC 1990.
	F.V. 1991, added display of coordinates as cursor is moved.
	F.V. 1991, created Templates in common block for storing current specs,
		added keyword INIT to just create structures and templates,
		added keyword STATUS to control return and redraw when =2,
		added keyword IMAGE_SPEC to pass image_spec and use it.
	F.V. 1992, code to display/get cursor coordinates -> pro cursor_coordin,
		added option to move/change marks/Labels (pro contour_mark_op).
	F.V. 1996, option to enter coordinates of marks in arcsecond offsets.
	F.V. 1998, use ident2 (.id2) for directory of mosaic file.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_markset.pro)


CONTOUR_MARK_OP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_mark_op
 PURPOSE:
	Perform sets and changes of source marks and Labels,
	for pro contour_markset.
 CALLING:
	contour_mark_op, mark_Lab, attributes
 INPUTS:
	mark_Lab = structure, the mark(s) or Label(s).
	attributes = string, specifying what to modify.
 INPUTS:
	mark_Lab = structure, the modified mark(s) or Label(s).
 EXTERNAL CALLS:
	function N_struct
	function next_word
 HISTORY:
	written: Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_mark_op.pro)


CONTOUR_MIN_MAX

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi NASA/GSFC 1992.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_min_max.pro)


CONTOUR_MOSAIC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_mosaic
 PURPOSE:
	Display a mosaic-image with selectable/optional contours,
	coordinate axes (relative or absolute), titles, Labels, and marks.
	Options include: filtering, scaling, zooming, choosing Levels...
	Hardcopy in grey scale or pseudo-color (using PostScript).
 CALLING:
	contour_mosaic, mosaic, mosaic_spec, mosaic_info, Return_Task
 INPUTS:
	mosaic = 2-D array (an image).
	mosaic_spec = structure with contour display specifications.
	mosaic_info = array of structures with info on raw mosaic.
 KEYWORDS:
	IMAGE_OVERLAY = second mosaic-image to superimpose as contours.
	SPECS_OVERLAY = display specifications of second mosaic-image.
	CALLERS = string array, names of calling routines for return options.
	/NO_MENU causes immeadiate return after graphics, skipping menu options.
	/HARDCOPY causes jump to hardcopy menu options, write to file, return.
 OUTPUTS:
	mosaic_spec = structure with new contour display specifications.
	Return_Task = string, indicating user selected type of return.
 EXTERNAL CALLS:
	funcs:	contour_init	get_words	zoom_mosaic
	pros:	color_st_Load	contour_setup	contour_coordin
		contour_axes	contour_titles	contour_draw	contour_calib
		Look_mosaic	get_window	save_mosaic	set_Hard_Copy
		contour_marks	contour_markset
						and many more...
 COMMON BLOCKS:
		many
 PROCEDURE:
	Setup coordinates, display image, draw axes, draw contours, ....
 HISTORY:
	written: Frank Varosi NASA/GSFC 1989.
	F.V.1990, added source marks and Labels option.
	F.V.1991, use mosaic_spec structure (remembers all specifications).
	F.V.1991, added Truncate (min/max scaling) option.
	F.V.1991, added interactive Zoom option (pro zoom_mosaic).
	F.V.1991, mod to plot axes first and call contour seperately.
	F.V.1992, option to overlay contours of a second image.
	F.V.1994, added /NO_MENU and /HARDCOPY keyword options.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_mosaic.pro)


CONTOUR_OPTIONS

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi NASA/GSFC 1990.
F.V.1992, separated contour specific options from pro display_options.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_options.pro)


CONTOUR_SCALING

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_scaling.pro)


CONTOUR_SETUP

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_setup
 PURPOSE:
	Setup mosaic image arrays for contour display.
 CALLING:
	contour_setup, mosaic_orig, mosaic_spec, mosaic, mos_ps
 INPUTS:
	mosaic_orig = original mosaic data image array (floating point).
	mosaic_spec = structure containing specs. such as coordinate origin,
		rotation angle, smoothing, zoom on subregion, truncation, etc.
 KEYWORDS:
	/COLOR_SCALE : causes display of color bar with scale in own window.
 OUTPUTS:
	mosaic = image array (floating) result of mosaic_spec operations.
	mos_ps = same image array scaled to bytes for display in window or PS.
 EXTERNAL CALLS:
	function N_struct
	function RotMag
	function zoom_mosaic
	function filter_mosaic
	pro color_scale
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1992.
	F.V. 1994, added rotation by any angle (RotMag).
	F.V. 1997, added calibration by factor and offset.
	F.V. 1998, made rotation pivot around selected origin of coordinates.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_setup.pro)


CONTOUR_TITLES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	contour_titles
 PURPOSE:
	Draw the Titles and subtitles for pro contour_mosaic
 CALLING:
	contour_titles, image_spec, posxy
 INPUTS:
	image_spec = structure containing all text for titles and subtitles.
	posxy = position of contour plot in normalized window (IDL protocol)
 KEYWORDS:
	HC_FILE = string, file name when doing hardcopy output.
	/ERASE
 PROCEDURE:
	Call xyouts.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1990.
	F.V. 1991, added option /ERASE to redraw titles (without re-contouring)

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/contour_titles.pro)


CONV_ELEVS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Conv_ELevs
 PURPOSE:
	Convert energy levels from Rydberg units to wave-number/cm,
	and make them all positive relative to fundamental (minimum) level.
	Also returns structure with ionization energy and other info.
	Can be called just once after reading energy Levels from TOPBASE
	(routine will not apply converson twice).
 CALLING:
	Conv_ELevs, ELevs, ion_info
 INPUTS:
	ELevs = array of structures with tags for
		energy of level, quantum numbers, etc. (see Read_ELevs).
 OUTPUTS:
	ELevs = same structure with energy converted to wavenumber per cm.

	ion_info = scalar structure variable, basic info about atom/ion.

 EXTERNAL CALLS:
	function N_struct
	function get_words
	function get_text_input
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.
	F.V.1995, mod to allow user to change ionization energy.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/conv_elevs.pro)


CONV_LOC_SLPE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Conv_Loc_SLPE
 PURPOSE:
	Convert cursor Location to SLP and Energy.
 CALLING:
	Conv_Loc_SLPE, Lx, Ly, cinfo, zratio, ISLP, Energy, ASLP
 INPUTS:
	Lx, Ly = cursor Location
	cinfo = structure, coordinate system info.
	zratio = ratio of max zoom to current [x,y] zoom factors.
 OUTPUTS:
	ISLP = integer, quantum numbers.
	Energy = floating point.
	ASLP = string, SLP in standard characters (e.g. 2Pe).
 COMMON BLOCKS:
	common Conv_Loc_SLPE, Lchar, Pchar
 EXTERNAL CALLS:
	function N_struct
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/conv_loc_slpe.pro)


COORDIN_RANGE

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	coordin_range
 PURPOSE:
	Get the range of arc-sec coordinate system for raw mosaic structure.
 CALLING EXAMPLE:
	range = coordin_range( Raw_Mosaic, /IN_WINDOW )
 INPUTS:
	Raw_Mosaic = structured array of images (image_List type structure)
			or image pointers (mosaic_List type structure),
			containing fields for ARCSX and ARCSY.
 KEYWORDS:
	/IN_WINDOW : then computes coordinate range for whole of current window.
 RESULT:
	Function returns a 2 by 2 matrix: [ [xmin,ymin], [xmax,ymax] ] (arcsec).
 EXTERNAL CALLS:
	function N_struct
 PROCEDURE:
 MODIFICATION HISTORY:
	Written, Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/coordin_range.pro)


COPY_COORDIN

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1989.
F.V. 1991, mod to use copy_struct_inx.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/copy_coordin.pro)


CREATE_GROUP

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1989.
F.V. 1991 put selection code into pick_images,
    and made into function returning group #.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/create_group.pro)


CREATE_MOSAIC

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	create_mosaic
 PURPOSE:
	Ask user about what & how to average/splice, then
	setup the call to function average_images( raw_mosaic, ... ) or
		 	  function splice_images( raw_mosaic, ... ).
	 and return mosaic_info: a record of what was averaged.
 CALLING EXAMPLE:
	mosaic = create_mosaic( raw_mosaic, mosaic_info, mtitle )
 INPUTS:
	raw_mosaic = structured array of images with relative Location info.
 KEYWORDS:
      /SPLICE_IMAGES : splice instead of average overlaps, so that
			pixels showing on top stay on top in result.
 OUTPUTS:
	mosaic_info = array of structures with just the info of raw_mosaic.
	mtitle = string.
 RESULT:
	Function returns the mosaic image
 COMMON BLOCKS: 
	common mosaic_options1, border, back_set
 EXTERNAL CALLS:
	function N_struct
	function pick_images
	function average_images
	function splice_images
	function mosaic_struct
	pro copy_struct_inx
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1990
	F.V. 1991 use copy_struct_inx (saves memory when copying subsets).
	F.V. 1991 added enhanced menu for image selection.
	F.V. 1992 added splice option (instead of averaging).

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/create_mosaic.pro)


CURSOR_COORDIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	cursor_coordin
 PURPOSE:
	Display of coordinates as cursor is moved,
	and, when a mouse button is pressed,
	return cursor coordinates (curx,cury) (default is  normalized),
	and also coordinates (cxscal,cyscal) shifted by CMIN & scaled by CSIZE,
	and rotated/zoomed if specified by ROTATE and ZOOM.
 CALLING:
	cursor_coordin, curx, cury, cxscal, cyscal

 KEYWORD INPUTS:
	CMIN=
	CSIZE=
	/CLIP
	COORDSYS = 2 element string array:
				coordsys(0) = "Absolute", "Relative" or "Offset"
				coordsys(1) = "Arcseconds" or "Pixels"
			default = [ "Relative", "Arcseconds" ] .
	RA_ORIGIN=
	RELX, RELY=
	XYRANGE = 
	ROTATE=
	ZOOM_FAC=
	ZOOM_OFF=
	/DEVICE_COORDIN : curx, cury are then scaled into device coordinates.
	/RELATIVE_COORD : cxscal, cyscal are scaled into relative coordinates.
 OUTPUTS:
	curx, cury = coordinates of cursor location (default is  normalized),
	cxscal, cyscal = normalized coordinates shifted by CMIN
			and scaled by CSIZE:  ([ curx, cury ] - cmin)/csize
			and then rotated and zoomed, if requested.
 EXTERNAL CALLS:
	pro rotate_coordin
 PROCEDURE:
	Monitor the cursor in a Loop while displaying coordinates of
	current Location (update only when cursor move).
	Return the Location when mouse button is pressed.
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1992.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/cursor_coordin.pro)


CURSOR_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Cursor_Info
 PURPOSE:
	Display cursor Location in terms of SLP and Energy in status widget.
 CALLING:
	Cursor_Info
 INPUTS:
	All from common block.
 OUTPUTS:
	None.
 COMMON BLOCKS:
	common modion_Widget, modion_widget
	 and see file: ~/modion/code/modion_common.pro
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/cursor_info.pro)


DATE_TIME

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	date_time
 PURPOSE:
	Convert integer day, month, year, hour, minutes, seconds, into strings.
 CALLING:
	date_time, info, date, time
 INPUTS:
	info = structure with tags containing header information.
 OUTPUTS:
	date = string array of month/day/year.
	time = string array of hour:minute:second.
	ymd = string array of year/month/day.
	ymd_hms = string array of year/month/day-hour:minute:second.
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1996.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/date_time.pro)


DECONV_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	DeConv_images
 PURPOSE:
	Interactively select image and PSF from a collection and
	then select and apply various deconvolution methods.
 CALLING:
	image_deconv = deconv_images( image_List, deconv_info )
 INPUTS:
	image_List = array of structures containing images and information.
 KEYWORDS:
	DATA = optional, pooled-array containing the image data, if not with
		the structure, then image_List has pointers into this array.
 OUTPUTS:
	deconv_info = array of structures containing deconv. statistics.

	Function returns an image, the deconvolution result.

 EXTERNAL CALLS:
	function select_image
	pro border_images
	pro DeConv_Tool
 COMMON BLOCKS:
	common DeConv_images, Lag_min
 PROCEDURE:
	Get image & PSF and call pro DeConv_Tool.
 HISTORY:
	Written: Frank Varosi, NASA/GSFC 1992.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/deconv_images.pro)


DEFINE_ORIGIN

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	define_origin
 PURPOSE:
	Define origin of arc-second coordinate system for raw mosaic structure.
	Fields in structure giving relative arc-seconds are updated.
 CALLING:
	define_origin, Raw_Mosaic, xorg, yorg

 INPUTS and OUTPUTS:

	Raw_Mosaic = structured array of images (image_List type structure)
			or image pointers (mosaic_List type structure),
			containing fields for ARCSX and ARCSY, and
			these fields are updated with new coordinates.

	xorg, yorg = window (device) coordinates (optional) to be the origin,
		If (xorg,yorg) are not given,
			then users selects origin with mouse-cursor.
 KEYWORDS:
	/CHECK_SCALE : causes the current relative coordinates to be
			checked for consistency with current plate scale,
		and if inconsistent the origin is set to center of mosaic.
 EXTERNAL CALLS:
	function check_struct
	function draw_mark
 COMMON BLOCKS:
	common array_scale, ArcSec_Pix_x, ArcSec_Pix_y
	Plate scale of pixel array, used if not containing within structure.
 PROCEDURE:
	Straightforward.
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1989.
	F.V.1993, check for and use arc-seconds/pixel scale from structure.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/define_origin.pro)


DEFINE_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 define all structures used in prep.pro and mosaic.pro ,
 image_List1,2,3,4 , image_inven1,2  are same except for magnification factor
  of images to get scaled images for display.
 Frank Varosi NASA/GSFC 1989
 F.V. 1991, added image_List0 for magnification 1/2.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/define_struct.pro)


DEF_IMHD_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	def_imhd_struct
 PURPOSE:
	Define and return header structure containing info about MAMA image.
 CALLING:
	To create empty structure:

		header = def_imhd_struct( hx, hy )

	or if structure variable is obtained by calling get_macq_status:

		header = def_imhd_struct( STATUS_STRUCT = status_info )
 KEYWORDS:
	STATUS_STRUCT = structure variable obtained from
		function get_macq_status containing info about MAMA status,
		or function get_ccd_status containing info about CCD status,
		this info is copied to image header.
 INPUTS:
	hx, hy = size of hot spot array (but usually keyword STATUS is used).
 OUTPUT:
	Function returns the image header structure variable.
 EXTERNAL CALLS:
	pro copy_struct
 HISTORY:
	Frank Varosi NASA/GSFC 1993.
	F.V. 1994, generalize to hold CCD info also.
	F.V. 1994, added sub-structure for device axes.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/def_imhd_struct.pro)


DEF_STAT_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
	Define status block (structure) for receiving info. from -macq-

  To define short structure without the hot-spot array:

	mstat = def_stat_struct( )

  To get FULL structure with hot-spot array, pass previously obtained status:

	mstat = def_stat_struct( mstat )

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/def_stat_struct.pro)


DEVICE_AXES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	device_axes
 PURPOSE:
	Return the device-axis structures for axes that are being used.
 CALLING:
	dev_axes = device_axes( Maxis )
 INPUTS:
	Maxis = max and min # of axes to return (always returns Maxis elements),
		default = 1.
 KEYWORDS:
	/INITIALIZE : just return empty axis structures, for initialization.
 OUTPUTS:
	Function returns an array of structures with positions of device-axes.
 EXTERNAL CALLS:
	function N_struct
	function gpib_dev_struct
 COMMON BLOCKS:
	common gpib, devices				;the device positions.
	common gpib_dev_struct, gpib_dev, dev_axis	;structure templates
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/device_axes.pro)


DEV_POS_HEADER

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	dev_pos_header
 PURPOSE:
	Copy device-axis information from structured array to FITS header.
 CALLING:
	fh_devpos = dev_pos_header( dev_axes )
 INPUTS:
	dev_axes = array of axis structures (from function dev_axes).
 OUTPUTS:
	Function returns FITS header, a string array.
 EXTERNAL CALLS:
	pro sxaddpar
	function N_struct
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/dev_pos_header.pro)


DEV_POS_STRUCT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	dev_pos_struct
 PURPOSE:
	Recreate the device-axis structure array from FITS header info.
	Called by pro header_from_fits.
 CALLING:
	dev_axes = dev_pos_struct( fh_devpos, dev_axes )
 INPUTS:
	fh_devpos =
	dev_axes = empty array of device-axis structures.
 OUTPUTS:
	Function returns an array of structures with positions of device-axes.
 EXTERNAL CALLS:
	pro sxpar
	function N_struct
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/dev_pos_struct.pro)


DEV_SETUP_LOAD

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

 PURPOSE:
	Restore from a file the saved structure variable(s)
	for particular GPIB device(s), and then command the
	device axes to move to the positions contained in structure.

	Default is to assume widgets (e.g. Klinger_Control) are being used
	and the move commands are generated by setting automatic timers
	on the move buttons. Therefore, if a move button does not exist
	(hidden axis controls) then that axis is not moved.

	Filename is always of form: "dev_setup." + dev_name.* , so that
	the last field identifies different setups for each device.
	The PickFile widget will allow user to select from such a list.

 CALLING:
	dev_setup_Load, dev_name
 INPUT:
	dev_name = string, name of device, thus specifying a filename
		filter to search for saved setups of desired device.
 KEYWORDS:
	FILENAME = optional string specifying the exact filename containing
		the device structure variable to restore, 

	/WAIT : wait until each move command is completed.
		Default is to command each device/axis to move asynchronously,
		and in the case of multiple axes on one controller,
		automatically wait until other axis is finished, then move.
 EXTERNAL CALLS:
	pro move_device
	function N_struct
	function VarType
	function get_dev_num
	function PickFile
 COMMON BLOCKS:
	common gpib, devices	;structured array of device names, handles, etc.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1993.
	F.V. 1994, new method: set timers on move button of widgets.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/dev_setup_load.pro)


DEV_SETUP_SAVE

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

 PURPOSE:
	Save the positions and all info contained in structure variable
	for a particular GPIB device, or devices, to a file.
	Filename always of form: "dev_setup." + dev_name.* , so that
	the last field identifies different setups for each device.

 CALLING:
	dev_setup_save, dev_nums

 INPUT:
	dev_nums = integer, or array, the indices of device(s) in
			common gpib, devices array of structures.
 KEYWORDS:
	NAME = optional string or string array of device names,
		used if dev_nums is not given.
 EFFECTS:
	The device structure variables are saved to a file.

 EXTERNAL CALLS
	function N_struct
	function get_dev_num
 COMMON BLOCKS:
	common gpib, devices	;structured array of device names, handles, etc.
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/dev_setup_save.pro)


DE_GULCH[1]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	de_gulch
 PURPOSE:
	Gulch effect caused by intense source in images
	will be removed by LLsq fitting of row thru source
	to rows away from source and subtracting fit
	to return flat fielded image.
 CALLING EXAMPLE:
	image_degulched = de_gulch( image, fit_coef, /INTER )
 INPUTS:
	image = 2D array of data
 KEYWORDS:
	DEGREE = polynomial degree of fit, default = 1 for Linear fit.
	/INTERACTIVE : allows specification of gulch fit percentage.
	/PLOT : plots fit result against data.
 OUTPUTS:
	fit_coef = coefficients of LLsq fit.
 RESULT:
	Function returns the flat fielded image (gulch supressed).
 EXTERNAL CALLS:
	function filter_image
	function conv_vartype
	function poly_fit
	function poly
 PROCEDURE:
 MODIFICATION HISTORY:
	Written, Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_gulch.pro)


DE_GULCH[2]

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	de_gulch
 PURPOSE:
	Removal of stripes caused by channel gain differences, and interactive
	removal of gulch caused by intense point source in a mosaic image.
	Note: de-stripe should be performed first before de-gulch.
	BUG:  must return & keep result of de-stripe before doing de-gulch.
 CALLING :
 INPUTS:
 KEYWORDS:
 OUTPUTS:
 EXTERNAL CALLS:
 PROCEDURE:
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe_gulch.pro)


DE_GULCH_OLD

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1991
F.V. 1991, added interactive option (keyword /INT).

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_gulch_old.pro)


DE_GULCH_SORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	de_gulch_sort
 PURPOSE:
	Estimate column pattern background in an image by
	sorting columns and then subtract the background
	to return flat fielded image.
 CALLING EXAMPLE:
	image_flat = de_gulch_sort( image, sky, MIN_SORT=9 )
 INPUTS:
	image = 2D array of data
 KEYWORDS:
	MIN_SORT = index of which element of sort to use at background,
		MIN=0 causes minimum to be the assumed background,
		MIN = #pixels_per_row/2 causes median to be used (default).
 OUTPUTS:
	imback = the estimated sky or row/column pattern background.
 RESULT:
	Function returns the flat fielded image (background subtracted).
 EXTERNAL CALLS:
	function flat_by_sort
 PROCEDURE:
 MODIFICATION HISTORY:
	Written, Frank Varosi NASA/GSFC 1992.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_gulch_sort.pro)


DE_STRIPE

[Previous Routine] [Next Routine] [List of Routines]
Reduce the even/odd channel amplifier variation (vertical stripes) by using
Least squares fit to determine the 2nd order polynomial relation
  between adjacent channels.
Frank Varosi STX @ NASA/GSFC 1991

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe.pro)


DE_STRIPE_1

[Previous Routine] [Next Routine] [List of Routines]
Reduce the even/odd channel amplifier variation (vertical stripes) by using
Least squares fit to determine the 2nd order polynomial relation
  between adjacent channels.
Frank Varosi STX @ NASA/GSFC 1991

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe_1.pro)


DE_STRIPE_2

[Previous Routine] [Next Routine] [List of Routines]
Eliminate the even/odd channel amplifier variation (vertical stripes) by
 averaging adjacent pixels (2x2 box-car smoothing),
 and then shifting image by -1/2 pixel to maintain original positions.
Note that resolution is then degraded from 1x1 to 2x2 pixels.
Frank Varosi STX @ NASA/GSFC 1992

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe_2.pro)


DE_STRIPE_3

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1995

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe_3.pro)


DE_STRIPE_BIB

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1995

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe_bib.pro)


DE_STRIPE_SPIRAC

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1995

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/de_stripe_spirac.pro)


DISPLAY_ALL

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_ALL
 PURPOSE:
	For the MODION widget:
	Display all energy levels, transitions and axes in draw widget windows.
	Usually called by pro Draw_Axes_Set_V of CW_Draw_Axes widget,
	when value is set by the Modion widget.
	Assumes that the draw widget windows are already erased.
 CALLING:
	Display_ALL, widgst
 INPUTS:
	widgst = structure, state and info of CW_Draw_Axes widget.

		and variables in common blocks.
 OUTPUTS:
	None.
 COMMON BLOCKS:
	common modion_Widget, modion_widget
		and see file: ~/modion/code/modion_common.pro
 EXTERNAL CALLS:
	pro Display_ELevs
	pro Display_Trans
	pro Display_SupLevs
	function N_struct
 PROCEDURE:
	Straightforward.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.
	Mod: F.V. 1995, added call to Display_SupLevs.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_all.pro)


DISPLAY_ELEVS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_ELevs
 PURPOSE:
	Display the Energy Levels obtained from TOPBASE (atomic database)
	as horizontal lines with color indicating status.
	Default is to display just Levels that have non-zero color.
 CALLING:
	Display_ELevs, ELevs
 INPUTS:
	ELevs = array of structures with tags for graphic Location of Levels.
 KEYWORDS:
	/NEW : display only Levels for which ELevs.disp EQ 1 and color GT 0.

	WHICH = array of subscripts indicating which Levels to display,
		default is to display ones with non-zero color.

	ZOOM_FACTOR = magnification to be applied to:
		both x & y axes if one number is specified, or
		x & y axes respectively if two numbers are specified.

	PANXY = two numbers specifying x & y translation in device coordinates.
 OUTPUTS:
	ELevs = the "disp" tag of each Level displayed is set to zero.
 EXTERNAL CALLS:
	function N_struct
 PROCEDURE:
	Display energy levels using TV, in backwards order to avoid
	obscuring display with the ionization line (which is last in array).
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_elevs.pro)


DISPLAY_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	display_images
 PURPOSE:
	Display images from the List into specified window,
	with respective Locations as specified in structure,
	and stacked in the order given by their visibility Levels.
 CALLING EXAMPLE:
	display_images, image_List [ , image_pool, /RESIZE ]
 INPUTS:
	image_List = structured array containing images and specifications
	image_pool = optional array containing the images,
		in such case image_List has pointers into array image_pool.
 KEYWORDS:
	INUMS = specify indices of images in the List (default is all).
	GROUP = specify group # of images (default is all groups).
	/ERASE : erase window before display of images.
	/RESIZE : resize window to accomodate all images.
	WINDOW = window # in which to display (default is image_List(0).windo)
	XPOS, YPOS = position of window on monitor (only if /RESIZE),
			default = upper right corner of monitor.
 EXTERNAL CALLS:
	pro display_image	(to handle display of each individual image)
	pro get_window
	pro resize_window
	function N_struct
	function check_Mag_Fact
 SYSTEM VARIABLES:
	!DEVX , !DEVY = size of monitor screen in pixels.
 COMMON BLOCKS:
	common display_images, min_xsiz      ;the mininum X-size of window
	common display_images2, always_all	;flag to force display of all
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1989
	F.V.1991, added /RESIZE keyword option to resize window around images.
	F.V.1992, generalized for collection of arbitray images {mosaic_List}.
	F.V.1997, mod to display only top image in a trivial stack of many.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_images.pro)


DISPLAY_INBAND

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_InBand
 PURPOSE:
	Display the inband filter transmission & uniformity analysis results.
 CALLING:
	Display_InBand, fs_inband
 INPUT:
	fs_inband = structure containing inband transmission analysis results.
 OUTPUTS:
	None.
 EXTERNAL CALLS:
	function N_struct
	function get_text_input
	pro psport
	pro psclose
	pro plot_Peak_Tr
	pro plot_TranSpec
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1996.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_inband.pro)


DISPLAY_INBAND1

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_InBand1
 PURPOSE:
	Display the inband filter transmission & uniformity analysis results.
 CALLING:
	Display_InBand1, inbsp
 INPUT:
	inbsp = structure containing inband transmission analysis results.
 OUTPUTS:
	None.
 EXTERNAL CALLS:
	function N_struct
	function get_words
	function strconcat
	pro get_window
	pro tvs
	pro printw
	pro tvcircle
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1996.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_inband1.pro)


DISPLAY_MOSAIC

[Previous Routine] [Next Routine] [List of Routines]
 PURPOSE:
 CALLING:
	display_mosaic, mosaic, mosaic_spec
 INPUT:
	mosaic = 2D image array.
	mosaic_spec = structure with contour display specifications.
 HISTORY:
	Frank Varosi STX @ NASA/GSFC 1989.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_mosaic.pro)


DISPLAY_MOSAICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	display_mosaics
 PURPOSE:
	Restore, Select, and Display mosaic images (or could be any images).
 CALLING:
	display_mosaics, mosaic, mos1_spec, mos1_info
 INPUTS:
	No input arguments required,
	all input is thru common mosaic_array:

	mosaics = pooled-array of images, pointed to by mosaic_specs.
	mosaic_specs = array of structures containing specs. and
			pointers into the array (pool): mosaics.
	mosaic_infos = array of structures containing info about
			how each mosaic image was formed.

	Each single mosaic image is extracted from array mosaics.

 OUTPUTS:
	mosaic = the current mosaic image being displayed.
	mos1_spec = structure containing display specifications for mosaic.
	mos1_info = structure with info about how mosaic image was formed.
	Return_Task = string, next task requested by user.

	These above are optional arguments,
	all important output is thru common mosaic_array.

 EXTERNAL CALLS:
	pro restore_mosaic
	pro save_mosaic
	pro contour_mosaic
		and many more...
 COMMON BLOCKS:
	common display_mosaics, imos
	common mosaic_array, mosaics, mosaic_specs, mosaic_infos
	common dir_names, dirinv, dirmos_raw, dirmos_aver
	common dir_name1, dir_FITS
 PROCEDURE:
	Loop on menu and case, calling requested procedures and functions.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1989.
	F.V. 1990, added Profile and Show fluxes options.
	F.V. 1991, converted to use Mosaic_Specs structure.
	F.V. 1991, option save mosaic now also saves corresponding Mosaic_Spec.
	F.V. 1991, added de-gulch & de-stripe option.
	F.V. 1992, added option to contour 2 mosaics by overlaying.
	F.V. 1994, added option to update (replace) old mosaic with current.
	F.V. 1994, added HARDCOPY option.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_mosaics.pro)


DISPLAY_NEW

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_NEW
 PURPOSE:
	For the MODION widget:
	Find the energy levels that are flagged as newly selected or modified
	and display them in the central draw widget window.
	Usually called by pro Draw_Axes_Set_V of CW_Draw_Axes widget,
	when value is set by the Modion widget.
 CALLING:
	Display_NEW, widgst
 INPUTS:
	widgst = structure, state of CW_Draw_Axes widget.
 OUTPUTS:
	None.
 COMMON BLOCKS:
	common modion_ELevs, ELevs
	common modion_Widget, modion_widget
 EXTERNAL CALLS:
	pro Display_ELevs
 PROCEDURE:
	Straightforward.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_new.pro)


DISPLAY_OPTIONS

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi NASA/GSFC 1990.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_options.pro)


DISPLAY_REFRESH

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_Refresh
 PURPOSE:
	For the MODION widget:
	Refresh the display of energy levels and transitions in
	the main draw widget window. Usually called by pro Draw_Axes_Set_V
	of CW_Draw_Axes widget, when value is set by the Modion widget.
 CALLING:
	Display_Refresh, widgst
 INPUTS:
	widgst = structure, state and info of CW_Draw_Axes widget.

		and variables in common blocks.
 OUTPUTS:
	None.
 COMMON BLOCKS:
	common modion_Widget, modion_widget
		and see file: ~/modion/code/modion_common.pro
 EXTERNAL CALLS:
	pro Display_ELevs
	pro Display_Trans
	pro Display_SupLevs
 PROCEDURE:
	Straightforward.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_refresh.pro)


DISPLAY_SUPLEVS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_SupLevs
 PURPOSE:
	Display the super-Levels created by user, as boxes around the
	merged energy Levels, and display group number at upper-right corner.
 CALLING:
	Display_SupLevs, SupLevs
 INPUTS:
	SupLevs = array of structures with tags giving Location of superlevels.
 KEYWORDS:
	ZOOM_FACTOR = magnification (default=1) to be applied to:
		both x & y axes if one number is specified, or
		x & y axes respectively if two numbers are specified.
 OUTPUTS:
	None.
 EXTERNAL CALLS:
	function N_struct
 PROCEDURE:
	Create coordinates of boxes from corner Locations and call IDL plots.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_suplevs.pro)


DISPLAY_TRANS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Display_Trans
 PURPOSE:
	Display the allowed transitions between energy levels as selected.
 CALLING:
	Display_Trans, Trans
 INPUTS:
	Trans = array of structures with fields for graphics device Location of
		transitions between energy levels.
 KEYWORDS:
	ZOOM_FACTOR = magnification (default=1) to be applied to:
		both x & y axes if one number is specified, or
		x & y axes respectively if two numbers are specified.
	PANXY = two numbers specifying x & y translation in device coordinates,
		default = [0,0].
 OUTPUTS:
	None.
 EXTERNAL CALLS:
	function N_struct
 PROCEDURE:
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/display_trans.pro)


EDGE_IMSCALED

[Previous Routine] [Next Routine] [List of Routines]
check the scaled image if just central subset of image is to be displayed,
	(so unsmoothed edges are not displayed when image is smoothed),
 return the width of unsmoothed edge divided by Magnification, unless /MAGNIF.
Frank Varosi NASA/GSFC 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/edge_imscaled.pro)


EFFICIENCY

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

 PURPOSE:
	Create a widget to control the analysis of grating efficiency data
	and then display/hardcopy the computed efficiency curves.

 CALLING:
	Efficiency

 KEYWORD INPUTS:

	GROUP = the ID of the widget that calls this procedure,
		if specified, death of caller results in death of this widget.

	PARENT = the ID of the widget which is to be the top level base of the
		new widget created by this procedure. If specified,
		this Efficiency widget is just defined but not realized.

	XPOS, YPOS = desired position on screen of free base (no parent) widget.

 EFFECTS:
	Initiates the Xmanager if it is not already running.

 EXTERNAL CALLS:
	pro Xmanager
	function widget_Tree_Map
 COMMON BLOCKS:
	common Efficiency, effic_widget
 PROCEDURE:
	Create and register the widgets with the Xmanager.
	Selection events are then processed by pro Effic_Event.
 HISTORY:
	Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/efficiency.pro)


ERROR_ANALYSIS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	error_analysis
 PURPOSE:
	Compute the expected relative error in tranmission images based
	on the estimated the error properties of original IN & OUT data.
 CALLING:
	error_analysis, image_List
 INPUT and OUTPUT:
	image_List = structured array with substructures .info and .info_ref.
		The tag image_List.Rel_Error is updated.
 HISTORY:
	written, Frank Varosi 1997.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/error_analysis.pro)


ERROR_INFO

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	error_info
 PURPOSE:
	Define structure for storing error (noise) information and
	if image array is passed then estimate the error properties of image.
	Called by function headinfo to define the structures, and
	then used by function sig_ref.
 CALLING:
	einfo = error_info( image )
 INPUTS:
	image = 2D array
 KEYWORDS:
	/NO_TITLE : suppress printing of title line when results are printed
		via call to pro print_struct.
 OUTPUTS:
	Function returns information about errors (expected values and variance)
	in image as a structure variable.
 COMMON BLOCKS:
	common TUT_setup, center_xy, cradius
	common error_info, boxsize, reject
 EXTERNAL CALLS:
	function Local_Variance
	function Disk_Region
	function Trapez
	function stdev
	pro MinMax_Histo
	pro Bin_Scat
 PROCEDURE:
	Compute local variances and histograms in central disk region,
	then integrate sqrt(variance) with respect to histogram distribution.
 HISTORY:
	written, Frank Varosi 1997.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/error_info.pro)


EXPORT_IMPORT

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	export_import
 PURPOSE:
	Transfer (add/replace) images from PREProcess inventory structures
	to TOFU image_List (TUT_images) structures.
 CALLING:
	export_import, image_List, image_inven

 INPUTS & OUTPUTS:
	image_List =
	image_inven =
 EXTERNAL CALLS:
	function check_struct
	function N_struct
	function merge_images
	pro organize_images
	pro Tofu_Task
 COMMON BLOCKS:
	common control, cur_pro, win_mos, win_prep
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1989.
	Mod for TOFU: F.V.1996.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/export_import.pro)


FILTER_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	filter_images
 PURPOSE:
	Select and apply one of 4 filters to all or a subset of images
	in the collection (image_List, usually a raw mosaic).
	User has the option to replace images, or make new versions
	thereby keeping original images in the List.
 CALLING:
	filter_images, image_List [ , INUMS=inums, /REDISPLAY ]
 INPUT and OUTPUT:
	image_List = structured array containing images and other info.
 KEYWORDS:
	INUMS = indices of filtered images in the structured array image_List.
	/REDISPLAY causes the filtered images to be rescaled and redisplayed.
 EXTERNAL CALLS:
	function filter_image
	function sig_ref
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1996.
	F.V.1997, added outlier sigma filter option.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/filter_images.pro)


FILTER_MOSAIC

[Previous Routine] [Next Routine] [List of Routines]
Frank Varosi STX @ NASA/GSFC 1989.
F.V.1991, modif to use mosaic_spec structure.
F.V.1991, use filter_image to process ALL_PIXELS.
F.V.1991, added "iterate" filter (applies smooth(3) iteratively).
F.V.1992, use fields .maxF & .minF for min-max of filtered mosaic.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/filter_mosaic.pro)


FILTER_MOSAICS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	filter_mosaics
 PURPOSE:
	Select and apply one of 6 filters to all or a subset of images
	in the collection mosaic_List.
 CALLING:
	filter_mosaics, mosaic_List, mosaic_images [ , INUMS=inums, /REDISPLAY ]
 INPUT and OUTPUT:
	mosaic_List = structured array containing pointers into mosaic_images.
	mosaic_images = array containing the image data.
 KEYWORDS:
	INUMS = indices of filtered images in the structured array mosaic_List.
	/REDISPLAY causes the filtered images to be rescaled and redisplayed.
 EXTERNAL CALLS:
	funcs:	filter_image	sigma_filter	de_stripe	de_gulch
		pick_images	select_number	next_word	N_struct
	pros:	outlier_filter
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1991 (adapted from pro filter_images).
	F.V.1993, added iterate, sigma_filter, De_Stripe, and De_Gulch options,
		and return indices of filtered images via keyword INUMS.
	F.V.1994, added Nsigma and iterate options when using sigma_filter.
	F.V.1997, added outlier_filter option, usually better than sigma_filter.
	FV, 1999, ask for FWHM=#pixels with "iterate smooth(3) -> Gaussian".

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/filter_mosaics.pro)


FILT_RED

[Previous Routine] [Next Routine] [List of Routines]
 reduce transmission data in IDL in loop above transreduc.pro
 revised:  14-june-96 TAN


(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/filt_red.pro)


FILT_RED_ORIG

[Previous Routine] [Next Routine] [List of Routines]
 reduce transmission data in IDL in loop above transreduc.pro
 revised:  14-june-96 TAN
 revised:   27 july 96 DAC -- bin to 129 by 129 hardwired

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/filt_red_orig.pro)


FIND_DEVICES

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

 PURPOSE:
	Clear and allocate the GPIB interface,
	get handles (for I/O) of the requested GPIB devices,
	and store handles and device names in a structured array
	(in common gpib, devices).
	If find_devices has been called previously, only the new
	devices are concatenated with the existing ones in common.

 CALLING:
	find_devices, dev_names

 INPUT:
	dev_names = string array, names of the devices on GPIB interface.

 KEYWORDS:
	/ASK_USER : cause a yes/no menu to appear asking user if they
		really want to allocate the GPIB and its devices.
 OUTPUT:
	No explicit output, results are stored in common gpib, devices.

 EXTERNAL CALLS:
	function gpib_dev_struct
	function N_struct
	function IBFIND

 COMMON BLOCKS:
	common gpib, devices	;structured array of device names, handles, etc.
 PROCEDURE:
	Create the device info structure,
	call IBFIND to get all the device handles,
	concatenate with any existing devices.
	Note that device names & handles are also stored in the axis structure,
	for convenience and cross-referencing.
	The first time find_devices is called, the input array dev_names
	is checked to make sure a GPIB interface is specified (default = gpib0)
	and this interface is first cleared before proceeding (with IBSIC).
 HISTORY:
	Written, Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/find_devices.pro)


FIND_IMAGES

[Previous Routine] [Next Routine] [List of Routines]
return image number(s) containing (x,y) in current window.
 Frank Varosi NASA/GSFC 1989
 F.V. added option to require (x,y) to be interior of images, 1991.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/find_images.pro)


FIND_IMAGES_V

[Previous Routine] [Next Routine] [List of Routines]
return image number(s) containing (xv,yv) in current window,
			where (xv,yv) is an array of coordinates.
 Frank Varosi NASA/GSFC 1989

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/find_images_v.pro)


FIND_LEVELS

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Find_Levels
 PURPOSE:
	Find Levels within SLP and Energy values/range and return subscripts,
	if the Level colors are non-zero (if zero they are hidden).
 CALLING:
	isel = Find_Levels( islp, Energy )
 INPUTS:
	islp = integer scalar or 2 element vector.
	Energy = floating point scalar or 2 element vector.
 OUTPUTS:
	Function returns subscripts of selected energy levels.
 COMMON BLOCKS:
	common modion_ELevs, ELevs
 EXTERNAL CALLS:
	function Where_Tag
 PROCEDURE:
	If one coordinate, find closest energy,
	if two coordinates (box-area) get subscripts of Levels in area.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.
	F.V.1995, mod to return failure if Level colors are zero.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/find_levels.pro)


FIND_SUPLEV

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Find_SupLev
 PURPOSE:
	Find the nearest SuperLevel and if it is within distance
	specified by RESOLUTION keyword, return subscript.
 CALLING:
	isel = Find_SupLev( event, Energy )
 INPUTS:
	event = structure containing tags for X & Y coordinates
		of cursor in draw window: [event.x,event.y].
	Energy = scalar, the Location of cursor converted to energy.
 KEYWORD:
	RESOLUTION = distance in pixels to be considered as a hit, def=7.
 OUTPUTS:
	Function returns subscript of nearest SuperLevel, if with resolution.
 COMMON BLOCKS:
	common modion_SupLevs, SupLevs
	common modion_Widget, modion_widget
 EXTERNAL CALLS:
	function N_struct
 PROCEDURE:
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1995.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/find_suplev.pro)


FIT_EFF

[Previous Routine] [Next Routine] [List of Routines]
The non-linear fitting procedure for the groove efficiency

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/fit_eff.pro)


FLAT_FIELD

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	Flat_Field
 PURPOSE:
	Divide current extracted subimage by a flat-field image
	(normalized so that average = 1).
	Flat-field image is then kept in common for reuse.
 CALLING:
	Flat_Field, event, /REDISPLAY
 INPUT:
	event = structure of widget event info, passed from pro Analyze_Image.

	All other INPUT and OUTPUT thru common blocks.

 EXTERNAL CALLS:
	function PickFile
	function yes_no_menu
	pro copy_struct
	pro Force_Events
 COMMON BLOCKS:
	common Analyze_Image, analyze_widget
	common opticon0, imaged, imhead, imhist
	common opticon1, subimage, subhead, subhist
	common opticon2, flatimage, flathead
	common opticon4, subimscaled, subimdisp
	common opticon5, im_fh, sub_fh, flat_fh
	common Flat_Field, FlatF, flat_file, menu_base, menu_Label, but2
 HISTORY:
	Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/flat_field.pro)


FOSC_APPROX

[Previous Routine] [Next Routine] [List of Routines]
 NAME:
	fosc_approx
 PURPOSE:
	Use Kramers semiclassical formula for hydrogenic atom to
	compute approximate oscillator strengths of atomic transitions.
	Note that the Gaunt factor is NOT included, but it is near unity
	for large quantum numbers and is 0.717 for the n = 2 -> 1 transition.
 CALLING:
	fosc = fosc_approx( nLow, nUp )
 INPUTS:
	nLow, nUp = main quantum numbers of lower and upper energy levels resp.,
			floating point values are rounded to nearest integer.
 KEYWORDS:
	TRANS = matrix where each row is [ lower, upper ] quantuum numbers
		for a list of level transitions (optional method of input).
 OUTPUTS:
	Function returns oscillator strength(s) of specified transitions.
 PROCEDURE:
	If either quantum number is zero or negative then return 10^(-6).
	Force upper quantum number to be at least one larger than lower n.
 HISTORY:
	Written: Frank Varosi NASA/GSFC 1994.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/fosc_approx.pro)


GET_AXIS_NUM

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

 PURPOSE:
	Get the number of an axis of GPIB device by specifying its name,
	i.e. the index in the array: devices(dev_num).axis

 CALLING:
	axnum = get_axis_num( axis_name, dev_num )

 INPUTS:
	axis_name = string, name of an axis of GPIB device.
	dev_num = integer, index of GPIB device in common gpib,devices array.

 OUTPUT:
	The function returns the index of requested axis,
	so that: axis_name = devices(dev_num).axis(axnum).name,
	or if not found, returns -1.

 EXTERNAL CALLS:
	function N_struct
 COMMON BLOCKS:
	common gpib, devices	;structured array of device names, handles, etc.
 HISTORY:
	Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/get_axis_num.pro)


GET_BY_ALIAS

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

 PURPOSE:
	Get the device number and axis number of GPIB device,
	(i.e. the index in the array: devices(dev_num).axis(axis_num) )
	by specifying the equivalent alias, which was defined by user.

 CALLING:
	get_by_alias, alias, dev_num, axis_num

 INPUTS:
	alias = string, the alias of device axis as previously defined by user.

 OUTPUTS:
	dev_num = integer, index of GPIB device in common gpib,devices array.
		(if alias is not matched, dev_num = -1).
	axis_num = integer, index such that:
		alias = device(dev_num).axis(axis_num).alias
		(if alias is not matched, axis_num = -1).

 EXTERNAL CALLS:
	function N_struct
	function VarType
 COMMON BLOCKS:
	common gpib, devices	;structured array of device names, handles, etc.
 HISTORY:
	Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/get_by_alias.pro)


GET_CCD_IMAGE

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

 PURPOSE:
	Copy the previously read CCD image from shared memory into IDL.
	All accomplished by calling shareable object C-code in ccdmem.so.
	Also check noise and offset in image borders, and place in header.
	Other relevant info, such as device positions, are returned in header.

 CALLING:
	get_CCD_image, image, header, histog_im

 INPUTS:	none

 OUTPUTS:
	image = 2-D array, read from CCD.
	header = structure containing info about image.
	histog_im = histogram of image

 EXTERNAL CALLS:
	pro get_CCD_status
	pro def_imhd_struct
	pro border_noise
	function get_text_input
	function device_axes
	function dev_pos_header
	and Call_External entry points in ccdmem.so.
 COMMON:
	common Analyze_Image, analyze_widget
	common Integrate_CCD, CCD_widget
 HISTORY:
	Frank Varosi NASA/GSFC 1994.
	F.V. 7/94 : convert image to Long, use only part of borders for noise.
	F.V.12/94 : new method defining image size, and handle binning factors.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/get_ccd_image.pro)


GET_CCD_STATUS

[Previous Routine] [Next Routine] [List of Routines]
 PURPOSE:
	Get the status info. from data acquisition program (ccdacq).
 CALLING:
	get_CCD_status, ccd_status
 OUTPUT:
	ccd_status = the status structure variable.

	Some fields in structure:

		x0 = initial column
		nx = # of columns
		dx = column binning factor
		bxx = 2 integers, # of border pixels for columns on both sides.
		y0 = initial row
		ny = # of rows
		dy = row binning factor
		byy = 2 integers, # of border pixels for rows on both sides.
 COMMON:
	common get_CCD_status, cstat, cstatus

		cstat = the exact status block corresponding to C-code.
		cstatus = the status block as used in IDL.
 PROCEDURE:
	Get the status info from shared memory via Call_External.
	Copy the info to new status structure
	which has more detailed border pixel info.
 HISTORY:
	F. Varosi, 1994, NASA/GSFC.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/get_ccd_status.pro)


GET_DEV_NUM

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

 PURPOSE:
	Get the number of a GPIB device, the index in the array: devices.

 CALLING:
	devnum = get_dev_num( name )

 INPUTS:
	name = string or array of strings, name(s) of GPIB device(s).

 OUTPUT:
	The function returns the indices of matching devices
	in common gpib, devices.  If not found, returns -1.

 EXTERNAL CALLS:
	function N_struct
	function VarType
	pro match

 COMMON BLOCKS:
	common gpib, devices	;structured array of device names, handles, etc.
 HISTORY:
	Frank Varosi NASA/GSFC 1993.

(See /host/bluemoon/usr2/idllib/astron/contrib/varosi/code/allpro/get_dev_num.pro)


GET_EFFIC_DATA

[Previous Routine] [Nex