Difference between revisions of "UCVM Visualization"
Line 96: | Line 96: | ||
* PlotMapVs30.py | * PlotMapVs30.py | ||
* PlotProfileCVM.py | * PlotProfileCVM.py | ||
− | |||
* PlotVs30MapCVM.py | * PlotVs30MapCVM.py | ||
* PlotZMapCVM.py | * PlotZMapCVM.py |
Revision as of 19:01, 23 February 2012
Contents
Overview
The UCVM Visualization software is a set of Python scripts for producing 2D plots from one or more community velocity models or a 3D mesh. The following plots are supported:
- Map views for a lon-lat box
- Cross-section views between to lon-lat endpoints
- Difference plots for both maps and cross-sections
- Histogram plots of differences
The following mesh types are supported:
- AWP 3, 5, and 8 value
- SORD
- RWG (CyberShake format)
Requirements
- UCVM with one or more velocity models installed
- Python 2.6.2+, with the modules: numpy, matplotlib, basemap
Configuration
Edit the paths in ./src/Params.py so that the scripts can find your UCVM installation:
# UCVM Config UCVM_DIR = '/home/scec-00/patrices/opt/aftershock/ucvm-12.2.0/bin' UCVM_CONF = '/home/scec-00/patrices/opt/aftershock/ucvm-12.2.0/conf/ucvm.conf' UCVM_SCRIPT = 'run_ucvm.sh' #UCVM_MAP = 'yong' UCVM_MAP = 'ucvm' # GRD Config GRD_DIR = '/home/scec-00/patrices/opt/aftershock/ucvm-12.2.0/bin' GRD_NED_DIR = '/home/scec-00/patrices/opt/ned' GRD_BATH_DIR = '/home/scec-00/patrices/opt/bath' GRD_HR_VS30_DIR = '/home/scec-00/patrices/opt/vs30/wills_gridfloat' GRD_LR_VS30_DIR = '/home/scec-00/patrices/opt/vs30/wald_gridfloat' GRD_SCRIPT = 'run_grd.sh'
The lines to change at a minimum are UCVM_DIR and UCVM_CONF. UCVM_SCRIPT should reference the standard run_ucvm.sh script included in UCVM. UCVM_MAP allows you to specify an alternate Vs30/elevation map.
The GRD configuration is necessary only if you want to plot Vs30 or elevation data from ArcGIS GridFloat formatted grid files. The meaning of each config line is:
- GRD_NED_DIR specifies the directory containing that National Elevation Dataset grid files (GridFloat format).
- GRD_MATH_DIR specifies the directory containing bathymetry information (GridFloat format).
- GRD_HR_VS30_DIR specifies the directory containing the high-rez (preferred) Vs30 data
- GRD_LR_VS30_DIR contains the low-rez data
Using the Software
The UCVM Visualization package splits the plotting process into three steps:
- Extract data slice from a CVM or mesh
- (Optional) Difference one or more previously extracted datasets to produce a new dataset
- Visualize the slice
Data Extraction
The data extraction step pulls a slice of information from a CVM or mesh and saves it in a text file. This text file is space-delimited with a commented metadata section as a header. The format is Matlab friendly.
- CrossSectionCVM.py: Extracts cross-section from one or more CVMs
- CrossSectionMesh.py: Extracts cross-section from a 3D mesh
- MapCVM.py: Extracts map view at specified depth from one or more CVMs
- MapDEM.py: Extracts map view of DEM from NED data
- MapMesh.py: Extracts map view at specified depth from a mesh
- MapVs30.py: Extracts map view of Vs30 from a UCVM 2D map
- ProfileCVM.py: Extracts velocity profile at specific lon-lat point
- Vs30MapCVM.py: Computes Vs30 map from one or more CVMs (note that this is not the same as MapVs30.py)
- ZMapCVM.py: Compute Z map for desired Vs threshold
Differencing
- DiffData.py: Perform operation between two datasets with the same datatype and format (typically difference).
Plotting
The following scripts accept a previously extracted data set and plot it with Python matplotlib. It is important to use the correct plotting script for the dataset that you want to visualize. For example, a Map view extracted from a CVM with MapCVM.py must be plotted with PlotMapCVM.py. The naming is consistent so that any dataset produced with <extractor>.py can be plotted with Plot<extractor>.py.
- PlotCrossSectionCVM.py
- PlotCrossSectionDiff.py
- PlotCrossSectionMesh.py
- PlotHistDiff.py
- PlotMapCVM.py
- PlotMapDEM.py
- PlotMapDiff.py
- PlotMapMesh.py
- PlotMapVs30.py
- PlotProfileCVM.py
- PlotVs30MapCVM.py
- PlotZMapCVM.py
Various customizations are allowed:
- Choice of value from the dataset to plot (generally vp, vs, or rho)
- Color scale type (ie: Spectral), minimum/maximum values, and discrete intervals versus continuous
- Map view scripts support optional polygon overlays
- Cross-section scripts support optional region context bounding box
Helper Utilities
- BatchPlot.py: Creates a set of standard cross-sections and map views for a SoCal model