Browse Source

Some updates I did.. Lazy enough to remember what

Benito Marcote 2 months ago
2 changed files with 13 additions and 8 deletions
  1. +2
  2. +11

+ 2
- 2 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)

+ 11
- 6 View File

@@ -1,28 +1,33 @@
#!/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.

- 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.
- 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='', 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()"casa --nogui -c {idifiles} {msfile}", shell=True, capture_output=True)"casa --nogui -c {pathlib.Path(__file__).parent.absolute()}/ ",
#"casa --nogui -c {pathlib.Path(__file__).parent.absolute()}/ {args.msfile} {args.idifiles}",
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)