From 0b55245974899780e2dd27a3814a13233c7f65c8 Mon Sep 17 00:00:00 2001 From: Philipp Haim Date: Thu, 21 Nov 2019 14:11:08 +0100 Subject: [PATCH] New property names --- nifty5/library/correlated_fields.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/nifty5/library/correlated_fields.py b/nifty5/library/correlated_fields.py index d794d22b..747f0208 100644 --- a/nifty5/library/correlated_fields.py +++ b/nifty5/library/correlated_fields.py @@ -472,7 +472,7 @@ class CorrelatedFieldMaker: lst = [('Offset amplitude', self.amplitude_total_offset), ('Total fluctuation amplitude', self.total_fluctuation)] - namps = len(self.amplitudes) + namps = len(self.normalized_amplitudes) if namps > 1: for ii in range(namps): lst.append(('Slice fluctuation (space {})'.format(ii), @@ -498,9 +498,19 @@ class CorrelatedFieldMaker: return fluctuations_slice_mean/np.mean(np.sqrt(scm)) @property - def amplitudes(self): + def normalized_amplitudes(self): return self._a + @property + def amplitude(self): + if len(self._a) > 1: + s = ('If more than one spectrum is present in the model,', + ' no unique set of amplitudes exist because only the', + ' relative scale is determined.') + raise NotImplementedError(s) + expand = VdotOperator(full(self._a[0].target, 1)).adjoint + return self._a[0]*(expand @ self.amplitude_total_offset) + @property def amplitude_total_offset(self): return self._azm -- GitLab