Repository navigation
Expand file tree
/
Copy pathCCPSTACK.SHC
More file actions
83 lines (68 loc) · 3.22 KB
/
Copy pathCCPSTACK.SHC
File metadata and controls
83 lines (68 loc) · 3.22 KB
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
! CCPSTACK.SHC
!
! ========================
! To Average RFs according to the latitude, longtitude or distance to a certain point of the (projected) conversion points of RF.
! In this program, the attribute of conversion point for RF stacking, the bin size and overlapping range are defined interactively.
!
! This program is applied only after the implementation of PSPIERPROFILE.SHC, so that the lat and lon of projected conversion points would be retrieved from DCVREG and DCVINCI header and the distance of projected point
! Prior to stacking, moveout correction for Moho MUST be performed.
!
! Written by: Ping He Date: 2016.9.28
!
! #1 = Bin Size #2 = Shifting Range, must larger than 0 and thus overlapping range would be Size(bin) minus the shifting distance/span
! When #2 = #1 means no overlapping, when #2 > #1 means the existance of gap between bins for RF stacking
! When 0 < #2 < #1 means partial overlapping, the larger the #2, the smaller the overlapping degree
!
! #5 = Q-Header (Identifier for CCP stacking)
!
! "This SHC is used to visualize averaged the azimuthal variation of RFs beneath the same station to created noise suppressed RFs and gradually variated RF."
! Revision: 2016-10-23 Purpose: To extend involved header value from interger to be real number.
default 1 20 Enter bin or window size to average RFs:
default 2 10 Enter the shifting span:
default 3 0 Enter the starting border of the total range to be averaged:
default 4 360 Enter the ending border of the entire range to be averaged:
default 5 signoise Enter the Qheader identifier for RF stacking:
default 6 ccp Enter the name of Qfile to store the averaged RFs:
! The number of RF traces in display
sdef trcnu
! The trace number of the newly created summed & averaged RFs to be written to new files
sdef trcsum
! The value of averaged attribute (in this case, that is signoise - designated Qheader name for RF distance to one fixed point) given the newly created RF
sdef attsum
! Window border limits
sdef lowerlimit
sdef upperlimit
sdef attrib #5
! The number of RF to be summed for each bin will be stored in Qfile Header named "mark"
sdef numofsum
calc r &lowerlimit = #3
calc r &upperlimit = #3 + #1
calc r &attsum = #3 + #2
!Perform CCP only to RFs in display
del h:all
hide all
aver_start:
if "upperlimit gtr #4 goto/forward aver_exit:
display |_|#5|("lowerlimit:"upperlimit)|
calc i &trcnu = $dsptrcs
calc i &trcsum = $dsptrcs + 1
! Note that unless otherwised specified using qualifier /nonorm, sum in SH will automaticly normalized by the number of inputs tracs
sum all;;;&numofsum
! _created can by replaced by "trcsum, but to use _created is much more convenient.
set _created #5 "attsum
set _created mark "numofsum
! If there exists no trace, then this command will interupt the whole procedure. Thus, it is necessary to skip the naming of station if the number of trace is zero.
! Revision: 2016-10-23
if "numofsum ltr 1.0 goto/forward skip_stationnaming:
set _created station ^station(1)
skip_stationnaming:
write |#6|#5| _created
del _created
hide all
calc r &upperlimit = "upperlimit + #2
calc r &lowerlimit = "lowerlimit + #2
calc r &attsum = "attsum + #2
goto aver_start:
aver_exit:
@SYSTEM |rm|$BLANK|PSMOUT|*|
return