Skip to content

Commit

Permalink
Minor fixes, adding codes check
Browse files Browse the repository at this point in the history
  • Loading branch information
kartographer committed Jan 5, 2024
1 parent d721af0 commit 7a2bca4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions pyuvdata/uvdata/mir.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ def read_mir(
rechunk=None,
compass_soln=None,
swarm_only=True,
codes_check=True,
run_check=True,
check_extra=True,
run_check_acceptability=True,
Expand All @@ -110,9 +111,14 @@ def read_mir(
# Use the mir_parser to read in metadata, which can be used to select data.
# We want to sure that the mir file is v3 compliant, since correctly filling
# values into a UVData object depends on that.
mir_data = mir_parser.MirParser(
filepath=filepath, compass_soln=compass_soln, make_v3_compliant=True
)
mir_data = mir_parser.MirParser(filepath=filepath, compass_soln=compass_soln)

if codes_check:
where_list = []
for code in mir_data.codes_data._mutable_codes:
if code in mir_data.codes_data.get_code_names():
where_list.append((code, "eq", list(mir_data.codes_data[code])))
mir_data.select(where=where_list)

if select_where is None:
select_where = []
Expand Down
2 changes: 1 addition & 1 deletion pyuvdata/uvdata/mir_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def _fix_int_dict(self, data_type=None):

# Go through the individual entries in each dict, and update them
# with the "correct" values as determined by scanning through sch_read
for key in new_dict:
for key in inhid_map:
int_dict[inhid_map[key]] = new_dict[key]

@staticmethod
Expand Down

0 comments on commit 7a2bca4

Please sign in to comment.