Viewing contents of file '../idllib/astron/contrib/varosi/code/allpro/edge_imscaled.pro'
function edge_imscaled, image_List, MAGNIFIED=magnified

;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.

	if check_struct( image_List, Magf ) LE 0 then return,(-1)
	image_struct = image_List(0)

	tags = tag_names( image_struct )
	w = where( tags EQ "IMSCALED", tag_ims )

	if (tag_ims) then  ss = size( image_struct.imscaled )-1  else begin

		w = where( tags EQ "SIZE_IMSCALED", tag_size )

		if (NOT tag_size) then begin
			message,"scaled image size info not found",/INF,/CON
			return,(-1)
		    endif

		ss = image_struct.size_imscaled -1
	   endelse

	xsiz = image_struct.Xmax - image_struct.Xmin
	ysiz = image_struct.Ymax - image_struct.Ymin

	xbw = (ss(1)-xsiz)/2
	ybw = (ss(2)-ysiz)/2

	if keyword_set( magnified ) then return, (xbw > ybw)	$
				    else return, (xbw > ybw)/Magf
end