edu.sc.seis.seisFile.sac
Class SacTimeSeries

java.lang.Object
  extended by edu.sc.seis.seisFile.sac.SacTimeSeries

public class SacTimeSeries
extends java.lang.Object

Class that represents a sac file. All headers are have the same names as within the Sac program. Can read the whole file or just the header as well as write a file. This reflects the sac header as of version 101.4 in utils/sac.h Notes: Key to comment flags describing each field: Column 1: R required by SAC (blank) optional Column 2: A = settable from a priori knowledge D = available in data F = available in or derivable from SEED fixed data header T = available in SEED header tables (blank) = not directly available from SEED data, header tables, or elsewhere


Field Summary
 float a
          1st arrival time
 float[] amp
           
 float az
          event-stn azimuth
 float b
          RD initial time - wrt nz*
 float baz
          stn-event azimuth
 float cmpaz
          T component azimuth
 float cmpinc
          T component inclination
static int data_offset
           
static java.text.DecimalFormat decimalFormat
           
static int DEFAULT_NVHDR
           
 float delta
          RF time increment, sec
 float depmax
          maximum amplitude
 float depmen
          mean value, amplitude
 float depmin
          minimum amplitude
 float dist
          stn-event distance, km
 float e
          RD end time
 float evdp
          event depth
 float evel
          event elevation
 float evla
          event latitude
 float evlo
          event longitude
 float f
          event end, sec > 0
static int FALSE
           
static float FLOAT_UNDEF
           
 float fmt
          internal use
 float gcarc
          stn-event dist, degrees
static int IA
          First arrival time
static int IACC
          Acceleration (NM/SEC/SEC)
static int IAMPH
          Spectral file-ampl/phase
static int IB
          Begin time
static int IBRK
          IBRK
static int ICALTECH
          ICALTECH
static int ICHEM
          Chemical explosion
static int IDAY
          GMT day
 int idep
          type of amplitude
static int IDISP
          Displacement (NM)
static int IDOWN
          Down positive
static int IDROP
          Dropouts
static int IEAST
          East positive
static int IEQ
          Earthquake
static int IEQ0
          Probable earthquake
static int IEQ1
          Earthquakes in a swarm or aftershock sequence
static int IEQ2
          Felt earthquake
static int IEQ3
          Damaging Earthquake
static int IEVLOC
          IEVLOC
 int ievreg
          event geographic region
 int ievtyp
          event type
static int IEX
          Other explosion
static int IEX0
          Probable explosion
 int iftype
          RA type of file
static int IGEY
          Geyser
static int IGLCH
          Gliches
static int IGOOD
          Good
static int IHGLP
          High-gain long-period
static int IHORZA
          Horizontal (ARB)
 int iinst
          recording instrument
static int IISC
          IISC
static int IJSOP
          IJSOP
static int IL
          Local event of unknown origin
static int ILIT
          Light
static int ILLLBB
          LLL broadband
static int ILLNL
          ILLNL
static int ILOWSN
          Low signal to noise ratio
 float[] imaginary
           
 int imagsrc
          magnitude source
 int imagtyp
          magnitude type
static int IMB
          Bodywave Magnitude
static int IMD
          Duration Magnitude
static int IME
          Marine explosion
static int IMET
          Meteroic event
static int IML
          Local Magnitude
static int IMS
          Surface Magnitude
static int IMW
          Moment Magnitude
static int IMX
          User Defined Magnitude
static int INC
          Nuclear cavity collapse
static int INEIC
          INEIC
static int INORTH
          North positive
static int INT_UNDEF
           
static boolean IntelByteOrder
           
static int INU
          Nuclear explosion
static int INUCL
          Nuclear event
static int IO
          Event origin time
static int IO_
          Other source of known origin
static int IODOR
          Odors
static int IOTHER
          Other
static int IPDE
          IPDE
static int IPDEQ
          IPDEQ
static int IPDEW
          IPDEW
static int IPOSTN
          Nuclear post-shot event
static int IPOSTQ
          Aftershock
