Benito Marcote 1 month ago
parent
commit
a27acaa406
3 changed files with 17 additions and 7 deletions
  1. +2
    -2
      _import_idi2ms.py
  2. +14
    -4
      import_idi2ms.py
  3. +1
    -1
      template.pipelet

+ 2
- 2
_import_idi2ms.py View File

@@ -1,8 +1,8 @@
#!/usr/bin/env python3
import glob
import sys


myidifiles = sorted(glob.glob(sys.argv[1]))
importfitsidi(vis=sys.argv[2], fitsidifile=myidifiles, constobsid=True, scanreindexgap_s=8.0)
importfitsidi(vis=sys.argv[1], fitsidifile=sorted(glob.glob(sys.argv[2])), constobsid=True, scanreindexgap_s=8.0)



+ 14
- 4
import_idi2ms.py View File

@@ -1,28 +1,38 @@
#!/usr/bin/env python3
import sys
import argparse
import subprocess
import pathlib


usage = "%(prog)s [-h] <idifiles> <msfile>"
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:
<<<<<<< HEAD
- idifiles : str
A single word referring to the FITS IDI files to be read (using wildcards). Must start/end with quotes.
=======
>>>>>>> 81c1de29e2bf61290ed797878b6577bbd4a8e475
- msfile : str
Name of the MS file to be created.
- idifiles : str
FITS IDI files to be read (either a space-separated list or a single word using wildcards).
"""

help_idifiles = "FITS IDI files to be read. e.g. exp_1_1.IDI* to take all files related to exp_1_1."
help_idifiles = "FITS IDI files to be read. Allows wildcards (then it nees to be passed with '..')."


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.')
parser.add_argument('idifiles', type=str, help=help_idifiles)

args = parser.parse_args()


subprocess.run(f"casa --nogui -c _import_idi2ms.py {idifiles} {msfile}", shell=True, capture_output=True)
subprocess.call(f"casa --nogui -c {pathlib.Path(__file__).parent.absolute()}/_import_idi2ms.py ",
# subprocess.call(f"casa --nogui -c {pathlib.Path(__file__).parent.absolute()}/_import_idi2ms.py {args.msfile} {args.idifiles}",
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)





+ 1
- 1
template.pipelet View File

@@ -31,7 +31,7 @@ Note: The pipeline uses AIPS versions 31DEC13. The latest version
to access the AIPS tasks. Visit the web page above for more details.
The pipeline is under continual development and any feedback is
appreciated. Background information to the pipeline can be found at
www.evlbi.org/pipeline/user_expts.html
https://www.evlbi.org/evn-data-access

If you have any feedback regarding this service please direct your comments to:
Zsolt Paragi (zparagi@jive.eu).


Loading…
Cancel
Save