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 package edu.sc.seis.TauP;
30
31 import java.io.Serializable;
32
33 /*** Utility class to keep track of criticalpoints (discontinuities or
34 * reversals in slowness gradient) within slowness and velocity models.
35 *
36 * @version 1.1.3 Wed Jul 18 15:00:35 GMT 2001
37
38
39
40 * @author H. Philip Crotwell
41 */
42 public class CriticalDepth implements Cloneable, Serializable {
43
44 /*** depth in kilometers at which there is a critical point. */
45 public double depth;
46
47 /*** layer number within the velocity model with this depth at its top. */
48 public int velLayerNum;
49
50 /*** slowness layer for P waves with this depth at its top. This can be PLayers.size() for
51 * the last critical layer. */
52 public int PLayerNum;
53
54 /*** slowness layer for S waves with this depth at its top. This can be SLayers.size() for
55 * the last critical layer. */
56 public int SLayerNum;
57
58
59
60 public CriticalDepth() {
61 }
62
63 public CriticalDepth(double depth, int velLayerNum, int PLayerNum,
64 int SLayerNum) {
65 this.depth = depth;
66 this.velLayerNum = velLayerNum;
67 this.PLayerNum = PLayerNum;
68 this.SLayerNum = SLayerNum;
69 }
70
71
72
73 public void setVelLayerNum(int layerNum) {
74 velLayerNum = layerNum;
75 }
76
77 public void setPLayerNum(int layerNum) {
78 PLayerNum = layerNum;
79 }
80
81 public void setSLayerNum(int layerNum) {
82 SLayerNum = layerNum;
83 }
84
85 public int getVelLayerNum() {
86 return velLayerNum;
87 }
88
89 public int getPLayerNum() {
90 return PLayerNum;
91 }
92
93 public int getSLayerNum() {
94 return SLayerNum;
95 }
96
97 /*** sets slowness layer for waveType waves with this depth at its top.
98 */
99 public void setLayerNum(int layerNum, boolean isPWave) {
100 if (isPWave) {
101 PLayerNum = layerNum;
102 } else {
103 SLayerNum = layerNum;
104 }
105 }
106
107 /*** @returns slowness layer for waveType waves with this depth at its top.
108 */
109 public int getLayerNum(boolean isPWave) {
110 if (isPWave) {
111 return PLayerNum;
112 } else {
113 return SLayerNum;
114 }
115 }
116
117
118 public Object clone() {
119 CriticalDepth newObject;
120 try {
121 newObject = (CriticalDepth)super.clone();
122 return newObject;
123 } catch (CloneNotSupportedException e) {
124
125 System.err.println("Caught CloneNotSupportedException: "+
126 e.getMessage());
127 throw new InternalError(e.toString());
128 }
129 }
130 }