static int IPREN
          Nuclear pre-shot event
static int IPREQ
          Foreshock
static int IQB
          Quarry or mine blast confirmed by quarry
static int IQB0
          Probable Mine Blast
static int IQB1
          Quarry or mine blast with designed shot information-ripple fired
static int IQB2
          Quarry or mine blast with observed shot information-ripple fired
static int IQBX
          Quarry or mine blast - single shot
static int IQC
          Mine collapse
static int IQMT
          Quarry or mining-induced events: tremors and rockbursts
static int IQUAKE
          Earthquake
 int iqual
          quality of data
static int IR
          Regional event of unknown origin
static int IRADEV
          Radial (EVENT)
static int IRADNV
          Radial (NTS)
static int IREAL
          Undocumented
static int IREB
          IREB
static int IRLDTA
          Real data
static int IRLIM
          Spectral file-real/imag
static int ISRO
          SRO
 int istreg
          stn geographic region
 int isynth
          synthetic data flag
static int IT
          Teleseismic event of unknown origin
static int IT0
          User defined time pick 0
static int IT1
          User defined time pick 1
static int IT2
          User defined time pick 2
static int IT3
          User defined time pick 3
static int IT4
          User defined time pick 4
static int IT5
          User defined time pick 5
static int IT6
          User defined time pick 6
static int IT7
          User defined time pick 7
static int IT8
          User defined time pick 8
static int IT9
          User defined time pick 9
static int ITANEV
          Tangential (EVENT)
static int ITANNV
          Tangential (NTS)
static int ITIME
          Time series file
static int IU
          Undetermined or conflicting information
static int IUNKN
          Unknown
static int IUNKNOWN
          IUNKNOWN
static int IUP
          Up positive
static int IUSER
          IUSER
static int IUSGS
          IUSGS
static int IVEL
          Velocity (NM/SEC)
static int IVOLTS
          Velocity (volts)
static int IWWSN1
          WWSN 15-100
static int IWWSN2
          WWSN 30-100
static int IXY
          General x vs y file
static int IXYZ
          General XYZ (3-D) file
 int iztype
          zero time equivalence
 java.lang.String ka
          1st arrival time ident
 java.lang.String kcmpnm
          F component name
 java.lang.String kdatrd
          date data read
 java.lang.String kevnm
          event name
 java.lang.String kf
          end of event ident
 java.lang.String khole
          man-made event name
 java.lang.String kinst
          instrument name
 java.lang.String knetwk
          network name
 java.lang.String ko
          event origin time id
 java.lang.String kstnm
          F station name
 java.lang.String kt0
          time pick 0 ident
 java.lang.String kt1
          time pick 1 ident
 java.lang.String kt2
          time pick 2 ident
 java.lang.String kt3
          time pick 3 ident
 java.lang.String kt4
          time pick 4 ident
 java.lang.String kt5
          time pick 5 ident
 java.lang.String kt6
          time pick 6 ident
 java.lang.String kt7
          time pick 7 ident
 java.lang.String kt8
          time pick 8 ident
 java.lang.String kt9
          time pick 9 ident
 java.lang.String kuser0
          available to user
 java.lang.String kuser1
          available to user
 java.lang.String kuser2
          available to user
 int lcalda
          calc distance, azimuth
 int leven
          RA data-evenly-spaced flag
 int lovrok
          overwrite permission
 int lpspol
          station polarity flag
 float mag
          magnitude value
 int nevid
          Event ID
 int norid
          Origin ID
 int npts
          RF number of samples
static int NPTS_OFFSET
           
 int nsnpts
          saved npts
 int nvhdr
          R header version number
