-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathappend_tsys.py
executable file
·42 lines (38 loc) · 1.47 KB
/
append_tsys.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#! /usr/bin/env python
#
# Copyright (C) 2016
# Joint Institute for VLBI ERIC, Dwingeloo, The Netherlands
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published by
# the Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
# License for more details.
#
# You should have received a copy of the GNU Library General Public License
# along with this library; if not, write to the Free Software Foundation,
# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
#
import inspect
import optparse
import os
import sys
filename = inspect.getframeinfo(inspect.currentframe()).filename
sys.path.append(os.path.dirname(os.path.realpath(filename)))
from casavlbitools.fitsidi import append_tsys
if __name__ == "__main__":
# Allow this script to be invoked using casa -c
try:
i = sys.argv.index("-c") + 2
except:
i = 1
pass
usage = "usage %prog [options] antabfile idifile..."
parser = optparse.OptionParser(usage=usage)
parser.add_option("-r", "--replace", action="store_true", dest="replace")
(options, args) = parser.parse_args(sys.argv[i:])
append_tsys(args[0], args[1:], options.replace)