checkLOCATEinput: Check Location data

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/checkLOCATEinput.R

Description

Check to see if location data has the minimally correct list components.

Usage

1
checkLOCATEinput(Ldat, EQ, vel = NULL)

Arguments

Ldat

list, must inlude: x,y,err, sec, cor (see details)

EQ

list, must inlude: x,y,z, t

vel

list, 1D velocity structure

Details

Input pick list must have at x,y,z, sec, cor, err elements for each station.

Value

logical: FALSE mean problem with data

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

See Also

XYlocate

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
## Not run: 
library(RSEIS)
data(GH)

g1 = GH$pickfile
data(VELMOD1D)
vel= VELMOD1D



 w1 = which(!is.na(g1$STAS$lat))
         sec = g1$STAS$sec[w1]

         N = length(sec)
         Ldat =    list(
           name = g1$STAS$name[w1],
           sec = g1$STAS$sec[w1],
           phase = g1$STAS$phase[w1],
           lat=g1$STAS$lat[w1],
           lon = g1$STAS$lon[w1],
           z = g1$STAS$z[w1],
           err= g1$STAS$err[w1],
           yr = rep(g1$LOC$yr , times=N),
           jd = rep(g1$LOC$jd, times=N),
           mo = rep(g1$LOC$mo, times=N),
           dom = rep(g1$LOC$dom, times=N),
           hr =rep( g1$LOC$hr, times=N),
           mi = rep(g1$LOC$mi, times=N) )

 MLAT = median(Ldat$lat)
    MLON = median(Ldat$lon)
    
    proj = GEOmap::setPROJ(type=2, LAT0=MLAT, LON0=MLON)

####   get station X-Y values in km
    XY = GEOmap::GLOB.XY(Ldat$lat, Ldat$lon, proj)
###   add to Ldat list
    Ldat$x = XY$x
    Ldat$y = XY$y
       wstart = which.min(Ldat$sec)



EQ = list(x=XY$x[wstart], y=XY$y[wstart], z=6, t=Ldat$sec[wstart] )

checkLOCATEinput(Ldat, EQ)

## End(Not run)

Rquake documentation built on Dec. 16, 2020, 5:06 p.m.