[cig-commits] r8363 - in cs/spatialdata-0.1/trunk: libsrc/spatialdb
tests/libtests/spatialdb
brad at geodynamics.org
brad at geodynamics.org
Sun Dec 2 23:12:07 PST 2007
Author: brad
Date: 2007-12-02 23:12:06 -0800 (Sun, 02 Dec 2007)
New Revision: 8363
Modified:
cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.cc
cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.hh
cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSCECCVMH.cc
Log:
Added background Vp profile to SCEC CVM-H so meaningful values are returned even when outside domain boundaries. Should really add GocadVoxet::queryNearest() to use value at nearest location instead of an approximate background model.
Modified: cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.cc
===================================================================
--- cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.cc 2007-12-02 23:51:35 UTC (rev 8362)
+++ cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.cc 2007-12-03 07:12:06 UTC (rev 8363)
@@ -286,17 +286,25 @@
spatialdata::spatialdb::SCECCVMH::_queryVp(double* vp)
{ // _queryVp
int outsideVoxet = 0;
- double vpHR = 0.0;
outsideVoxet = _laLowResVp->query(vp, _xyzUTM);
if (!outsideVoxet) {
+ double vpHR = 0.0;
outsideVoxet = _laHighResVp->query(&vpHR, _xyzUTM);
if (!outsideVoxet)
*vp = vpHR;
else
outsideVoxet = 0; // reset outsideVoxet flag to low-res value
- } else
+ } else {
outsideVoxet = _crustMantleVp->query(vp, _xyzUTM);
+ if (outsideVoxet) {
+ const double vpBg = _backgroundVp();
+ if (vpBg > 0.0)
+ *vp = vpBg;
+ else
+ outsideVoxet = 1;
+ } // if
+ } // else
return outsideVoxet;
} // _queryVp
@@ -360,5 +368,30 @@
return vs;
} // _calcVs
+// ----------------------------------------------------------------------
+// Compute vp for background model.
+double
+spatialdata::spatialdb::SCECCVMH::_backgroundVp(void)
+{ // _backgroundVp
+ const double z = _xyzUTM[2];
+ double vp = -99999.0;
+ assert(0 != _topoElev);
+ double elev = 0.0;
+ const int outsideVoxet = _topoElev->query(&elev, _xyzUTM);
+ if (outsideVoxet) {
+ if (z < -35000.0)
+ vp = 7800.0;
+ else if (z < -15000.0)
+ vp = 7800.0 - (7800.0 - 7000.0) / 20000.0 * (z + 35000.0);
+ else if (z < 0.0)
+ vp = 7000.0-8.8888889e-06*(z+15000.0)*(z+15000.0);
+ else
+ vp = 5000.0;
+ } // if
+
+ return vp;
+} // _backgroundVp
+
+
// End of file
Modified: cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.hh
===================================================================
--- cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.hh 2007-12-02 23:51:35 UTC (rev 8362)
+++ cs/spatialdata-0.1/trunk/libsrc/spatialdb/SCECCVMH.hh 2007-12-03 07:12:06 UTC (rev 8363)
@@ -139,6 +139,17 @@
static
double _calcVs(const double vp);
+ /** Compute vp for background model.
+ *
+ * Distribution of Vp with depth that provides approximate match to
+ * distrbution of Vp on edges of SCEC CVM-H. This is similar to the
+ * starting model in Hauksson's tomographic model (Hauksson, JGR,
+ * 2000).
+ *
+ * @returns Vp in m/s.
+ */
+ double _backgroundVp(void);
+
// PRIVATE MEMBERS //////////////////////////////////////////////////////
private :
Modified: cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSCECCVMH.cc
===================================================================
--- cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSCECCVMH.cc 2007-12-02 23:51:35 UTC (rev 8362)
+++ cs/spatialdata-0.1/trunk/tests/libtests/spatialdb/TestSCECCVMH.cc 2007-12-03 07:12:06 UTC (rev 8363)
@@ -125,10 +125,9 @@
cs.datumVert("mean sea level");
cs.initialize();
- const int numLocs = 8;
+ const int numLocs = 14;
const int spaceDim = 3;
const double lonlatelev[] = {
- -125.000000, 35.000000, -7777.00,
-118.560000, 32.550000, -2450.00,
-118.513208, 33.884888, -1400.00,
-118.520000, 34.120000, -1400.00,
@@ -136,6 +135,15 @@
-118.337765, 34.095691, -1770.00,
-118.337765, 34.095691, -17700.00,
-117.989344, 34.034148, -3000.00,
+
+ -125.000000, 35.000000, -40000.0, // outside domain
+ -125.000000, 35.000000, -35000.0,
+ -125.000000, 35.000000, -28300.0,
+ -125.000000, 35.000000, -15000.0,
+ -125.000000, 35.000000, -4000.0,
+ -125.000000, 35.000000, 0.0,
+
+ -117.989344, 34.034148, 5000.00, // above domain
};
const double tolerance = 1.0e-06;
@@ -152,7 +160,6 @@
"VS"
};
const double values[] = {
- -99999.00, -99999.00, -99999.00, -99999.00, -99999.00, -99999.00, -99999.00,
-27991.001953, -1115.499268, 2.0, -1326.415405, 5560.209473, 3133.403158, 3333.334131,
//-27991.00, -1115.50, 2.00, -1326.42, 5540.545410, 3126.848633, 3323.004705,
-27165.316406, -56.893856, 2.0, -1431.710449, 4384.126953, 2741.375651, 2584.759474,
@@ -161,6 +168,15 @@
-27857.322266, 106.671280, 3.0, -2361.386963, 4181.372070, 2673.790690, 2432.217302,
-27857.322266, 106.671280, 0.0, -2361.386963, 6351.574219, 3397.191406, 3707.466394,
-28512.111328, 93.515053, 2.0, -2860.919189, 4932.721191, 2924.240397, 2968.477965,
+
+ -99999.0, -99999.0, -99999.0, -99999.0, 7800.0, 3880.0, 4459.294240,
+ -99999.0, -99999.0, -99999.0, -99999.0, 7800.0, 3880.0, 4459.294240,
+ -99999.0, -99999.0, -99999.0, -99999.0, 7532.0, 3790.666667, 4282.106907,
+ -99999.0, -99999.0, -99999.0, -99999.0, 7000.0, 3613.333333, 3998.100000,
+ -99999.0, -99999.0, -99999.0, -99999.0, 5924.4444444, 3254.814814, 3514.068087,
+ -99999.0, -99999.0, -99999.0, -99999.0, 5000.0, 2946.666667, 3011.300000,
+
+ -28512.111328, 93.515053, -99999.0, -2860.919189, -99999.0, -99999.0, -99999.0,
};
db.queryVals(queryNames, querySize);
@@ -187,7 +203,6 @@
"vp-tag",
};
const double values[] = {
- -99999.00, -99999.00,
3133.403158, 2.0,
2741.375651, 2.0,
2660.851074, 2.0,
@@ -195,6 +210,13 @@
2673.790690, 3.0,
3397.191406, 0.0,
2924.240397, 2.0,
+ 3880.000000, -99999.00,
+ 3880.000000, -99999.00,
+ 3790.666667, -99999.00,
+ 3613.333333, -99999.00,
+ 3254.814814, -99999.00,
+ 2946.666667, -99999.00,
+ -99999.0, -99999.00,
};
db.queryVals(queryNames, querySize);
@@ -220,7 +242,6 @@
"vs",
};
const double values[] = {
- -99999.00,
3333.334131,
2584.759474,
2398.752778,
@@ -228,6 +249,13 @@
2432.217302,
3707.466394,
2968.477965,
+ 4459.29424,
+ 4459.29424,
+ 4282.106907,
+ 3998.100000,
+ 3514.068087,
+ 3011.300000,
+ -99999.0,
};
db.queryVals(queryNames, querySize);
More information about the cig-commits
mailing list