%N gcffun %F $MIR/src/subs/grid.for
%D Generate the gridding convolution function.
%: gridding, interpolation
%B
        subroutine gcffun(func,phi,n,width,alpha)

        implicit none
        integer n
        character func*(*)
        integer width
        real phi(n),alpha

  Calculate the gridding function. Calculate only half the function, and
  then use its evenness to reflect the rest.

  Inputs:
    func       The gridding function type. Currently only 'spheroidal'
               is supported.
    width      The function width, in pixels. Currently must be integral.
    alpha      Some gridding function specific parameter.
    n          Size of the table required.
  Outputs:
    phi        The output gridding table.

  References:
    F.R. Schwab "Optimal gridding of visibility data in radio interferometry",
      Indirect Imaging, J.A. Roberts, ed., Cambridge Univ. Press, 1984.
