Learn R Programming

Rquake (version 1.2-2)

EQXYresid: Calculate Residuals

Description

given an earthquake hypocenter and a list of station information, retrieve the station residuals.

Usage

EQXYresid(XY, vel = list(), h1 = c(0, 0, 0, 0), PLOT = FALSE)

Arguments

XY
matrix of station location and arrival times.
vel
list, RSEIS velocity model
h1
hypocenter location, c(x,y,z,t)
PLOT
logical, TRUE=plot the residuals

Value

  • vector, right hand side of the least squares problem.

Details

The XY mtrix is in cartesian coordinates, i.e. it has been projected into units of km. Only 1D velocity models are used at this time. Only residuals of P and S wave arrivals are estimated.

See Also

travel.time1D,UPdateEQLOC

Examples

Run this code
XY = GLOB.XY(pstas$lat, pstas$lon, proj)
    elcor = rep(0, length(pstas$lat))
    
    DZ = pstas$z - mean(stas$z)
    
    elcor[pstas$phase=="P"] = DZ[pstas$phase=="P"]/v$vp[1]
    elcor[pstas$phase=="S"] = DZ[pstas$phase=="S"]/v$vs[1]
    
    XY$cor = elcor
    XY$phase = pstas$phase
    XY$sec = pstas$sec
    
    eqXY = GLOB.XY(sol[1], sol[2], proj)
    res =  EQXYresid(XY, vel=v , h1=c(eqXY$x, eqXY$y, sol[2],sol[4]) , PLOT=FALSE)

Run the code above in your browser using DataLab