static int NVHDR_OFFSET
           
 int nwfid
          Waveform ID
 int nxsize
          XYZ X size
 int nysize
          XYZ Y size
 int nzhour
          F zero time of file, hr
 int nzjday
          F zero time of file, day
 int nzmin
          F zero time of file, min
 int nzmsec
          F zero time of file, msec
 int nzsec
          F zero time of file, sec
 int nzyear
          F zero time of file, yr
 float o
          event start
 float odelta
          observed time inc
 float[] phase
           
 float[] real
           
 float resp0
          instrument respnse parm
 float resp1
          instrument respnse parm
 float resp2
          instrument respnse parm
 float resp3
          instrument respnse parm
 float resp4
          instrument respnse parm
 float resp5
          instrument respnse parm
 float resp6
          instrument respnse parm
 float resp7
          instrument respnse parm
 float resp8
          instrument respnse parm
 float resp9
          instrument respnse parm
 float sb
          saved b value
 float scale
          amplitude scale factor
 float sdelta
          saved delta value
 float stdp
          T station depth, m
 float stel
          T station elevation, m
 float stla
          T station latititude
 float stlo
          T station longitude
static java.lang.String STRING16_UNDEF
           
static java.lang.String STRING8_UNDEF
           
static boolean SunByteOrder
           
 float t0
          user-defined time pick
 float t1
          user-defined time pick
 float t2
          user-defined time pick
 float t3
          user-defined time pick
 float t4
          user-defined time pick
 float t5
          user-defined time pick
 float t6
          user-defined time pick
 float t7
          user-defined time pick
 float t8
          user-defined time pick
 float t9
          user-defined time pick
static int TRUE
           
 float unused10
          reserved for future use
 float unused11
          reserved for future use
 float unused12
          reserved for future use
 int unused15
          reserved for future use
 int unused16
          reserved for future use
 int unused19
          reserved for future use
 int unused20
          reserved for future use
 int unused21
          reserved for future use
 int unused22
          reserved for future use
 int unused23
          reserved for future use
 int unused24
          reserved for future use
 int unused25
          reserved for future use
 int unused26
          reserved for future use
 int unused27
          reserved for future use
 float unused6
          reserved for future use
 float unused7
          reserved for future use
 float unused8
          reserved for future use
 float unused9
          reserved for future use
 float user0
          available to user
 float user1
          available to user
 float user2
          available to user
 float user3
          available to user
 float user4
          available to user
 float user5
          available to user
 float user6
          available to user
 float user7
          available to user
 float user8
          available to user
 float user9
          available to user
 float[] x
           
 float xmaximum
          XYZ X maximum value
 float xminimum
          XYZ X minimum value
 float[] y
           
 float ymaximum
          XYZ Y maximum value
 float yminimum
          XYZ Y minimum value
 
Constructor Summary
SacTimeSeries()
           
SacTimeSeries(java.io.DataInput inStream)
           
SacTimeSeries(java.io.File file)
           
SacTimeSeries(java.lang.String filename)
           
 
Method Summary
static java.lang.String format(java.lang.String label, float f)
           
static java.lang.String format(java.lang.String label, java.lang.String val, int labelWidth, int valWidth)
           
static java.lang.String formatLine(java.lang.String s1, float f1, java.lang.String s2, float f2, java.lang.String s3, float f3, java.lang.String s4, float f4, java.lang.String s5, float f5)
           
 boolean getByteOrder()
           
static void main(java.lang.String[] args)
          just for testing.
 void printHeader()
           
 void printHeader(java.io.PrintWriter out)
           
 void read(java.io.DataInput dis)
           
 void read(java.io.File sacFile)
           
 void read(java.lang.String filename)
          reads the sac file specified by the filename.
 void readData(java.io.DataInput fis)
          read the data portion of the given File
 void readHeader(java.io.DataInput indis)
          reads the header from the given stream.
 void readHeader(java.lang.String filename)
          reads just the sac header specified by the filename.
 void setBigEndian()
          Sets the byte order when writing to output.
 void setLittleEndian()
          Sets the byte order when writing to output.
static int swapBytes(int val)
           
static long swapBytes(long val)
           
static short swapBytes(short val)
           
