From 817a6fd08607831d04b5a43f9d49153703774fcc Mon Sep 17 00:00:00 2001 From: Purnima Balakrishnan Date: Tue, 28 Jun 2022 14:02:48 -0400 Subject: [PATCH] Remove unpolarized probe from SA plot (#151) When Polarized and Unpolarized probes exist, Unpolarized probe is plotted in "SA" views as default view (log scale) such that the SA for polarized probes cannot be viewed. Removes this from the plot. --- refl1d/probe.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/refl1d/probe.py b/refl1d/probe.py index ada68668..1c9fb049 100644 --- a/refl1d/probe.py +++ b/refl1d/probe.py @@ -578,7 +578,7 @@ def oversample(self, n=20, seed=1): Note: :meth:`oversample` will remove the extra Q calculation points introduced by :meth:`critical_edge`. """ - + rng = numpy.random.RandomState(seed=seed) T = rng.normal(self.T[:, None], self.dT[:, None], size=(len(self.dT), n-1)) L = rng.normal(self.L[:, None], self.dL[:, None], size=(len(self.dL), n-1)) @@ -743,8 +743,8 @@ def plot(self, view=None, **kwargs): self.plot_residuals(**kwargs) elif view == 'fft': self.plot_fft(**kwargs) - elif view == 'SA': # SA uses default plot - self.plot(view=None, **kwargs) + elif view == 'SA': # SA does not plot since it does not exist + pass else: raise TypeError("incorrect reflectivity view '%s'"%view) @@ -1767,7 +1767,7 @@ def _calculate_union(self): self._set_calc(self.T, self.L) else: self._oversample(self.oversampling, self.oversampling_seed) - + self._theta_offsets = theta_offsets @property