Incorporated Research Institutions for Seismology (IRIS) Data Management Center (DMC) Product Group 2011-06-23 This bundle is provided by the IRIS DMC Product Group WITHOUT ANY WARRANTY AND/OR SUPPORT Description: This bundle contains a MATLAB script that reads through a series of SAC files in a directory and also an event file in the same directory and creates a Ground Motion Visualization (GMV) movie based on the parameters provided in the event file. Installation: - make sure MATLAB is installed on your computer and note your MATLAB installation directory path, hereafter called {MATLAB_DIR} - go to the desire installation directory, hereafter called {INSTALL_DIR} - place the IRIS_DMC_GMV folder under the {INSTALL_DIR} - the included matTaup package requires you to add: {INSTALL_DIR}/IRIS_DMC_GMV/matTaup/lib/matTaup.jar to {MATLAB_DIR}/toolbox/local/classpath.txt You could also download the latest matTaup package from: http://www.ess.washington.edu/SEIS/FMI/matTaup.htm - this package includes a test data set placed under the data directory check the {INSTALL_DIR}/ IRIS_DMC_GMV/data directory to make sure it contains the .SAC files and one event file “event.asc” that contains the processing parameters (for more information on the event file, see the Input section below) - The code uses the conus.mat that contains low-resolution latitudes and longitudes, in degrees, for the perimeter of the conterminous United States (CONUS), the Great Lakes, and interstate borders. This file is distributed with the MATLAB mapping toolbox. The GMV code uses this file to address the problem of outlining the Great Lakes on the US map. However, "conus.mat" file is not critical for running the GMV. To remove dependency on this file, comment out the following lines in your code. By removing these lines the Great Lakes region will not be displayed properly on the US map but the rest should be fine. % % the fill above masks the Great Lakes, now put the Great Lakes back with blue color % load conus; gtlon=gtlakelon-centerLon; gtlat= asinh(tan(gtlakelat*pi/180.))* 180.0 / pi; % lakes are separated by NaN % Use polysplit to create two cell arrays, latc and lonc % [latc,lonc]=polysplit(gtlat,gtlon); fill(lonc{1},latc{1},'w'); fill(lonc{2},latc{2},'w'); fill(lonc{3},latc{3},'w'); - for more customization, edit the script and change its parameters - if you want to convert the AVI movies produced by the script to mp4 format, you may use ffmpeg (not provided). See the Running the Script" section below and http://www.ffmpeg.org for more information Running the Script: to start generating movie based on the test data set: - cd {INSTALL_DIR}/IRIS_DMC_GMV/bin - start MATLAB - type GMV_1C at the command window - Notes: o For each frame MATLAB captures the image on the display screen. If the MATLAB display screen is covered at any time, the covering object will also be captured! o Since MATLAB is using image capture to make movie frames, the actual graphic device resolution will control the final movie quality, color, text size and some graphic elements positioning you may need to tune the script based on your graphic device - the script will indicate its progress by displaying a dot (".") on the command window for each frame that it captures - once the processing is complete, the movie will be available in AVI format as {INSTALL_DIR}/IRIS_DMC_GMV/movie/{FILENAME}.avi the movie file name, {FILENAME}, will be in the form PREFIX_ID where PREFIX is determined by the “moviePrefix” variable in the script and ID is the ID parameter defined in the event file - To convert the AVI movies produced by the script to mp4 format you may use ffmpeg (not provided) as shown below: ffmpeg -y -i {INSTALL_DIR}/IRIS_DMC_GMV/movie/{FILENAME}.avi -vcodec libx264 -crf 22 -g 300 -cmp +chroma {INSTALL_DIR}/IRIS_DMC_GMV/movie/{FILENAME}.mp4 - IRIS_DMC_GMV .tar.gz contains movie for the included test data Input: Script expects the {INSTALL_DIR}/ IRIS_DMC_GMV/data to contain waveform SAC files (file names of .SAC file should contain the channel name) and an event file with necessary parameters as described below: {INSTALL_DIR}/ IRIS_DMC_GMV/data /event.asc with each line containing KEY,VALUE pairs with "|" as separator: KEY|VALUE ID| GMV ID will be used as part of the movie file name TITLE| a string title for the GMV WIN_START| start of the GMV time window as YYYY-MM-DD HH24:MI:SS UTC WIN_END| end of the GMV time window as YYYY-MM-DD HH24:MI:SS UTC WIN_STEP| create a frame for every WIN_STEP seconds of real time EVENT_LAT| (optional) event latitude, if not provided, estimated arrival times will not be marked on the reference seismogram -90/90 EVENT_LON| (optional) event longitude, if not provided, estimated arrival times will not be marked on the reference seismogram -180/180. EVENT_TIME| (optional) event as YYYY-MM-DD HH24:MI:SS UTC. If not provided, estimated arrival times will not be marked on the reference seismogram SHOW_GC| show the great circle path on GMV, 1=yes, 0=no LL_LAT| lower left latitude of the animation window (-90/90) LL_LON| lower left longitude of the animation window (-180/180) UR_LAT| upper right latitude of the animation window (-90/90) UR_LON| upper right longitude of the animation window (-180/180) WIDTH| animation window width in pixels (800 maximum) MAGNIFICATION| trace magnification. Higher trace magnification highlights weaker arrivals at the expense of saturating colors for the stronger arrivals. The default value of 10 is suitable for most events. For close events, a magnification factor of 5 or less would place less emphasis on unwanted near-source arrivals. CHANNEL|channel to use for GMV. The format is TECH_CHAN where TECH is the technology (SEIS for seismic or INFRA for infrasound and CHAN is the channel name) NOTE: script expects channel name (CHAN value) to be part of the SAC file name LP| (optional) low-pass filter corner frequency (HZ) HP| (optional) high-pass filter corner frequency (HZ) Example event file: ID|123 TITLE|GULF OF CALIFORNIA, M=6.7, 2010-10-21, 0.001-0.01 Hz WIN_START|2010-10-21 17:52:42 WIN_END|2010-10-21 18:26:42 WIN_STEP|4 EVENT_LAT|24.69 EVENT_LON|-109.159 EVENT_TIME|2010-10-21 17:53:13 SHOW_GC|1 MAGNIFICATION|5 LL_LAT|19.97 LL_LON|-125.86 UR_LAT|50.0 UR_LON|-65.5 WIDTH|800 CHANNEL|SEIS_LHZ LP|0.01 HP|0.001