2 | | |
3 | | |
4 | | |
5 | | ! DEC.SHC |
6 | | ! |
7 | | ! deconvolvs all 3-comp-traces appeared in window. |
8 | | ! traces must be displayed by L,Q,T for each record. |
9 | | ! the invers-filter is generated from each L-comp, |
10 | | ! then the L-Q-T traces are folded with the invers-filter. |
11 | | |
12 | | default 1 ;; first time of decon window |
13 | | default 2 ;; second time of decon window |
14 | | default 3 1 control parameter of decon |
15 | | default 4 1 norm. (-1) before dcv or (0) none or (+1) after dcv? |
16 | | |
17 | | sdef cnt 1 |
18 | | sdef cnt1 |
19 | | sdef ntr |
20 | | sdef ntr1 |
21 | | sdef max |
22 | | sdef min |
23 | | sdef normfac |
24 | | |
25 | | nr |
26 | | dtw |
27 | | |
28 | | ! NMREC before DCV |
29 | | if #4 eqi -1 goto/forward do_norm0: |
30 | | if #4 eqi 0 goto/forward nm_exit0: |
31 | | if #4 eqi +1 goto/forward nm_exit0: |
32 | | echo bad input (the 4th parameter must be -1, 0 or 1) |
33 | | rd |
34 | | return |
35 | | |
36 | | do_norm0: |
37 | | calc i &cnt = 1 |
38 | | calc i &cnt1 = 3 |
39 | | nm_start0: |
40 | | if "cnt gti $dsptrcs goto/forward nm_exit0: |
41 | | am "cnt #1 #2 &min &max |
42 | | calc r &max = "max - "min |
43 | | calc r &normfac = 1.0 div "max |
44 | | trcfct |"cnt|-|"cnt1| mul "normfac |
45 | | calc i &cnt = "cnt + 3 |
46 | | calc i &cnt1 = "cnt1 + 3 |
47 | | goto nm_start0: |
48 | | nm_exit0: |
49 | | |
50 | | ! Deconvolution |
51 | | del h:all |
52 | | calc i &cnt = 1 |
53 | | calc i &ntr = $dsptrcs |
54 | | calc i &ntr1 = $dsptrcs + 1 |
55 | | decon_start: |
56 | | if "cnt gti "ntr goto/forward decon_exit: |
57 | | spiking 1 #1 #2 #3 |
58 | | fold 1-3 ;;; "ntr1 |
59 | | shift _created ^t-origin(1) |
60 | | del "ntr1 |
61 | | hide 1-3 |
62 | | calc i &cnt = "cnt + 3 |
63 | | goto decon_start: |
64 | | decon_exit: |
65 | | |
66 | | ! Aligning traces by letting L spikes at 0 sec. |
67 | | calc i &cnt = 1 |
68 | | shift_start: |
69 | | if "cnt gti $dsptrcs goto/forward shift_exit: |
70 | | calc i &cnt1 = "cnt + 2 |
71 | | am "cnt #1 #2 ;;;;&max |
72 | | calc r &max = 0 - "max |
73 | | shift |"cnt|-|"cnt1| "max |
74 | | calc i &cnt = "cnt + 3 |
75 | | goto shift_start: |
76 | | shift_exit: |
77 | | |
78 | | ! Multiplying -1 to the deconvoluted Q traces. |
79 | | calc i &cnt = 2 |
80 | | mul_start: |
81 | | if "cnt gti $dsptrcs goto/forward mul_exit: |
82 | | trcfct "cnt mul -1 |
83 | | calc i &cnt = "cnt + 3 |
84 | | goto mul_start: |
85 | | mul_exit: |
86 | | |
87 | | ! NMREC after DCV |
88 | | if #4 eqi -1 goto/forward nm_exit: |
89 | | if #4 eqi 0 goto/forward nm_exit: |
90 | | if #4 eqi +1 goto/forward do_norm: |
91 | | |
92 | | do_norm: |
93 | | calc i &cnt = 1 |
94 | | calc i &cnt1 = 3 |
95 | | nm_start: |
96 | | if "cnt gti $dsptrcs goto/forward nm_exit: |
97 | | am "cnt -5 5 ;; &max |
98 | | calc r &normfac = 1.0 div "max |
99 | | trcfct |"cnt|-|"cnt1| mul "normfac |
100 | | calc i &cnt = "cnt + 3 |
101 | | calc i &cnt1 = "cnt1 + 3 |
102 | | goto nm_start: |
103 | | nm_exit: |
104 | | |
105 | | rd |
106 | | return |