From cb0b29db60b96271f060f59ca24591f7acb08853 Mon Sep 17 00:00:00 2001 From: Lukas Platz <lplatz@mpa-garching.mpg.de> Date: Fri, 6 Mar 2020 19:37:16 +0100 Subject: [PATCH] rename parameters --- demos/getting_started_3.py | 8 ++++---- nifty6/library/correlated_fields.py | 23 ++++++++++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/demos/getting_started_3.py b/demos/getting_started_3.py index 3451c5a24..45be6b05b 100644 --- a/demos/getting_started_3.py +++ b/demos/getting_started_3.py @@ -58,14 +58,14 @@ if __name__ == '__main__': position_space = ift.RGSpace([128, 128]) cfmaker = ift.CorrelatedFieldMaker.make( - offset_mean = 0., # 0. - offset_variation_mean = 1e-3, # 1e-3 - offset_variation_stddev = 1e-6, # 1e-6 + offset_mean = 0.0, # 0. + offset_std_mean = 1e-3, # 1e-3 + offset_std_std = 1e-6, # 1e-6 prefix = '') fluctuations_dict = { # Amplitude of the fluctuations - 'fluctuations_mean': 2.0, # 1.0 + 'fluctuations_mean': 2.0, # 1.0 'fluctuations_stddev': 1.0, # 1e-2 # Smooth variation speed diff --git a/nifty6/library/correlated_fields.py b/nifty6/library/correlated_fields.py index 6d703d6f6..4ce7007ba 100644 --- a/nifty6/library/correlated_fields.py +++ b/nifty6/library/correlated_fields.py @@ -364,16 +364,33 @@ class CorrelatedFieldMaker: self._total_N = total_N @staticmethod - def make(offset_mean, offset_variation_mean, offset_variation_stddev, prefix, + def make(offset_mean, offset_std_mean, offset_std_std, prefix, total_N=0, dofdex=None): + """Returns a CorrelatedFieldMaker object. + + Parameters + ---------- + offset_mean : float + Mean offset from zero of the correlated field to be made. + offset_std_mean : float + Mean standard deviation of the offset value. + offset_std_std : float + Standard deviation of the stddev of the offset value. + prefix : string + Prefix to the names of the domains of the cf operator to be made. + total_N : integer + ? + dofdex : np.array + ? + """ if dofdex is None: dofdex = np.full(total_N, 0) elif len(dofdex) != total_N: raise ValueError("length of dofdex needs to match total_N") N = max(dofdex) + 1 if total_N > 0 else 0 - zm = _LognormalMomentMatching(offset_variation_mean, - offset_variation_stddev, + zm = _LognormalMomentMatching(offset_std_mean, + offset_std_std, prefix + 'zeromode', N) if total_N > 0: -- GitLab