CVM S4 Testing
Contents
Test 1
Create a grid file using ucvm makegrid.sh with these settings. This will search the LA basin region at 10km resolution.
HOR_SPACING=0.001 VERT_SPACING=10 MIN_DEPTH=90 MAX_DEPTH=110 MIN_LON=-118.5 MAX_LON=-117.5 MIN_LAT=33.5 MAX_LAT=34.5
Output file wc, showing 3M lines
3006003 9018009 59118059 out.grd
This file is contentated with itself. This will result in two calls to each point, but not consecutively. This tests whether the state-ful ness is reset when horizontal change is made.
Resulting populated file wc:
6012006 102204102 1124245122 cvms4test.res
10 row Test Case below:
Read this with python program into dataframes, then compare Vs for equilent query lines lon lat Z surf ... cmb_vp cmb_vs cmb_rho diff_second_call 0 -118.500 33.5 90.0 -586.131 ... 5423.895 3022.723 2721.433 -1.307 1 -118.499 33.5 90.0 -564.804 ... 5426.159 3022.984 2721.791 -1.308 2 -118.498 33.5 90.0 -490.265 ... 5428.422 3023.246 2722.148 -1.309 3 -118.497 33.5 90.0 -415.728 ... 5430.686 3023.507 2722.505 -1.309 4 -118.496 33.5 90.0 -449.495 ... 5432.949 3023.769 2722.863 -1.309 5 -118.495 33.5 90.0 -501.536 ... 5435.213 3024.030 2723.220 NaN 6 -118.494 33.5 90.0 -501.381 ... 5437.477 3024.292 2723.578 NaN 7 -118.493 33.5 90.0 -512.660 ... 5439.758 3024.555 2723.938 NaN 8 -118.492 33.5 90.0 -571.888 ... 5442.021 3024.816 2724.295 NaN 9 -118.491 33.5 90.0 -596.526 ... 5444.285 3025.078 2724.653 NaN
Results of this test indicate that the second call returns the same result as the first call. The two calls are separated by 3006003 calls to other locations.
Test 2
Create grid file with three duplicate lines this way: 1. makegrid.sh using min,max lat,lon above and depths 90 110 at 10m 2. duplicate input lines using script on discovery duplic_pts.py 3. input grid with duplicat lines to ucvm_query 4. transfer populated results to laptop 5. add 3 lines for the known result into the poptulated results to confirm issue 6. run python script that reads populate results into dataframe an calculates differnce betweens cells 1 and 2, and 2 and 3.
(base) [maechlin@discovery2 test_ucvm]$ wc test2.grd
9018006 27054018 177354120 test2.grd
Add 3 rows with calls to the in the initial point where this issue was identified.
Summary results from Python scripts:
Found 3.4 percent of 1 and 2 queries had differences ( 100995 out of 3006003 ) Found 0.0 percent of 2 and 3 queries had differences: (3 out of 3006003 )
Script can be modified to determine additional information including lat,lons and percent differences found, if needed.
Checking the results for queries 2 and 3:
cvms4_data = "/Users/maechlin/cvms4test2.res"
Difference between call 2 and call 3: -154.118000 for row: 1820002 Difference between call 2 and call 3: -94.489000 for row: 4820002 Difference between call 2 and call 3: -286.251000 for row: 7820002 Found 3.4 percent of 1 and 2 queries had differences ( 100995 out of 3006003 ) Found 0.0 percent of 2 and 3 queries had differences: (3 out of 3006003 )
Test 3
Redo Test 2 but do the query in the background region, where there should not be any borehole data
Initial Observations Of CVM-S4 Stateful Behavior
We have identified points where CVM-S4 queries are stateful, specifically in the GTL region (~100m depth). By this, we mean that if we query the same point twice, CVM-S4 (and UCVM) returns different Vp, Vs, and rho properties for each query.
To investigate this, we will run some tests to determine if all CVM-S4 regions are stateful, or only the GTL regions. We will also look at how large the differences
Initial Observed Differences
ucvm_query -m cvmsi -f $UCVM_HOME/conf/ucvm.conf < in > out with the input being: -118.481000 34.312000 100.0000 -118.481000 34.312000 100.0000 -118.481000 34.312000 100.0000 -118.481000 34.312000 100.0000 returns the output: -118.4810 34.3120 100.000 386.051 397.973 cvmsi 2185.167 989.497 . . . -118.4810 34.3120 100.000 386.051 397.973 cvmsi 2435.524 1237.215 . . . -118.4810 34.3120 100.000 386.051 397.973 cvmsi 2435.524 1237.215 . . . -118.4810 34.3120 100.000 386.051 397.973 cvmsi 2435.524 1237.215 . . .
Search Regions
Define two search regions, one in LA Basin where CVM-S4 has a GTL defined. The second in the mojave where it is CVM-S4 background model. We will discretize at ~10.0m resolution. Basedon this link: Decimal Degrees, we'll descritze at 0.0001 resolution.
Search plans
We will use ucvm makemesh.sh script to create query points for each of these regions. We'll define a search layer from 80m to 120m at 10m resolution to determine whether the alternative values are at a single depth, or in a range of depths. We will add the original observed points to end of the file to ensure we reproduce the initial observations.
- Single query version
The first UCVM query will be a single query call for each point. It will output the expect ucvm results with useful results in the final columns.
- Double query version
The second ucvm query will contain duplicate points for each query. We will expect that in some cases, especially the observed data points above, the second query will return different values
- Triple query version
The third ucvm query will contain three duplicate points for each query. We will determine whether the second and third calls will create duplicates also.
- Query order tests
Query at 90m, query at 100m, query at 90m check if the two 90m queries are different.
- Query at different depths for same lat/lon
Indications are that two queries for the same lat/lon at say depth 20m, and at depth 100m, return different results than a single query at 100m.
Analysis
Post-processing scripts will determine:
- Total number of points in each file:
- Number of point in which first and second query are different
- Percent difference between first and second queries
- Location of points that produce differences
- Number of points in which second and third query are different
- Number of points in which first and third query are different
LABasin GTL Region
34.5 -118.5 33.5 -117.5
in KML:
<coordinates> -117.5,33.5,0 -117.5,34.5,0 -118.5,34.5,0 -118.5,33.5,0 -117.5,33.5,0 </coordinates>
Background Region
35.5 -117.5 34.5 -116.5
<coordinates> -116.5,34.5,0 -116.5,35.5,0 -117.5,35.5,0 -117.5,34.5,0 -116.5,34.5,0 </coordinates>
makemesh
We use the ucvm makemesh script to create the query points.