• smRegFft
  • smRegElementMult
  • smRegWrapAround
  • smFftFloat
  • smRegFftw
  • smaFft.c

    Interface to FFT functions
    
    
    
    

    smRegFft

      Replace a region with its FFT (or inverse) using Press algorithms
    
    Return:  SH_SUCCESS or SH_GENERIC_ERROR if direction is not +1 or -1,
    or if reg->type != FL32
    
    
    SIGNATURE:
      RET_CODE smRegFft(
      		  REGION *rReg,	/* the real part of the region to transform, 
      				   of type FL32 */
      		  REGION *iReg, /* the imaginary part of the region to
      				   transform, of type FL32 */
      		  int direction	/* +1 for forward; 0 for backwards */
      		  )
    

    smRegElementMult

    Replace rReg1,iReg1 with the element-by-element complex multiplication
    of (rReg1,iReg1) * (rReg2,iReg2).
    
    Return:  SH_SUCCESS unless the types are not FL32 or the sizes
    are not all the same.
    
    SIGNATURE:
      RET_CODE smRegElementMult(
      			  REGION *rReg1,	/* real region 1 */
      			  REGION *iReg1,	/* imag region 1 */
      			  REGION *rReg2,	/* real region 2 */
      			  REGION *iReg2	        /* imag region 2 */
      			  )
    

    smRegWrapAround

    Normalize and huffle around the values in the region to put them in 
    wrap around form so Press et al. can work their magic.  Do this to a region
    which contains the PSF centered before FFT convolution.  
    
    Return:  SH_SUCCESS or SH_GENERIC_ERROR if nrow, ncol are not multiples
    of two or if it is not of type FL32
    
    SIGNATURE:
      RET_CODE smRegWrapAround(
                                REGION *reg,   /* the region to wrap*/
      			  float norm  /* nrow*ncol/flux in psf */
                                )
    

    smFftFloat

    Calculate the FFT of the input array.
    
    Return:  SH_SUCCES or SH_GENERIC_ERROR if there is something wrong
    with the inputs.
    
    SIGNATURE:
      RET_CODE smFftFloat ( unsigned NumSamples, /* number of element in the array,
      					      must be a power of 2 */
      		      int    InverseTransform, /* 1 for forward; 0 for back */
      		      float  *RealIn, /* real input array */
      		      float  *ImagIn, /* imag input array */
      		      float  *RealOut, /* real output array */ 
      		      float  *ImagOut  /* imag output array */
      		      )
    

    smRegFftw

      Replace a region with its FFT (or inverse) using FFTW algorithms
    
    Return:  SH_SUCCESS or SH_GENERIC_ERROR if direction is not +1 or -1,
    or if reg->type != FL32
    
    
    SIGNATURE:
      RET_CODE smRegFftw(
      		   REGION *rReg, /* the real part of the region to transform, 
      				   of type FL32 */
      		   REGION *iReg, /* the imaginary part of the region to
      				   transform, of type FL32 */
      		   int direction	/* +1 for forward; 0 for backwards */
      		  )