Skip to content

Commit

Permalink
Adding swarm_only keyword on v3 compliance check
Browse files Browse the repository at this point in the history
  • Loading branch information
kartographer committed Dec 13, 2023
1 parent 442b0de commit 7a4f91a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pyuvdata/uvdata/mir_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3689,7 +3689,7 @@ def redoppler_data(
self.vis_data, shift_tuple_list, inplace=True, flag_adj=flag_adj
)

def _make_v3_compliant(self):
def _make_v3_compliant(self, swarm_only=True):
"""
Update MIR metadata for export to UVData.
Expand All @@ -3698,6 +3698,12 @@ def _make_v3_compliant(self):
populated in MIR file versions < 3, in order to make in minimally compliant
with what the Mir.read method needs for populating a UVData object. Only data
sets recorded prior to 2020 need these modifications.
Parameters
----------
swarm_only : bool
If set to True, selects only SWARM data (i.e., no ASIC data).
Default is True.
"""
if "filever" in self.codes_data.get_code_names():
if self.codes_data["filever"][0] != "2":
Expand All @@ -3721,7 +3727,8 @@ def _make_v3_compliant(self):
# 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.
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
Expand Down

0 comments on commit 7a4f91a

Please sign in to comment.