Learn R Programming

RFOC (version 2.0-02)

getCMT: Read CMT

Description

Read and reformat CMT solutions downloaded from the web.

Usage

getCMT(fn, skip=1)

Arguments

fn
character file name
skip
number of lines to skip (e.g. header)

Value

  • list of CMT solution data:
  • lonlon of epicenter
  • latlat of epicenter
  • str1strike of fault plane
  • dip1dip of fault plane
  • rake1rake of fault plane
  • str2strike of auxilliary plane
  • dip2dip of auxilliary plane
  • rake2rake of auxilliary plane
  • scscale?
  • iexpexponent?
  • namename, includes the date
  • Elatexploding latitude, set to lat initially
  • Elonexploding longitude, set to lon initially
  • jdjulian day
  • yryear
  • momonth
  • domday of month

Details

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.

References

http://www.globalcmt.org/CMTsearch.html

G. Ekstrom. Rapid earthquake analysis utilizes the internet. Computers in Physics, 8:632-638, 1994.

See Also

ExplodeSymbols, spherefocgeo, ternfocgeo

Examples

Run this code
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], size = c(0.5,
         0.5), fcol = Fcol, xpd = FALSE)
 }

Run the code above in your browser using DataLab