NAME

Perlsac::rwsac - a module to read and write SAC file.

DESCRIPTION

This is the module for reading and writing the sac file, defined at 'http://ds.iris.edu/files/sac-manual/manual/file_format.html'

AUTHOR

Hobin Lim

LICENSE

MIT

INSTALLATION

Using cpan:

$ cpan install Perlsac::rwsac

Manual install:

$ perl Makefile.PL
$ make
$ make install

TUTORIAL

Printing out time and data.

$ #!/usr/bin/env perl
$ 
$ use strict ;
$ use warnings ;
$ use Perlsac::rwsac ;
$ 
$ my %h = Perlsac::rwsac::rsac("example.sac") ;
$ 
$ for (my $n=0; $n<$h{npts}; $n++){
$     print "$h{t}[$n] $h{d}[$n]\n" ;
$ }
$ 

Dividing data by 'depmax' in headers and writing a new sac file.

$ #!/usr/bin/env perl
$ 
$ use strict ;
$ use warnings ;
$ use Perlsac::rwsac ;
$ 
$ my %h = Perlsac::rwsac::rsac("example.sac") ;
$ 
$ for (my $n=0; $n<$h{npts}; $n++){
$     $h{d}[$n] /= $h{depmax} ;
$ }
$ 
$ &Perlsac::rwsac::wsac("example.sac.div",%h) ;