forked from EOSC-LOFAR/prefactor-cwl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plots.cwl
102 lines (82 loc) · 2.47 KB
/
plots.cwl
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# below the parameters from the prefactor parset
#
#plots.control.kind = recipe
#plots.control.type = executable_args
#plots.control.mapfile_in = h5imp_cal.output.h5parm.mapfile
#plots.control.executable = {{ plotsols_script }}
#plots.control.skip_infile = True
#plots.control.arguments = [caldata_transfer]
cwlVersion: v1.0
class: CommandLineTool
baseCommand: [python]
label: "Plot clock, TEC, amplitude"
hints:
DockerRequirement:
dockerPull: kernsuite/prefactor
inputs:
amplitude_array:
type: File
format: https://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
dclock_1st_sm:
type: File
format: https://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
dtec_1st_sm:
type: File
format: https://docs.scipy.org/doc/numpy-dev/neps/npy-format.html
outputs:
dtec_allsols:
type: File
format: image/png
outputBinding:
glob: dtec_allsols.png
dclock_allsols:
type: File
format: image/png
outputBinding:
glob: dclock_allsols.png
amp_allsols:
type: File
format: image/png
outputBinding:
glob: amp_allsols.png
arguments:
- prefix: -c
valueFrom: |
import matplotlib as mpl
mpl.use("Agg")
import numpy as np
import pylab
amparray = np.load("$(inputs.amplitude_array.path)")
clockarray = np.load("$(inputs.dclock_1st_sm.path)")
dtecarray = np.load("$(inputs.dtec_1st_sm.path)")
numants = len(dtecarray[0,:])
for i in range(0,numants):
pylab.plot(dtecarray[:,i])
pylab.xlabel("Time")
pylab.ylabel("dTEC [$10^{16}$ m$^{-2}$]")
pylab.savefig("dtec_allsols.png")
pylab.close()
pylab.cla()
for i in range(0,numants):
pylab.plot(1e9*clockarray[:,i])
pylab.xlabel("Time")
pylab.ylabel("dClock [ns]")
pylab.savefig("dclock_allsols.png")
pylab.close()
pylab.cla()
for i in range(0,numants):
pylab.plot(np.median(amparray[i,:,:,0], axis=0))
pylab.plot(np.median(amparray[i,:,:,1], axis=0))
pylab.xlabel("Subband number")
pylab.ylabel("Amplitude")
pylab.ylim(0,2.*np.median(amparray))
pylab.savefig("amp_allsols.png")
pylab.close()
pylab.cla()
$namespaces:
s: http://schema.org/
$schemas:
- https://schema.org/docs/schema_org_rdfa.html
s:license: "https://mit-license.org/"
s:author:
s:person.url: "http://orcid.org/0000-0002-6136-3724"