diff --git a/demos/getting_started_3.py b/demos/getting_started_3.py index 3451c5a2442dfc94f222f1bba017c0547a445cec..45be6b05bdfeac90c4da9931a62b095b0f9679f4 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 6d703d6f6f5aca1b0ad12505ce24d57861b3e813..4ce7007ba7350a53f2e63f584f28352900804946 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: