[en] An algorithm is developed to determine the Fourier harmonics representing the level contours of a scalar function given on a rectangular grid. This method is applied to the problem of computing the flux coordinates and flux surface average needed for 1-1/2-D transport codes and MHD stability codes from an equilibrium flux function given on a rectangular grid