getCMT | R Documentation |
Read and reformat CMT solutions downloaded from the web.
getCMT(fn, skip=1)
fn |
character file name |
skip |
number of lines to skip (e.g. header) |
Data can be extracted from web site: http://www.globalcmt.org/CMTsearch.html
The file must be cleaned prior to scanning - on download from the web site there are extra lines on top and bottom of file. Delete these. Leave one line on the top that describesthe columns. Data is separated by blanks. The files have a mixture of dates - some with 7 component dates (YYMMDD and others with 14 components YYYYMODDHHMM these are read in separately. Missing hours and minutes areset to zero.
list of CMT solution data:
lon |
lon of epicenter |
lat |
lat of epicenter |
str1 |
strike of fault plane |
dip1 |
dip of fault plane |
rake1 |
rake of fault plane |
str2 |
strike of auxilliary plane |
dip2 |
dip of auxilliary plane |
rake2 |
rake of auxilliary plane |
sc |
scale? |
iexp |
exponent? |
name |
name, includes the date |
Elat |
exploding latitude, set to lat initially |
Elon |
exploding longitude, set to lon initially |
jd |
julian day |
yr |
year |
mo |
month |
dom |
day of month |
Use ExplodeSymbols or explode to get new locations for expanding the plotting points.
Jonathan M. Lees<jonathan.lees@unc.edu>
http://www.globalcmt.org/CMTsearch.html
G. Ekstrom. Rapid earthquake analysis utilizes the internet. Computers in Physics, 8:632-638, 1994.
ExplodeSymbols, spherefocgeo, ternfocgeo
## Not run:
g = getCMT("/home/lees/aleut.cmt")
pg = prepFOCS(g)
plot(range(pg$LONS), range(pg$LATS), type = "n", xlab = "LON",
ylab = "LAT", asp = 1)
for (i in 1:length(pg$LATS)) {
mc = CONVERTSDR(g$str1[i], g$dip1[i], g$rake1[i])
MEC <- MRake(mc$M)
MEC$UP = FALSE
Fcol <- foc.color(foc.icolor(MEC$rake1), pal = 1)
justfocXY(MEC, x = pg$LONS[i], y = pg$LATS[i], focsiz = 0.4,
fcol = Fcol, xpd = FALSE)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.