Skip to content

Commit

Permalink
Merge pull request #596 from Mulan-94/update_ragavi
Browse files Browse the repository at this point in the history
Update ragavi parameter files
  • Loading branch information
SpheMakh authored May 6, 2020
2 parents 19d0f4e + e9c0292 commit 4b8b25e
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 22 deletions.
7 changes: 2 additions & 5 deletions stimela/cargo/base/ragavi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
FROM stimela/meqtrees:1.2.0
RUN docker-apt-install curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN docker-apt-install nodejs python3-pip
RUN add-apt-repository ppa:git-core/ppa
RUN apt-get update
RUN apt-get install -y git
RUN pip3 install -U pip setuptools
RUN pip3 install ragavi
RUN pip3 install git+git://github.com/ska-sa/xova.git@master
RUN pip3 install ragavi
2 changes: 1 addition & 1 deletion stimela/cargo/cab/ragavi/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM stimela/ragavi:1.2.6
FROM stimela/ragavi:1.4.4
MAINTAINER <[email protected]>
ADD src /scratch/code
ENV LOGFILE ${OUTPUT}/logfile.txt
Expand Down
4 changes: 2 additions & 2 deletions stimela/cargo/cab/ragavi/parameters.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"task": "ragavi",
"base": "stimela/ragavi",
"tag": "1.2.6",
"tag": "1.4.4",
"description": "Radio Astronomy Gain and Visibility Inspector",
"prefix": "--",
"binary": "ragavi-gains",
Expand Down Expand Up @@ -73,7 +73,7 @@
"name": "field"
},
{
"info": "Output HTML file name",
"info": "Output HTML file name (without .html suffix)",
"dtype": "str",
"required": false,
"name": "htmlname",
Expand Down
2 changes: 1 addition & 1 deletion stimela/cargo/cab/ragavi_vis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM stimela/ragavi:1.2.6
FROM stimela/ragavi:1.4.4
MAINTAINER <[email protected]>
ADD src /scratch/code
ENV LOGFILE ${OUTPUT}/logfile.txt
Expand Down
28 changes: 21 additions & 7 deletions stimela/cargo/cab/ragavi_vis/parameters.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"task": "ragavi",
"base": "stimela/ragavi",
"tag": "1.2.6",
"tag": "1.4.4",
"description": "Radio Astronomy Gain and Visibility Inspector",
"prefix": "--",
"binary": "ragavi-vis",
Expand All @@ -25,17 +25,16 @@
"choices": [
"antenna1",
"antenna2",
"baseline",
"amplitude",
"channel",
"corr",
"field",
"frequency",
"imaginary",
"phase",
"real",
"scan",
"time",
"uvdist",
"uvwave"
"uvwave",
]
},
{
Expand All @@ -48,7 +47,7 @@
"amplitude",
"imaginary",
"phase",
"real"
"real",
]
},
{
Expand All @@ -72,6 +71,13 @@
"name": "cbin",
"default": null
},
{
"info": "Select baselines where ANTENNA1 corresponds to the supplied antenna(s)",
"dtype": "str",
"required": false,
"name": "ant",
"default": null
},
{
"info": "Channels to select. Defaults to all.",
"dtype": "str",
Expand Down Expand Up @@ -109,6 +115,13 @@
"spw"
]
},
{
"info": "Number columns in grid if iteration is active",
"dtype": "int",
"required": false,
"name": "cols",
"default": 5
},
{
"info": "Correlation index or subset to plot. Can be specified using normal python slicing syntax. Defaults to all.",
"dtype": "str",
Expand Down Expand Up @@ -138,7 +151,7 @@
"default": null
},
{
"info": "Output HTML file name",
"info": "Output HTML file name (without .html suffix)",
"dtype": "str",
"required": false,
"name": "htmlname",
Expand All @@ -152,6 +165,7 @@
"name": "iter-axis",
"default": null,
"choices": [
"antenna",
"antenna1",
"antenna2",
"baseline",
Expand Down
20 changes: 14 additions & 6 deletions stimela/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@

loglevels = "info debug error"


class MultilineFormatter(argparse.HelpFormatter):

def _fill_text(self, text, width, indent):
text = self._whitespace_matcher.sub(' ', text).strip()
paragraphs = text.split('|n ')
Expand All @@ -32,11 +34,12 @@ def _fill_text(self, text, width, indent):
multiline_text = multiline_text + formatted_paragraph
return multiline_text


def build(argv):
for i, arg in enumerate(argv):
if (arg[0] == '-') and arg[1].isdigit():
argv = ' ' + arg

parser = ArgumentParser(description='Build executor (a.k.a cab) images')
parser.add_argument("-b", "--base", action="store_true",
help="Build base images")
Expand Down Expand Up @@ -335,9 +338,11 @@ def pull(argv):
args.image = images_ or args.image
if args.image:
for image in args.image:
simage = image.replace("/", "_")
simage = simage.replace(":", "_") + singularity.suffix
if args.singularity:
simage = image.replace("/", "_")
if not hasattr(singularity, "suffix"):
raise SystemExit("Cannot find singularity on this system")
simage = simage.replace(":", "_") + singularity.suffix
singularity.pull(
image, simage, directory=pull_folder, force=args.force)
elif args.docker:
Expand All @@ -361,6 +366,8 @@ def pull(argv):
for image in base:
if args.singularity:
simage = image.replace("/", "_")
if not hasattr(singularity, "suffix"):
raise SystemExit("Cannot find singularity on this system")
simage = simage.replace(":", "_") + singularity.suffix
singularity.pull(
image, simage, directory=pull_folder, force=args.force)
Expand Down Expand Up @@ -549,7 +556,8 @@ def clean(argv):
status = "no there"

if status == 'running':
# Kill the container instead of stopping it, so that effect can be felt py parent process
# Kill the container instead of stopping it, so that effect can
# be felt py parent process
utils.xrun('docker', ['kill', container])
cont.remove()
elif status in ['exited', 'dead']:
Expand Down Expand Up @@ -595,8 +603,8 @@ def main(argv):
command = cmd

index = argv.index(cmd)
options = argv[index+1:]
argv = argv[:index+1]
options = argv[index + 1:]
argv = argv[:index + 1]

args = parser.parse_args(argv)

Expand Down

0 comments on commit 4b8b25e

Please sign in to comment.