Skip to content

Commit

Permalink
More tweaks to how SWARM-era data is handled in MIR
Browse files Browse the repository at this point in the history
  • Loading branch information
kartographer committed Dec 13, 2023
1 parent 7a4f91a commit f0b05bc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions pyuvdata/uvdata/mir.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down
7 changes: 3 additions & 4 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, swarm_only=True):
def _make_v3_compliant(self):
"""
Update MIR metadata for export to UVData.
Expand Down Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions pyuvdata/uvdata/uvdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -11423,6 +11426,7 @@ def read(
pseudo_cont=False,
rechunk=None,
compass_soln=None,
swarm_only=True,
recompute_nbls: bool | None = None,
):
"""
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f0b05bc

Please sign in to comment.