Browse Source

Added function to convert FITS IDI to MS files

master
Benito Marcote 5 months ago
parent
commit
848b15e8df
  1. 8
      _import_idi2ms.py
  2. 31
      import_idi2ms.py

8
_import_idi2ms.py

@ -0,0 +1,8 @@
import glob
import sys
myidifiles = sorted(glob.glob(sys.argv[1]))
importfitsidi(vis=sys.argv[2], fitsidifile=myidifiles, constobsid=True, scanreindexgap_s=8.0)

31
import_idi2ms.py

@ -0,0 +1,31 @@
import sys
import argparse
description = """Converts a set of FITS IDI files into a single MS file by using the 'importfitsidi()'
function from CASA, with the standard parameters expected for EVN data.
Arguments:
- idifiles : str
A single word referring to the FITS IDI files to be read (using wildcards).
- msfile : str
Name of the MS file to be created.
"""
help_idifiles = "FITS IDI files to be read. e.g. exp_1_1.IDI* to take all files related to exp_1_1."
parser = argparse.ArgumentParser(description=description, prog='import_idi2ms.py', usage=usage)
parser.add_argument('idifiles', type=str, help=help_idifiles)
parser.add_argument('msfile', type=str, help='Name of the MS file to be created.')
args = parser.parse_args()
subprocess.run(f"casa --nogui -c _import_idi2ms.py {idifiles} {msfile}", shell=True, capture_output=True)
Loading…
Cancel
Save