From f0b05bc73e8fbed03430d768be2914835fdbffb8 Mon Sep 17 00:00:00 2001 From: Garrett 'Karto' Keating Date: Wed, 13 Dec 2023 17:47:49 -0500 Subject: [PATCH] More tweaks to how SWARM-era data is handled in MIR --- pyuvdata/uvdata/mir.py | 3 +++ pyuvdata/uvdata/mir_parser.py | 7 +++---- pyuvdata/uvdata/uvdata.py | 7 +++++++ 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/pyuvdata/uvdata/mir.py b/pyuvdata/uvdata/mir.py index 62a30e10e..bc24e6da1 100644 --- a/pyuvdata/uvdata/mir.py +++ b/pyuvdata/uvdata/mir.py @@ -50,6 +50,7 @@ def read_mir( pseudo_cont=False, rechunk=None, compass_soln=None, + swarm_only=True, run_check=True, check_extra=True, run_check_acceptability=True, @@ -102,6 +103,8 @@ def read_mir( select_where += [("corrchunk", "eq", corrchunk)] elif not pseudo_cont: select_where += [("corrchunk", "ne", 0)] + if swarm_only: + select_where += [("correlator", "eq", 1)] if select_where: mir_data.select(where=select_where) diff --git a/pyuvdata/uvdata/mir_parser.py b/pyuvdata/uvdata/mir_parser.py index 2bb026f21..559024578 100644 --- a/pyuvdata/uvdata/mir_parser.py +++ b/pyuvdata/uvdata/mir_parser.py @@ -3689,7 +3689,7 @@ def redoppler_data( self.vis_data, shift_tuple_list, inplace=True, flag_adj=flag_adj ) - def _make_v3_compliant(self, swarm_only=True): + def _make_v3_compliant(self): """ Update MIR metadata for export to UVData. @@ -3727,9 +3727,8 @@ def _make_v3_compliant(self, swarm_only=True): # First thing -- we only want modern (i.e., SWARM) data, since the older (ASIC) # data is not currently supported by the data handling tools, due to changes # in the underlying file format. - if swarm_only: - self.select(where=("correlator", "eq", 1)) - + # if swarm_only: + # self.select(where=("correlator", "eq", 1)) # Get SMA coordinates for various data-filling stuff sma_lat, sma_lon, sma_alt = get_telescope("SMA").telescope_location_lat_lon_alt diff --git a/pyuvdata/uvdata/uvdata.py b/pyuvdata/uvdata/uvdata.py index 5db7d8913..01318af4e 100644 --- a/pyuvdata/uvdata/uvdata.py +++ b/pyuvdata/uvdata/uvdata.py @@ -10587,6 +10587,9 @@ def read_mir(self, filepath, **kwargs): Optional argument, specifying the path of COMPASS-derived flagging and bandpass gains solutions, which are applied prior to any potential spectral averaging (as triggered by using the `rechunk` keyword). + swarm_only : bool + By default, only SMA SWARM data is loaded. If set to false, this will also + enable loading of older ASIC data. run_check : bool Option to check for the existence and proper shapes of parameters before writing the file. @@ -11423,6 +11426,7 @@ def read( pseudo_cont=False, rechunk=None, compass_soln=None, + swarm_only=True, recompute_nbls: bool | None = None, ): """ @@ -11826,6 +11830,9 @@ def read( "flexible polarization", which compresses the polarization-axis of various attributes to be of length 1, sets the `flex_spw_polarization_array` attribute to define the polarization per spectral window. Default is True. + swarm_only : bool + By default, only SMA SWARM data is loaded. If set to false, this will also + enable loading of older ASIC data. compass_soln : str Optional argument, specifying the path of COMPASS-derived flagging and bandpass gains solutions, which are applied prior to any potential spectral