Skip to content

Commit 9c45fe0

Browse files
Shilpa RanchodShilpa Ranchod
authored andcommitted
add shadems
1 parent 12a80ae commit 9c45fe0

5 files changed

Lines changed: 182 additions & 0 deletions

File tree

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
FROM stimela/meqtrees:1.2.3
2+
RUN pip install git+https://github.com/IanHeywood/shadeMS
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM stimela/shadems:1.2.3
2+
MAINTAINER <sphemakh@gmial.com>
3+
ADD src /scratch/code
4+
ENV LOGFILE ${OUTPUT}/logfile.txt
5+
CMD /scratch/code/run.sh
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
{
2+
"task": "shadems",
3+
"base": "stimela/shadems",
4+
"tag": "1.2.3",
5+
"description": "Rapid Measurement Set plotting with xarray-ms and datashader.",
6+
"prefix": "--",
7+
"binary": "shadems",
8+
"msdir": true,
9+
"parameters": [
10+
{
11+
"info": "Measurement set",
12+
"name": "ms",
13+
"io": "msfile",
14+
"default": null,
15+
"dtype": "file",
16+
"required": true
17+
},
18+
{
19+
"info": "X axis: [t]ime (default), [f]requency, [c]hannels, [u], [uv]distance, [r]eal, [a]mplitude",
20+
"dtype": "str",
21+
"default": "t",
22+
"name": "xaxis",
23+
"choices": ["t","f","c","u","uv","r","a"]
24+
},
25+
{
26+
"info": "Y axis: [a]mplitude (default), [p]hase, [r]eal, [i]maginary, [v]",
27+
"dtype": "str",
28+
"default": "a",
29+
"name": "yaxis",
30+
"choices": ["a","p","r","i","v"]
31+
},
32+
{
33+
"info": "Measurement Set column to plot (default = DATA)",
34+
"dtype": "str",
35+
"default": "DATA",
36+
"name": "col"
37+
},
38+
{
39+
"info": "Field ID(s) to plot (comma separated list, default = all)",
40+
"dtype": "list:str",
41+
"default": "all",
42+
"name": "field"
43+
},
44+
{
45+
"info": "Spectral windows (DDIDs) to plot (comma separated list, default = all)",
46+
"dtype": "str",
47+
"default": "all",
48+
"name": "spws"
49+
},
50+
{
51+
"info": "Correlation index to plot (default = 0)",
52+
"dtype": "int",
53+
"default": 0,
54+
"name": "corr"
55+
},
56+
{
57+
"info": "Plot flagged data (default = False)",
58+
"dtype": "bool",
59+
"default": false,
60+
"name": "noflags"
61+
},
62+
{
63+
"info": "Do not show conjugate points in u,v plots (default = plot conjugates)",
64+
"dtype": "bool",
65+
"default": false,
66+
"name": "noconj"
67+
},
68+
{
69+
"info": "Minimum x-axis value (default = data min)",
70+
"dtype": "str",
71+
"default": null,
72+
"name": "xmin"
73+
},
74+
{
75+
"info": "Maximum x-axis value (default = data max)",
76+
"dtype": "str",
77+
"default": null,
78+
"name": "xmax"
79+
},
80+
{
81+
"info": "Minimum y-axis value (default = data min)",
82+
"dtype": "str",
83+
"default": null,
84+
"name": "ymin"
85+
},
86+
{
87+
"info": "Maximum y-axis value (default = data ymax)",
88+
"dtype": "str",
89+
"default": null,
90+
"name": "ymax"
91+
},
92+
{
93+
"info": "Canvas x-size in pixels (default = 1280)",
94+
"dtype": "int",
95+
"default": 1280,
96+
"name": "xcanvas"
97+
},
98+
{
99+
"info": "Canvas y-size in pixels (default = 800)",
100+
"dtype": "int",
101+
"default": 800,
102+
"name": "ycanvas"
103+
},
104+
{
105+
"info": "Pixel scale normalization: eq_hist (default), cbrt, log, linear",
106+
"dtype": "str",
107+
"default": "eq_hist",
108+
"name": "norm"
109+
},
110+
{
111+
"info": "Colorcet map to use (default = bkr)",
112+
"dtype": "str",
113+
"default": "bkr",
114+
"name": "cmap"
115+
},
116+
{
117+
"info": "RGB hex code for background colour (default = FFFFFF)",
118+
"dtype": "str",
119+
"default": "FFFFFF",
120+
"name": "bgcol"
121+
},
122+
{
123+
"info": "Font size for all text elements (default = 20)",
124+
"dtype": "float",
125+
"default": 20,
126+
"name": "fontsize"
127+
},
128+
{
129+
"info": "PNG name (default = something verbose)",
130+
"dtype": "str",
131+
"io": "output",
132+
"default": null,
133+
"name": "png"
134+
},
135+
{
136+
"info": "Add timestamp to default PNG name",
137+
"dtype": "bool",
138+
"default": false,
139+
"name": "stamp"
140+
}
141+
]
142+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import os
2+
import sys
3+
4+
sys.path.append('/scratch/stimela')
5+
6+
utils = __import__('utils')
7+
8+
CONFIG = os.environ["CONFIG"]
9+
INPUT = os.environ["INPUT"]
10+
MSDIR = os.environ["MSDIR"]
11+
12+
cab = utils.readJson(CONFIG)
13+
args = []
14+
15+
for param in cab['parameters']:
16+
name = param['name']
17+
value = param['value']
18+
if value is None:
19+
continue
20+
elif value is False:
21+
continue
22+
23+
if isinstance(value, list):
24+
val = map(str, value)
25+
args += ['{0}{1} {2}'.format(cab['prefix'], name, " ".join(val))]
26+
continue
27+
28+
args += ['{0}{1} {2}'.format(cab['prefix'], name, value)]
29+
30+
utils.xrun(cab['binary'], args)
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
python /scratch/code/run.py 2>&1 | tee -a $LOGFILE
3+
(exit ${PIPESTATUS[0]})

0 commit comments

Comments
 (0)