Commit 1d10be46 authored by Theo Steininger's avatar Theo Steininger

distribution_strategy can now be chosen explicitly in power_synthesize.

parent 3030e93d
Pipeline #15055 passed with stages
in 12 minutes and 24 seconds
...@@ -466,7 +466,7 @@ class Field(Loggable, Versionable, object): ...@@ -466,7 +466,7 @@ class Field(Loggable, Versionable, object):
return result_obj return result_obj
def power_synthesize(self, spaces=None, real_power=True, real_signal=True, def power_synthesize(self, spaces=None, real_power=True, real_signal=True,
mean=None, std=None): mean=None, std=None, distribution_strategy=None):
""" Yields a sampled field with `self`**2 as its power spectrum. """ Yields a sampled field with `self`**2 as its power spectrum.
This method draws a Gaussian random field in the harmonic partner This method draws a Gaussian random field in the harmonic partner
...@@ -541,13 +541,16 @@ class Field(Loggable, Versionable, object): ...@@ -541,13 +541,16 @@ class Field(Loggable, Versionable, object):
else: else:
result_list = [None, None] result_list = [None, None]
if distribution_strategy is None:
distribution_strategy = gc['default_distribution_strategy']
result_list = [self.__class__.from_random( result_list = [self.__class__.from_random(
'normal', 'normal',
mean=mean, mean=mean,
std=std, std=std,
domain=result_domain, domain=result_domain,
dtype=np.complex, dtype=np.complex,
distribution_strategy=self.distribution_strategy) distribution_strategy=distribution_strategy)
for x in result_list] for x in result_list]
# from now on extract the values from the random fields for further # from now on extract the values from the random fields for further
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment