From 1c8636d3af7b1d9e34bceecb92645bccf5431f15 Mon Sep 17 00:00:00 2001 From: Marc Pound <22331890+mpound@users.noreply.github.com> Date: Mon, 8 Jan 2024 15:41:15 -0500 Subject: [PATCH] fix issue #153 and its integration test --- src/dysh/fits/gbtfitsload.py | 8 +++++++- src/dysh/spectra/tests/test_scan.py | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dysh/fits/gbtfitsload.py b/src/dysh/fits/gbtfitsload.py index 94e2140e..166f72e2 100644 --- a/src/dysh/fits/gbtfitsload.py +++ b/src/dysh/fits/gbtfitsload.py @@ -772,6 +772,7 @@ def subbeamnod(self, scan, bintable=None, **kwargs): kwargs_opts = { "ifnum": 0, "fdnum": 0, + "plnum": 1, "timeaverage": True, "weights": "tsys", # or None or ndarray "calibrate": True, @@ -792,7 +793,12 @@ def subbeamnod(self, scan, bintable=None, **kwargs): if len(rx) > 1: raise TypeError("More than one receiver for the selected scan.") elif rx[0] == "Rcvr26_40": # and df["DATE-OBS"][-1] < xxxx - # Switch the polarizations to match the beams. + # Switch the polarizations to match the beams, + # for this receiver only because it has had its feeds + # mislabelled since $DATE. + # For the rest of the receivers the method should use + # the same polarization for the selected feeds. + # See also issue #160 if fdnum == 0: plnum = 1 elif fdnum == 1: diff --git a/src/dysh/spectra/tests/test_scan.py b/src/dysh/spectra/tests/test_scan.py index 51ab56c3..34602e5b 100644 --- a/src/dysh/spectra/tests/test_scan.py +++ b/src/dysh/spectra/tests/test_scan.py @@ -137,7 +137,9 @@ def test_compare_with_GBTIDL(self, data_dir): # Generate the dysh result. # snodka-style. Need test for method='cycle' sdf = gbtfitsload.GBTFITSLoad(sdf_file) - sbn = sdf.subbeamnod(43, sig=None, cal=None, ifnum=0, fdnum=1, calibrate=True, weights="tsys", method="scan") + sbn = sdf.subbeamnod( + 43, sig=None, cal=None, ifnum=0, fdnum=1, plnum=0, calibrate=True, weights="tsys", method="scan" + ) # Load the GBTIDL result. hdu = fits.open(gbtidl_file)