This function performs in-place scaling after the IFFT without recompilation.

    INPUTS:
    in1     (no default):   Array containing data which is to be scaled.

def scale_fft(in1):
    """
    This function performs in-place scaling after the IFFT without recompilation.

    INPUTS:
    in1     (no default):   Array containing data which is to be scaled.

    """

    ker = SourceModule("""
                        __global__ void scale_fft_ker(float *in1)
                        {
                            const int len = gridDim.x*blockDim.x;
                            const int col = (blockDim.x * blockIdx.x + threadIdx.x);
                            const int row = (blockDim.y * blockIdx.y + threadIdx.y);
                            const int tid2 = col + len*row;
                            const int szin1 = gridDim.x*blockDim.x*gridDim.y*blockDim.y;

							in1[tid2] = in1[tid2]/szin1;                           
                        }
                       """, keep=True)

    scale_fft_ker = ker.get_function("scale_fft_ker")
    scale_fft_ker(in1, block=(32,32,1), grid=(int(in1.shape[1]//32), int(in1.shape[0]//32)))