data(GH)
staf = GH$stafile
################ get the distances from the source to the stations
d1 = GreatDist(GH$pickfile$LOC$lon, GH$pickfile$LOC$lat,staf$lon, staf$lat)
### staf has the names of the stations already, so insert the order via
### dist
staf$dist=d1$dkm
sorder = seisorder(GH, staf, VNE= c("V", "N", "E"))
PICK.GEN(GH, sel=sorder)
Run the code above in your browser using DataLab