Function compute_spectrum_kykx saves only kx and ky positive.
Created originally on Bitbucket by calpe (Miguel Calpe)
#!python
"""
issue_fluidfft_spectrum_kykx_save_ky_negative.py
================================================
29/11/2018
Issue:
------
Function compute_spectrum_kykx does only save kx and ky
positive. I would like that saves also ky negative.
"""
import numpy as np
from math import pi
from fluidfft.fft2d.operators import OperatorsPseudoSpectral2D
# Parameters
nx = ny = 32
Lx = Ly = 2 * pi
# Create instance operators
oper = OperatorsPseudoSpectral2D(nx, ny, Lx, Ly)
# Create vector field complex
a_real = np.random.rand(nx, ny//2 + 1)
# Compute spectra ky kx
a_fft = oper.compute_spectrum_kykx(a_real)
print("It only saves kx, ky positives...a_fft.shape = ", a_fft.shape())