-
Notifications
You must be signed in to change notification settings - Fork 0
/
nf.jsonnet
55 lines (43 loc) · 1.61 KB
/
nf.jsonnet
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
// Produce a noise filter component for an anode
// This can be arbitrarily hairy and probably best to make a new file
// if substantial changes are needed.
local wc = import "wirecell.jsonnet";
local pg = import "pgraph.jsonnet";
function(anode, fieldresp, chndb, nsamples, tick=0.5*wc.us, rms_cuts=[]) {
local apaid = anode.data.ident,
local single = {
type: 'pdOneChannelNoise',
name: 'ocn%d'%apaid,
data: {
noisedb: wc.tn(chndb),
anode: wc.tn(anode),
resmp: [
],
},
},
// In principle there may be multiple filters of each of each
// type. Define them above and collect them by type here.
local filters = {
channel: [ single, ],
group: [ ],
status: [ ],
},
local obnf = pg.pnode({
type: 'OmnibusNoiseFilter',
name: 'nf%d'%apaid,
data: {
// Nonzero forces the number of ticks in the waveform
nticks: 0,
// channel bin ranges are ignored
// only when the channelmask is merged to `bad`
maskmap: {sticky: "bad", ledge: "bad", noisy: "bad"},
channel_filters: [wc.tn(f) for f in filters.channel],
grouped_filters: [wc.tn(f) for f in filters.group],
channel_status_filters: [wc.tn(f) for f in filters.status],
noisedb: wc.tn(chndb),
intraces: 'orig%d' % apaid, // frame tag get all traces
outtraces: 'raw%d' % apaid,
},
}, uses=[chndb, anode]+filters.channel+filters.group+filters.status, nin=1, nout=1),
res: obnf
}.res