static java.lang.String trimLen(java.lang.String s, int len)
           
 void write(java.io.File file)
          writes this object out as a sac file.
 void write(java.lang.String filename)
          writes this object out as a sac file.
 void writeData(java.io.DataOutput dos)
           
 void writeHeader(java.io.DataOutput dos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

delta

public float delta
RF time increment, sec


depmin

public float depmin
minimum amplitude


depmax

public float depmax
maximum amplitude


scale

public float scale
amplitude scale factor


odelta

public float odelta
observed time inc


b

public float b
RD initial time - wrt nz*


e

public float e
RD end time


o

public float o
event start


a

public float a
1st arrival time


fmt

public float fmt
internal use


t0

public float t0
user-defined time pick


t1

public float t1
user-defined time pick


t2

public float t2
user-defined time pick


t3

public float t3
user-defined time pick


t4

public float t4
user-defined time pick


t5

public float t5
user-defined time pick


t6

public float t6
user-defined time pick


t7

public float t7
user-defined time pick


t8

public float t8
user-defined time pick


t9

public float t9
user-defined time pick


f

public float f
event end, sec > 0


resp0

public float resp0
instrument respnse parm


resp1

public float resp1
instrument respnse parm


resp2

public float resp2
instrument respnse parm


resp3

public float resp3
instrument respnse parm


resp4

public float resp4
instrument respnse parm


resp5

public float resp5
instrument respnse parm


resp6

public float resp6
instrument respnse parm


resp7

public float resp7
instrument respnse parm


resp8

public float resp8
instrument respnse parm


resp9

public float resp9
instrument respnse parm


stla

public float stla
T station latititude


stlo

public float stlo
T station longitude


stel

public float stel
T station elevation, m


stdp

public float stdp
T station depth, m


evla

public float evla
event latitude


evlo

public float evlo
event longitude


evel

public float evel
event elevation


evdp

public float evdp
event depth


mag

public float mag
magnitude value


user0

public float user0
available to user


user1

public float user1
available to user


user2

public float user2
available to user


user3

public float user3
available to user


user4

public float user4
available to user


user5

public float user5
available to user


user6

public float user6
available to user


user7

public float user7
available to user


user8

public float user8
available to user


user9

public float user9
available to user


dist

public float dist
stn-event distance, km


az

public float az
event-stn azimuth


baz

public float baz
stn-event azimuth


gcarc

public float gcarc
stn-event dist, degrees


sb

public float sb
saved b value


sdelta

public float sdelta
saved delta value


depmen

public float depmen
mean value, amplitude


cmpaz

public float cmpaz
T component azimuth


cmpinc

public float cmpinc
T component inclination


xminimum

public float xminimum
XYZ X minimum value


xmaximum

public float xmaximum
XYZ X maximum value


yminimum

public float yminimum
XYZ Y minimum value


ymaximum

public float ymaximum
XYZ Y maximum value


unused6

public float unused6
reserved for future use


unused7

public float unused7
reserved for future use


unused8

public float unused8
reserved for future use


unused9

public float unused9
reserved for future use


unused10

public float unused10
reserved for future use


unused11

public float unused11
reserved for future use


unused12

public float unused12
reserved for future use


nzyear

public int nzyear
F zero time of file, yr


nzjday

public int nzjday
F zero time of file, day


nzhour

public int nzhour
F zero time of file, hr


nzmin

public int nzmin
F zero time of file, min


nzsec

public int nzsec
F zero time of file, sec


nzmsec

public int nzmsec
F zero time of file, msec


nvhdr

public int nvhdr
R header version number


norid

public int norid
Origin ID


nevid

public int nevid
Event ID


npts

public int npts
RF number of samples


nsnpts

public int nsnpts
saved npts


nwfid

public int nwfid
Waveform ID


nxsize

public int nxsize
XYZ X size


nysize

public int nysize
XYZ Y size


unused15

public int unused15
reserved for future use


iftype

public int iftype
RA type of file


idep

public int idep
type of amplitude


iztype

public int iztype
zero time equivalence


unused16

public int unused16
reserved for future use


iinst

public int iinst
recording instrument


istreg

public int istreg
stn geographic region


ievreg

public int ievreg
event geographic region


ievtyp

public int ievtyp
event type


iqual

public int iqual
quality of data


isynth

public int isynth
synthetic data flag


imagtyp

public int imagtyp
magnitude type


imagsrc

public int imagsrc
magnitude source


unused19

public int unused19
reserved for future use


unused20

public int unused20
reserved for future use


unused21

public int unused21
reserved for future use


unused22

public int unused22
reserved for future use


unused23

public int unused23
reserved for future use


unused24

public int unused24
reserved for future use


unused25

public int unused25
reserved for future use


unused26

public int unused26
reserved for future use


leven

public int leven
RA data-evenly-spaced flag


lpspol

public int lpspol
station polarity flag


lovrok

public int lovrok
overwrite permission


lcalda

public int lcalda
calc distance, azimuth


unused27

public int unused27
reserved for future use


kstnm

public java.lang.String kstnm
F station name


kevnm

public java.lang.String kevnm
event name


khole

public java.lang.String khole
man-made event name


ko

public java.lang.String ko
event origin time id


ka

public java.lang.String ka
1st arrival time ident


kt0

public java.lang.String kt0
time pick 0 ident


kt1

public java.lang.String kt1
time pick 1 ident


kt2

public java.lang.String kt2
time pick 2 ident


kt3

public java.lang.String kt3
time pick 3 ident


kt4

public java.lang.String kt4
time pick 4 ident


kt5

public java.lang.String kt5
time pick 5 ident


kt6

public java.lang.String kt6
time pick 6 ident


kt7

public java.lang.String kt7
time pick 7 ident


kt8

public java.lang.String kt8
time pick 8 ident


kt9

public java.lang.String kt9
time pick 9 ident


kf

public java.lang.String kf
end of event ident


kuser0

public java.lang.String kuser0
available to user


kuser1

public java.lang.String kuser1
available to user


kuser2

public java.lang.String kuser2
available to user


kcmpnm

public java.lang.String kcmpnm
F component name


knetwk

public java.lang.String knetwk
network name


kdatrd

public java.lang.String kdatrd
date data read


kinst

public java.lang.String kinst
instrument name


y

public float[] y

x

public float[] x

real

public float[] real

imaginary

public float[] imaginary

amp

public float[] amp

phase

public float[] phase

FLOAT_UNDEF

public static float FLOAT_UNDEF

INT_UNDEF

public static int INT_UNDEF

STRING8_UNDEF

public static java.lang.String STRING8_UNDEF

STRING16_UNDEF

public static java.lang.String STRING16_UNDEF

DEFAULT_NVHDR

public static final int DEFAULT_NVHDR
See Also:
Constant Field Values

TRUE

public static final int TRUE
See Also:
Constant Field Values

FALSE

public static final int FALSE
See Also:
Constant Field Values

IREAL

public static final int IREAL
Undocumented

See Also:
Constant Field Values

ITIME

public static final int ITIME
Time series file

See Also:
Constant Field Values

IRLIM

public static final int IRLIM
Spectral file-real/imag

See Also:
Constant Field Values

IAMPH

public static final int IAMPH
Spectral file-ampl/phase

See Also:
Constant Field Values

IXY

public static final int IXY
General x vs y file

See Also:
Constant Field Values

IUNKN

public static final int IUNKN
Unknown

See Also:
Constant Field Values

IDISP

public static final int IDISP
Displacement (NM)

See Also:
Constant Field Values

IVEL

public static final int IVEL
Velocity (NM/SEC)

See Also:
Constant Field Values

IACC

public static final int IACC
Acceleration (NM/SEC/SEC)

See Also:
Constant Field Values

IB

public static final int IB
Begin time

See Also:
Constant Field Values

IDAY

public static final int IDAY
GMT day

See Also:
Constant Field Values

IO

public static final int IO
Event origin time

See Also:
Constant Field Values

IA

public static final int IA
First arrival time

See Also:
Constant Field Values

IT0

public static final int IT0
User defined time pick 0

See Also:
Constant Field Values

IT1

public static final int IT1
User defined time pick 1

See Also:
Constant Field Values

IT2

public static final int IT2
User defined time pick 2

See Also:
Constant Field Values

IT3

public static final int IT3
User defined time pick 3

See Also:
Constant Field Values

IT4

public static final int IT4
User defined time pick 4

See Also:
Constant Field Values

IT5

public static final int IT5
User defined time pick 5

See Also:
Constant Field Values

IT6

public static final int IT6
User defined time pick 6

See Also:
Constant Field Values

IT7

public static final int IT7
User defined time pick 7

See Also:
Constant Field Values

IT8

public static final int IT8
User defined time pick 8

See Also:
Constant Field Values

IT9

public static final int IT9
User defined time pick 9

See Also:
Constant Field Values

IRADNV

public static final int IRADNV
Radial (NTS)

See Also:
Constant Field Values

ITANNV

public static final int ITANNV
Tangential (NTS)

See Also:
Constant Field Values

IRADEV

public static final int IRADEV
Radial (EVENT)

See Also:
Constant Field Values

ITANEV

public static final int ITANEV
Tangential (EVENT)

See Also:
Constant Field Values

INORTH

public static final int INORTH
North positive

See Also:
Constant Field Values

IEAST

public static final int IEAST
East positive

See Also:
Constant Field Values

IHORZA

public static final int IHORZA
Horizontal (ARB)

See Also:
Constant Field Values

IDOWN

public static final int IDOWN
Down positive

See Also:
Constant Field Values

IUP

public static final int IUP
Up positive

See Also:
Constant Field Values

ILLLBB

public static final int ILLLBB
LLL broadband

See Also:
Constant Field Values

IWWSN1

public static final int IWWSN1
WWSN 15-100

See Also:
Constant Field Values

IWWSN2

public static final int IWWSN2
WWSN 30-100

See Also:
Constant Field Values

IHGLP

public static final int IHGLP
High-gain long-period

See Also:
Constant Field Values

ISRO

public static final int ISRO
SRO

See Also:
Constant Field Values

INUCL

public static final int INUCL
Nuclear event

See Also:
Constant Field Values

IPREN

public static final int IPREN
Nuclear pre-shot event

See Also:
Constant Field Values

IPOSTN

public static final int IPOSTN
Nuclear post-shot event

See Also:
Constant Field Values

IQUAKE

public static final int IQUAKE
Earthquake

See Also:
Constant Field Values

IPREQ

public static final int IPREQ
Foreshock

See Also:
Constant Field Values

IPOSTQ

public static final int IPOSTQ
Aftershock

See Also:
Constant Field Values

ICHEM

public static final int ICHEM
Chemical explosion

See Also:
Constant Field Values

IOTHER

public static final int IOTHER
Other

See Also:
Constant Field Values

IGOOD

public static final int IGOOD
Good

See Also:
Constant Field Values

IGLCH

public static final int IGLCH
Gliches

See Also:
Constant Field Values

IDROP

public static final int IDROP
Dropouts

See Also:
Constant Field Values

ILOWSN

public static final int ILOWSN
Low signal to noise ratio

See Also:
Constant Field Values

IRLDTA

public static final int IRLDTA
Real data

See Also:
Constant Field Values

IVOLTS

public static final int IVOLTS
Velocity (volts)

See Also:
Constant Field Values

IXYZ

public static final int IXYZ
General XYZ (3-D) file

See Also:
Constant Field Values

IMB

public static final int IMB
Bodywave Magnitude

See Also:
Constant Field Values

IMS

public static final int IMS
Surface Magnitude

See Also:
Constant Field Values

IML

public static final int IML
Local Magnitude

See Also:
Constant Field Values

IMW

public static final int IMW
Moment Magnitude

See Also:
Constant Field Values

IMD

public static final int IMD
Duration Magnitude

See Also:
Constant Field Values

IMX

public static final int IMX
User Defined Magnitude

See Also:
Constant Field Values

INEIC

public static final int INEIC
INEIC

See Also:
Constant Field Values

IPDEQ

public static final int IPDEQ
IPDEQ

See Also:
Constant Field Values

IPDEW

public static final int IPDEW
IPDEW

See Also:
Constant Field Values

IPDE

public static final int IPDE
IPDE

See Also:
Constant Field Values

IISC

public static final int IISC
IISC

See Also:
Constant Field Values

IREB

public static final int IREB
IREB

See Also:
Constant Field Values

IUSGS

public static final int IUSGS
IUSGS

See Also:
Constant Field Values

IBRK

public static final int IBRK
IBRK

See Also:
Constant Field Values

ICALTECH

public static final int ICALTECH
ICALTECH

See Also:
Constant Field Values

ILLNL

public static final int ILLNL
ILLNL

See Also:
Constant Field Values

IEVLOC

public static final int IEVLOC
IEVLOC

See Also:
Constant Field Values

IJSOP

public static final int IJSOP
IJSOP

See Also:
Constant Field Values

IUSER

public static final int IUSER
IUSER

See Also:
Constant Field Values

IUNKNOWN

public static final int IUNKNOWN
IUNKNOWN

See Also:
Constant Field Values

IQB

public static final int IQB
Quarry or mine blast confirmed by quarry

See Also:
Constant Field Values

IQB1

public static final int IQB1
Quarry or mine blast with designed shot information-ripple fired

See Also:
Constant Field Values

IQB2

public static final int IQB2
Quarry or mine blast with observed shot information-ripple fired

See Also:
Constant Field Values

IQBX

public static final int IQBX
Quarry or mine blast - single shot

See Also:
Constant Field Values

IQMT

public static final int IQMT
Quarry or mining-induced events: tremors and rockbursts

See Also:
Constant Field Values

IEQ

public static final int IEQ
Earthquake

See Also:
Constant Field Values

IEQ1

public static final int IEQ1
Earthquakes in a swarm or aftershock sequence

See Also:
Constant Field Values

IEQ2

public static final int IEQ2
Felt earthquake

See Also:
Constant Field Values

IME

public static final int IME
Marine explosion

See Also:
Constant Field Values

IEX

public static final int IEX
Other explosion

See Also:
Constant Field Values

INU

public static final int INU
Nuclear explosion

See Also:
Constant Field Values

INC

public static final int INC
Nuclear cavity collapse

See Also:
Constant Field Values

IO_

public static final int IO_
Other source of known origin

See Also:
Constant Field Values

IL

public static final int IL
Local event of unknown origin

See Also:
Constant Field Values

IR

public static final int IR
Regional event of unknown origin

See Also:
Constant Field Values

IT

public static final int IT
Teleseismic event of unknown origin

See Also:
Constant Field Values

IU

public static final int IU
Undetermined or conflicting information

See Also:
Constant Field Values

IEQ3

public static final int IEQ3
Damaging Earthquake

See Also:
Constant Field Values

IEQ0

public static final int IEQ0
Probable earthquake

See Also:
Constant Field Values

IEX0

public static final int IEX0
Probable explosion

See Also:
Constant Field Values

IQC

public static final int IQC
Mine collapse

See Also:
Constant Field Values

IQB0

public static final int IQB0
Probable Mine Blast

See Also:
Constant Field Values

IGEY

public static final int IGEY
Geyser

See Also:
Constant Field Values

ILIT

public static final int ILIT
Light

See Also:
Constant Field Values

IMET

public static final int IMET
Meteroic event

See Also:
Constant Field Values

IODOR

public static final int IODOR
Odors

See Also:
Constant Field Values

data_offset

public static final int data_offset
See Also:
Constant Field Values

NVHDR_OFFSET

public static final int NVHDR_OFFSET
See Also:
Constant Field Values

NPTS_OFFSET

public static final int NPTS_OFFSET
See Also:
Constant Field Values

SunByteOrder

public static final boolean SunByteOrder
See Also:
Constant Field Values

IntelByteOrder

public static final boolean IntelByteOrder
See Also:
Constant Field Values

decimalFormat

public static final java.text.DecimalFormat decimalFormat
Constructor Detail

SacTimeSeries

public SacTimeSeries()

SacTimeSeries

public SacTimeSeries(java.io.File file)
              throws java.io.FileNotFoundException,
                     java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

SacTimeSeries

public SacTimeSeries(java.lang.String filename)
              throws java.io.FileNotFoundException,
                     java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

SacTimeSeries

public SacTimeSeries(java.io.DataInput inStream)
              throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getByteOrder

public boolean getByteOrder()

read

public void read(java.lang.String filename)
          throws java.io.FileNotFoundException,
                 java.io.IOException
reads the sac file specified by the filename. Only a very simple check is made to be sure the file really is a sac file.

Throws:
java.io.FileNotFoundException - if the file cannot be found
java.io.IOException - if it isn't a sac file or if it happens :)

read

public void read(java.io.File sacFile)
          throws java.io.FileNotFoundException,
                 java.io.IOException
Throws:
java.io.FileNotFoundException
java.io.IOException

setLittleEndian

public final void setLittleEndian()
Sets the byte order when writing to output. Does not change the internal representation of the data.


setBigEndian

public final void setBigEndian()
Sets the byte order when writing to output. Does not change the internal representation of the data.


swapBytes

public static final short swapBytes(short val)

swapBytes

public static final int swapBytes(int val)

swapBytes

public static final long swapBytes(long val)

read

public void read(java.io.DataInput dis)
          throws java.io.IOException
Throws:
java.io.IOException

readHeader

public void readHeader(java.lang.String filename)
                throws java.io.FileNotFoundException,
                       java.io.IOException
reads just the sac header specified by the filename. No checks are made to be sure the file really is a sac file.

Throws:
java.io.FileNotFoundException
java.io.IOException

readHeader

public void readHeader(java.io.DataInput indis)
                throws java.io.FileNotFoundException,
                       java.io.IOException
reads the header from the given stream. The NVHDR value (shoudld be 6) is checked to see if byte swapping is needed. If so, all header values are byte swapped and the byteOrder is set to IntelByteOrder (false) so that the data section will also be byte swapped on read. Extra care is taken to do all byte swapping before the byte values are transformed into floats as java can do very funny things if the byte-swapped float happens to be a NaN.

Throws:
java.io.FileNotFoundException
java.io.IOException

readData

public void readData(java.io.DataInput fis)
              throws java.io.IOException
read the data portion of the given File

Throws:
java.io.IOException

write

public void write(java.lang.String filename)
           throws java.io.FileNotFoundException,
                  java.io.IOException
writes this object out as a sac file.

Throws:
java.io.FileNotFoundException
java.io.IOException

write

public void write(java.io.File file)
           throws java.io.FileNotFoundException,
                  java.io.IOException
writes this object out as a sac file.

Throws:
java.io.FileNotFoundException
java.io.IOException

writeHeader

public void writeHeader(java.io.DataOutput dos)
                 throws java.io.IOException
Throws:
java.io.IOException

writeData

public void writeData(java.io.DataOutput dos)
               throws java.io.IOException
Throws:
java.io.IOException

trimLen

public static java.lang.String trimLen(java.lang.String s,
                                       int len)

format

public static java.lang.String format(java.lang.String label,
                                      float f)

format

public static java.lang.String format(java.lang.String label,
                                      java.lang.String val,
                                      int labelWidth,
                                      int valWidth)

formatLine

public static java.lang.String formatLine(java.lang.String s1,
                                          float f1,
                                          java.lang.String s2,
                                          float f2,
                                          java.lang.String s3,
                                          float f3,
                                          java.lang.String s4,
                                          float f4,
                                          java.lang.String s5,
                                          float f5)

printHeader

public void printHeader()

printHeader

public void printHeader(java.io.PrintWriter out)

main

public static void main(java.lang.String[] args)
just for testing. Reads the filename given as the argument, writes out some header variables and then writes it back out as "outsacfile".