Skip to content

Commit

Permalink
fix bug with undefined PolObservation object in some workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
joshoewahp committed Aug 28, 2024
1 parent b417de7 commit 80f48ee
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dstools/dynamic_spectrum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 80f48ee

Please sign in to comment.