func ftsigned(xin, cutt, pq)
 ;a variation of ft for signed quantities (like QUV) where we want a +/- limit applied
 ;only cutt is passed
 cq = 0
 ncase !narg-1
   { cq2=0.999	pow=1.0}
   { cq2=cutt	pow=1.0}
   { cq2=cutt	pow=pq }
   else { ty,'FT doesn''t accept',!narg,' arguments'	return,0 }
 endcase
 ;use a subset of the image for the histogram
 nx=dimen(xin,0)		ny=dimen(xin,1)
 if nx gt 10 then {
   np=(ny/10)>1      dy=ny/np          im=indgen(lonarr(1,np))*nx*dy+10*nx
   in=lonarr(nx,np)  in=indgen(in,0)
   in=in+im          subim=xin(in)
 } else	subim=xin
 ;we have to do this eventually, do now before other tests
 subim = abs(subim)
 ;here we use 0 for the min
 xq=0
 mxq = max(subim)
 sfac = 1.0
 if symdtype(subim) gt 1 then {
   ;consider range reduction if we have a very large spread here
   if (mxq - xq) gt 200000 then {
     sfac  = 200000.0/(mxq - xq)
     subim = subim * sfac
     xq = xq * sfac
     ;this will also make subim FP
     sfac = 1.0/sfac	;for use on the ranges later
     ty,'sfac =', sfac
   }
 }
 if symdtype(subim) ne 0 then {
   ;3/25/98 - if the range is too large, we cannot subtract a large negative min
   ;from a large positive value without rollover, but safe for any positive min
   if xq lt 0 then hin=histr(subim) else hin=histr(subim-xq)
   ;when submin has neg values, the histr routine accounts for them but if
   ;all positive, the first hin will be for 0
   ;to get a good display when there is a "no data" value that is a
   ;large negative #, check the first entry
   if (xq le -10000) {
   	if (hin(0) lt 1.0) {
		hin = hin - hin(0)
		hin = hin/max(hin)	;renormalize
	}
   }	
 } else {
   ;the byte case
   xq=word(xq)
   hin=histr(subim)	hin=hin(xq:*)
 }
 if isscalar(hin) then hin = [hin]
 hinx = indgen(hin)+xq
 ;catch narrow range FP images here and just scale them
 if symdtype(xin) ge 3 and num_elem(hin) lt 20 then {
   range = sfac * [min(xin), max(xin)]
 } else {
   ;normal case
   if num_elem(hin) gt 1 then range = sfac * polate(hin,hinx,[cq,cq2]) else range = sfac * [hinx,hinx]
   ;note, if the bottom or top bins are populated more than the trim factor,
   ;we have a problem, therefore insure that the range doesn't exceed
   ;the data limits as given by hinx(0) and max(hinx)
   range(1) = range(1)< (sfac * max(hinx))
   ;and for this symmetric mode for signed data, we have
   range(0) = -range(1)
 }
 ;;type,'range',range
 $trim_range = range		;save for possible use
 r0 = range(0)		r1 = range(1)
 ;;ty,'r0, r1 =', r0, r1
 if pow ne 1.0 then return,pscale(xin, r0, r1, pow)
 ;conditional below to bypass bug with F*8 arrays, remove when distributions debugged
 ;;if symdtype(xin)  eq 4 then return, scale(float(xin), r0, r1)
 ;;  else return, scale(xin, r0, r1)
 return, scale(xin, r0, r1)
 endfunc
 ;===========================================================================
