Skip to content

Testing

Philip Maechling edited this page May 4, 2022 · 4 revisions

run-tests

The run-tests script in the ucvm_plotting directory provides useful examples showing how to run command line version of most of the ucvm_plotting routines and output the results to *.png files. This approach avoids issues opening X-window plots. The users can use native utilities on their computer to view the resulting *.png files

Overview

(cd compare_plot; ./run_cvmh_compare_plot.sh)

(cd cross_section; ./run_cvmh_cross_section_vs.sh)

(cd density_plot; ./run_cvmh_density_plot.sh)

(cd depth_profile; ./run_cvmh_depth_profile.sh)

(cd elevation_cross_section; ./run_cvmh_elevation_cross_section_vp.sh; ./run_cvmh_elevation_cross_section_vs.sh)

(cd elevation_map; ./run_cvmh_elevation_map.sh)

(cd elevation_profile; ./run_cvmh_elevation_profile.sh)

(cd horizontal_slice; ./run_cvmh_horizontal_slice_vs.sh)

(cd scatter_plot; ./run_cvmh_scatter_plot.sh; ./run_norcal_scatter_plot.sh)

(cd vs30_etree_map; ./run_cvmh_vs30_etree_map.sh)

(cd vs30_map; ./run_cvmh_vs30_map.sh)

(cd z10_map; ./run_cvmh_z10_map.sh)

(cd z25_map; ./run_cvmh_z25_map.sh)

compare_plot.sh script

#!/bin/bash
## comparing data input of two plots

if [ -z "$UCVM_INSTALL_PATH" ]; then
  echo "Need to set UCVM_INSTALL_PATH to run >" ${0##*/} 
  exit
fi
source $UCVM_INSTALL_PATH/conf/ucvm_env.sh

CWD=`pwd`
LABEL=cvmh_compare_plot
LAT1=33.35
LON1=-118
LAT2=34.35
LON2=-117
SPACING=0.01
MODEL=cvmh 

XLABEL=cvmh_vs30_map
YLABEL=cvmh_vs30_etree_map


plot_vs30_map.py -b ${LAT1},${LON1} -u ${LAT2},${LON2} -c ${MODEL} -a s -s ${SPACING} -o ${CWD}/${XLABEL}.png

plot_vs30_etree_map.py -b ${LAT1},${LON1} -u ${LAT2},${LON2} -c ${MODEL} -a s -s ${SPACING} -o ${CWD}/${YLABEL}.png

plot_compare_plot.py -x ${CWD}/${XLABEL}_data.bin -y ${CWD}/${YLABEL}_data.bin -o ${CWD}/${LABEL}.png

plot_compare_plot.py -x ${CWD}/${XLABEL}_data.bin -y ${CWD}/${XLABEL}_data.bin -o ${CWD}/${LABEL}_x.png

plot_compare_plot.py -x ${CWD}/${YLABEL}_data.bin -y ${CWD}/${YLABEL}_data.bin -o ${CWD}/${LABEL}_y.png

depth_profile.sh

#!/bin/bash

if [ -z "$UCVM_INSTALL_PATH" ]; then
  echo "Need to set UCVM_INSTALL_PATH to run >" ${0##*/} 
  exit
fi
source $UCVM_INSTALL_PATH/conf/ucvm_env.sh

CWD=`pwd`
LABEL=cvmh_depth_profile
LAT=34
LON=-118
STEP=500
START_depth=0
END_depth=50000
MODEL=cvmh 

plot_depth_profile.py -s ${LAT},${LON} -b ${START_depth} -e ${END_depth} -d vs,vp,density -v ${STEP} -c ${MODEL} -o ${CWD}/${LABEL}_o.png -i ${UCVM_INSTALL_PATH}

plot_depth_profile.py -s ${LAT},${LON} -b ${START_depth} -e ${END_depth} -d vs,vp,density -v ${STEP} -c ${MODEL} -o ${CWD}/${LABEL}.png

plot_depth_profile.py -s ${LAT},${LON} -b ${START_depth} -e ${END_depth} -d vs -v ${STEP} -c ${MODEL} -f ${CWD}/${LABEL}_matprops.json -o ${CWD}/${LABEL}_vs.png

plot_depth_profile.py -H