Exemplo n.º 1
0
 private static float[] getValues(Sampling s) {
   int n = s.getCount();
   double f = s.getFirst();
   double d = s.getDelta();
   float[] x = new float[n];
   for (int i = 0; i < n; i++) x[i] = (float) (f + i * d);
   return x;
 }
Exemplo n.º 2
0
 /**
  * Computes gammaS, a measure of the time delay between two split shear waves, from shifts between
  * PP-PS2 {@code u2} and PS1-PS2 {@code uS}.
  *
  * @param sf PP time Sampling.
  * @param u2 shifts between PP-PS2 in PP time.
  * @param uS shifts between PS1-PS2 in PP time.
  * @return gammaS
  */
 public static float[] gammaSu2S(Sampling sf, float[] u2, float[] uS) {
   int n1 = u2.length;
   Check.argument(n1 == sf.getCount(), "u2 consistent with sampling");
   Check.argument(n1 == uS.length, "u2.length==uS.length");
   float[] du2 = firstDerivative(sf, u2);
   float[] duS = firstDerivative(sf, uS);
   float[] gs = new float[n1];
   for (int i1 = 0; i1 < n1; i1++) gs[i1] = (2.0f * duS[i1]) / (1.0f + 2.0f * (du2[i1] - duS[i1]));
   return gs;
 }