-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorials
To use the basin_query command line paramter in the docker image, users can create an input file with points of interest. Note in this case, the input file has only long lat, and does not include depth value, since basin_query will search through a vertical profile
create testpts.txt with these two lines in it:
-118.48 34.29 -118.44 34.32
Then run basin_query, pointing it to a ucvm.conf file in /app/ucvm/conf
$ basin_query -f /app/ucvm/conf/ucvm.conf -m cvmsi -v 2500 -d 6000 -i 10 < testpts.txt
Results for this query are:
-118.4800 34.2900 3780.000 3780.000 3780.000 -118.4400 34.3200 4310.000 4310.000 4310.000
(Python2) [maechlin@1a1dea59d47e target]$ cp ../make_mesh.py . (Python2) [maechlin@1a1dea59d47e target]$ ./make_mesh.py Creating grd.out file. /app/ucvm/utilities/makegrid.sh Generating grid
This will run a script that creates a 300K input data file called "grd.out" and writes it to the "target" directory. Then the make_mesh.py script uses that file to query each SCEC velocity models. Only queries for the "selected" CVM (in this case "cvms5") will succeed in this script. However the script provides a good example of how the UCVM Images can be used to extract properties for a moderate number of points.
UCVM Docker images use the make_mesh.py as a test script. When run, it builds a grd.out file that discretizes the western US (this can take 20 minutes). Then make_mesh.py queries all avialable UCVM models using the grd.out grid point file.
When users runs make_mesh.py it queries 1D models and then each available 3d model. Only the 3D model installed in the UCVM Docker image should succeed. Below is an example of running make_mesh.py in a "cvms5" UCVM Docker image.
(base) maechlin@Philip-James-MacBook ucvm_v21_10 % ./start.sh [ucvm@9739bbba4799 target]$ cp ../make_mesh.py . [ucvm@9739bbba4799 target]$ ./make_mesh.py ucvm_query -f /app/ucvm/conf/ucvm.conf -m bbp1d < out.grd > mesh_bbp1d.out Using Geo Depth coordinates as default mode. Mesh extraction for model bbp1d : 48 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m 1d < out.grd > mesh_1d.out Using Geo Depth coordinates as default mode. Mesh extraction for model 1d : 40 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m cvms < out.grd > mesh_cvms.out Model cvms is not a valid model. It was not enabled when UCVM was compiled or the config key cvms_modelpath is not defined. Failed to add parsed model cvms Failed to enable model list cvms Mesh extraction for model cvms : 0 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m cvms5 < out.grd > mesh_cvms5.out Using Geo Depth coordinates as default mode. Mesh extraction for model cvms5 : 102 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m cvmsi < out.grd > mesh_cvmsi.out Model cvmsi is not a valid model. It was not enabled when UCVM was compiled or the config key cvmsi_modelpath is not defined. Failed to add parsed model cvmsi Failed to enable model list cvmsi Mesh extraction for model cvmsi : 0 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m cvmh < out.grd > mesh_cvmh.out Model cvmh is not a valid model. It was not enabled when UCVM was compiled or the config key cvmh_modelpath is not defined. Failed to add parsed model cvmh Failed to enable model list cvmh Mesh extraction for model cvmh : 0 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m albacore < out.grd > mesh_albacore.out Model albacore is not a valid model. It was not enabled when UCVM was compiled or the config key albacore_modelpath is not defined. Failed to add parsed model albacore Failed to enable model list albacore Mesh extraction for model albacore : 0 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m cca < out.grd > mesh_cca.out Model cca is not a valid model. It was not enabled when UCVM was compiled or the config key cca_modelpath is not defined. Failed to add parsed model cca Failed to enable model list cca Mesh extraction for model cca : 0 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m ivlsu < out.grd > mesh_ivlsu.out Model ivlsu is not a valid model. It was not enabled when UCVM was compiled or the config key ivlsu_modelpath is not defined. Failed to add parsed model ivlsu Failed to enable model list ivlsu Mesh extraction for model ivlsu : 0 seconds /app/ucvm/bin/ucvm_query -f /app/ucvm/conf/ucvm.conf -m cvlsu < out.grd > mesh_cvlsu.out Model cvlsu is not a valid model. It was not enabled when UCVM was compiled or the config key cvlsu_modelpath is not defined. Failed to add parsed model cvlsu Failed to enable model list cvlsu Mesh extraction for model cvlsu : 0 seconds
The Docker images contain a two part test program. Using a user on a Mac, with Docker installed and running, here's how to run the UCVM Docker image.
-
User moves to ucvm_docker directory on their Laptop cd /Users/maechlin/ucvm_docker
-
User reviews is currently in "target" directory, the file exchange directory between Laptop and Container. ** pwd /Users/maechlin/ucvm_docker/ ** ls target
-
User starts UCVM Docker image that will ** ./start.sh
The UCVM Linux shells starts, and the User is placed at a command line prompt in a directory called: /app/target
[ucvm@65b00f2cf0e2 target]$ pwd /app/target [ucvm@65b00f2cf0e2 target]$ ls [ucvm@65b00f2cf0e2 target]$
Copy a script from the container to target directory.
- cp /app/make_mesh.py .
The run the script to generate an input mesh for ucvm:
- ./make_mesh.py
This will generate a 100,000 mesh point input file in your target directory. This is a moderate query for ucvm. Now query the available model this way.
./ucvm_query -f /app/ucvm/conf/ucvm/conf -m cencal < grd.in > grd.out
This will run and output a grd.out file that has all the colums from grd.in and it add 3 new columns vp, vs, and rho for the given point.
