aboutsummaryrefslogtreecommitdiffstats
path: root/astro/casa/casa-script
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-07-02 19:39:28 +0800
committerAaron LI <aly@aaronly.me>2017-07-02 19:39:28 +0800
commitaeb2d49a746b5eb1bf9e4fc1eba2d9860838ba36 (patch)
tree342283263b9becd61b30a00b5b6d6431502806b6 /astro/casa/casa-script
parent8612d8d9aa21fd83f898340a9c4904ef8c5c6cbd (diff)
downloadatoolbox-aeb2d49a746b5eb1bf9e4fc1eba2d9860838ba36.tar.bz2
Add a simple casa-script wrapper for CASA
Diffstat (limited to 'astro/casa/casa-script')
-rwxr-xr-xastro/casa/casa-script32
1 files changed, 32 insertions, 0 deletions
diff --git a/astro/casa/casa-script b/astro/casa/casa-script
new file mode 100755
index 0000000..a1e8e6b
--- /dev/null
+++ b/astro/casa/casa-script
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# Copyright (c) 2017 Aaron LI <aly@aaronly.me>
+# MIT License
+#
+# A wrapper to invoke CASA to execute the supplied script.
+#
+# Shebang & header
+# ----------------
+# #!casa-script
+# # -*- mode: python -*-
+#
+# Command line arguments
+# ----------------------
+# if __name__ == "__main__":
+# argi = sys.argv.index("--") + 1
+# argv = sys.argv[argi:]
+# main(argv)
+#
+#
+# Another more sophisticated wrapper:
+# https://github.com/pkgw/pwpy - intfbin/casa-script
+#
+
+if [ $# -eq 0 ] || [ "x$1" == "x-h" ]; then
+ echo "usage: $(basename $0) <script.py> [ script args ... ]"
+ exit 1
+fi
+
+script="$1"
+shift
+casa --log2term --nologfile --nogui -c ${script} -- "$@"