diff --git a/src/pyrokinetics/gk_code/gene.py b/src/pyrokinetics/gk_code/gene.py index de6ebc26a..442dd035d 100755 --- a/src/pyrokinetics/gk_code/gene.py +++ b/src/pyrokinetics/gk_code/gene.py @@ -527,7 +527,7 @@ def get_numerics(self) -> Numerics: numerics_data["nperiod"] = 1 else: numerics_data["nkx"] = 1 - numerics_data["nperiod"] = self.data["box"]["nx0"] - 1 + numerics_data["nperiod"] = (self.data["box"]["nx0"] + 1) // 2 numerics_data["beta"] = self.data["general"]["beta"] @@ -1245,11 +1245,11 @@ def _get_coords( single_theta_loop = theta single_ntheta_loop = ntheta - ntheta = ntheta * (nkx - 1) + ntheta = ntheta * nkx theta = np.empty(ntheta) start = 0 - for i in range(nkx - 1): - pi_segment = i - nkx // 2 + 1 + for i in range(nkx): + pi_segment = i - nkx // 2 theta[start : start + single_ntheta_loop] = ( single_theta_loop + pi_segment * 2 * pi ) @@ -1396,7 +1396,7 @@ def _get_fields( phase_fac = -1 i_ball = 0 - for i_conn in range(-int(nx / 2) + 1, int((nx - 1) / 2) + 1): + for i_conn in range(-int(nx / 2), int((nx - 1) / 2) + 1): fields[:, 0, :, i_ball : i_ball + nz, :] = ( sliced_field[:, i_conn, :, :, :] * (phase_fac) ** i_conn ) @@ -1523,7 +1523,7 @@ def _get_moments( phase_fac = -1 i_ball = 0 - for i_conn in range(-int(nx / 2) + 1, int((nx - 1) / 2) + 1): + for i_conn in range(-int(nx / 2), int((nx - 1) / 2) + 1): moments[:, 0, :, i_ball : i_ball + nz, :] = ( sliced_moment[:, i_conn, :, :, :] * (phase_fac) ** i_conn )