From 80f48ee0f80afd98c81085e55da5b63af727938f Mon Sep 17 00:00:00 2001 From: Joshua Pritchard Date: Wed, 28 Aug 2024 12:44:51 +1000 Subject: [PATCH] fix bug with undefined PolObservation object in some workflows --- dstools/dynamic_spectrum.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dstools/dynamic_spectrum.py b/dstools/dynamic_spectrum.py index 7ef5226..482767d 100644 --- a/dstools/dynamic_spectrum.py +++ b/dstools/dynamic_spectrum.py @@ -560,6 +560,8 @@ def _make_stokes(self, XX, XY, YX, YY): # Compute complex Q and U from L Q = L.real + 1j * Li.real U = L.imag + 1j * Li.imag + else: + self.polobs = None P = np.sqrt(Q.real**2 + U.real**2 + V.real**2) / I.real @@ -636,7 +638,10 @@ def plot_fdf(self, fig=None, ax=None): fig, ax = plt.subplots(figsize=(7, 5)) if not self.polobs: - self.rm_synthesis() + I = self.data["I"] + Q = self.data["Q"] + U = self.data["U"] + self.rm_synthesis(I, Q, U) ax.plot( self.polobs.rmsf_phi,