Learn R Programming

RSEIS (version 2.1-6)

ZGET.sac: Get single SAC file

Description

Get single SAC file from binary data

Usage

ZGET.sac(infile, PLOT = FALSE)

Arguments

infile
path name to file
PLOT
logical, plot (not used)

Value

  • LIST:
  • xvector of amplitudes
  • mintsvector if integer SAC header values
  • dubsvector if float(double) SAC header values
  • mcharsvector if 8-character SAC header values
  • echarsvector if 16-character SAC header values
  • dubnamesnames of float values
  • mintnamesnames of integer values
  • charnamesnames of char values

Details

Program uses C-code to read in binary SAC files and returns the header information and the time series data

See Also

dogetsac, JGET.seis, Package:Rsac

Examples

Run this code
###  you must replace this file name with local SAC file name
infile='VLI.BHZ.SAC'

ZZ = ZGET.sac(infile)

 dt = ZZ$dubs[ which(ZZ$dubnames=='delta') ]

        yr = ZZ$mints[which(ZZ$mintnames=="nzyear")]
        jd= ZZ$mints[which(ZZ$mintnames=="nzjday")]
        hr=  ZZ$mints[which(ZZ$mintnames=="nzhour")]
        mi=  ZZ$mints[which(ZZ$mintnames=="nzmin")]
        sec= ZZ$mints[which(ZZ$mintnames=="nzsec")]
        msec=ZZ$mints[which(ZZ$mintnames=="nzmsec")]


        sec = sec+msec/1000
      DATTIM=list(yr=yr, jd=jd, hr=hr, mi=mi, sec=sec)

###  the SAC file does not have the correct names, so we read from the
###              input file names
sta = substr(infile, 1,3)
comp = substr(infile, 7,7)

Run the code above in your browser using DataLab