Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Feb 7, 2024
1 parent 2054fcc commit 0a50cfa
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions fixms/fix_ms_dir.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,19 +232,20 @@ def restore_ms_dir(ms):
"""Restore the direction to the ASKAPsoft standard."""

if tableexists("%s/FIELD_OLD" % (ms)):

logger.info("Restoring FIELD directions in %s" % (ms))
tp = table("{}/FIELD".format(ms), readonly=False, ack=False)
fp = table("%s/FIELD_OLD" %(ms), readonly=True, ack=False)
fp = table("%s/FIELD_OLD" % (ms), readonly=True, ack=False)
field_dir = fp.getcol("PHASE_DIR")
tp.putcol("PHASE_DIR", field_dir)
tp.putcol("DELAY_DIR", field_dir)
tp.putcol("REFERENCE_DIR", field_dir)
tp.flush()
tp.close()
else:
logger.warning("No `FIELD_OLD` table in %s - cannot restore direction if direction has not changed." % (ms))

logger.warning(
"No `FIELD_OLD` table in %s - cannot restore direction if direction has not changed."
% (ms)
)


def fix_ms_dir(ms):
Expand Down Expand Up @@ -388,9 +389,10 @@ def cli():
"ms", help="Measurement set to update", type=str, default=None, nargs="?"
)
parser.add_argument(
"-r", "--restore",
"-r",
"--restore",
action="store_true",
help="Switch to restore direction to the original ASKAPsoft pipeline direction"
help="Switch to restore direction to the original ASKAPsoft pipeline direction",
)
# Parse the command line
args = parser.parse_args()
Expand Down

0 comments on commit 0a50cfa

Please sign in to comment.