[SAC-HELP] Cut command

andreas wessel awbochum at gmail.com
Mon Nov 13 16:44:57 PST 2006


Hi Talal,

you could create a shellscript that runs your cutting macro for every
sac-file in the current directory:
I used that to byteswap a lot of files at once:

for j in $*
do
fn=$j
echo sac_starts_here %%%%%%%%%%%%%%%%
/usr/local/bin/sac /macro/macro.m $fn
done
exit 0

You have to adjust the pathes to point to your sac binary and to the macro
you want to use.
The macro looks like this:

r $1
"some other commands"
q


If you execute the shellscript with
"script.sh *.SAC"
the for loop will cycle through all the .SAC files, read every single one in
sac and then execute the commands in the macro.
You still would have to figure out a way to calculate the parameters for
every file, but this depends on what you want.

ciao,
Andreas




On 11/14/06, Talal Merghelani <talalmg1 at yahoo.com> wrote:
>
> Hi all
>
> i wanna use cut command for many files( 40~60 files) to cut S-wave(usually
> 3-5sec time window), for each file they have their own values for cut
> parameters(depend on S-wave).
>
> i have reviewed the sac manual for cut command. but, there is no such way
> to select the command cut values indepently for each file..?
>
> its time consuming doing this manaully...!!
>
> there is any systematic way for doing this by writing a macros command
> file..?
>
> of course i care about the result quality. mean, should be the time that i
> wanna to cut it exaclty..!!
>
> any idea any help..!! please, attached with an example..
>
> thank you in advance
> Talal
>
> P.S. the input is in *.SAC file and the output is *.TXT file.
>
> ------------------------------
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.iris.washington.edu/pipermail/sac-help/attachments/20061114/b953fb91/attachment.html>


More information about the sac-help mailing list