From e5f51246fdedba2fc81003d53bcb7afa802dc7d2 Mon Sep 17 00:00:00 2001
From: Theo Steininger <theos@mpa-garching.mpg.de>
Date: Tue, 2 May 2017 16:56:12 +0200
Subject: [PATCH] Fixed dtype for real_signal == False.

---
 nifty/field.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/nifty/field.py b/nifty/field.py
index cce6f640b..856dfd5a6 100644
--- a/nifty/field.py
+++ b/nifty/field.py
@@ -245,8 +245,14 @@ class Field(Loggable, Versionable, object):
         result_domain = list(self.domain)
         result_domain[space_index] = power_domain
 
+        if real_signal:
+            result_dtype = np.complex
+        else:
+            result_dtype = np.float
+
         result_field = self.copy_empty(
                    domain=result_domain,
+                   dtype=result_dtype,
                    distribution_strategy=power_spectrum.distribution_strategy)
         result_field.set_val(new_val=power_spectrum, copy=False)
 
-- 
GitLab