Thread: 3 questions

Started: 2006-11-30 03:51:07
Last activity: 2006-11-30 23:32:25
Topics: SAC Help
Geo .
2006-11-30 03:51:07
Greetings,

I have 3 questions today !

1) I have the following piece of script that I use to mark t0 on the
seismogram

r 1 2 3
ppk --->(I mark t0 using the cursor)
setbb t0 &1, t0 &2, t0 &3
r 1 2 3
ch t0 %t0
w over

say I have 500 seismograms, how do I replace " setbb t0 &1, t0 &2, t0 &3 "
so that I can mark t0 all together?

2) If I have again a bunch of seismograms that I need to seperate according
to distance how do I do that? is there a script that I can use to do this?

3) How can I make an ASCII file (2-column, time and amplitude) from a sac
file that I down load from IRIS?

Thank you ..!

Januka.

On 11/23/06, sac-help-request<at>iris.washington.edu <
sac-help-request<at>iris.washington.edu> wrote:

Send sac-help mailing list submissions to
sac-help<at>iris.washington.edu

To subscribe or unsubscribe via the World Wide Web, visit
http://www.iris.washington.edu/mailman/listinfo/sac-help
or, via email, send a message with subject or body 'help' to
sac-help-request<at>iris.washington.edu

You can reach the person managing the list at
sac-help-owner<at>iris.washington.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of sac-help digest..."


Today's Topics:

1. naming files (Januka Attanayake)
2. Re: naming files (andreas wessel)


----------------------------------------------------------------------

Message: 1
Date: Thu, 23 Nov 2006 00:31:15 -0500
From: "Januka Attanayake" <jattanayake<at>gmail.com>
Subject: [SAC-HELP] naming files
To: sac-help<at>iris.washington.edu
Message-ID:
<984f6f900611222131s12305e84mbc738dddf0ed8c7d<at>mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Greetings,
I have a question regarding naming files. Assume that I have a sac file by
the name
2006.300.33.SDMD.BHZ.R.SAC
say, If I want to extract only the 2006.300.33.SDMD part for naming
purposes
after I do certain calculations on it, how do I do it?
would something like this work?

set bb name $1$.$STATION$ ?
w %name.z

It didn't so far for me?
Would like to hear any suggestions from any one out there....

Thank you.

Januka

On 11/14/06, sac-help-request<at>iris.washington.edu <
sac-help-request<at>iris.washington.edu> wrote:

Send sac-help mailing list submissions to
sac-help<at>iris.washington.edu

To subscribe or unsubscribe via the World Wide Web, visit
http://www.iris.washington.edu/mailman/listinfo/sac-help
or, via email, send a message with subject or body 'help' to
sac-help-request<at>iris.washington.edu

You can reach the person managing the list at
sac-help-owner<at>iris.washington.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of sac-help digest..."


Today's Topics:

1. Re: Cut command (andreas wessel)


----------------------------------------------------------------------

Message: 1
Date: Tue, 14 Nov 2006 13:44:57 +1300
From: "andreas wessel" <awbochum<at>gmail.com>
Subject: Re: [SAC-HELP] Cut command
To: "Talal Merghelani" <talalmg1<at>yahoo.com>
Cc: SAC HELP <sac-help<at>iris.washington.edu>
Message-ID:
<2afddd310611131644k148e9719x21a328c850048ca8<at>mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

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/20061113/b953fb91/attachment-0001.html

------------------------------

_______________________________________________
sac-help mailing list
sac-help<at>iris.washington.edu
http://www.iris.washington.edu/mailman/listinfo/sac-help


End of sac-help Digest, Vol 17, Issue 9
***************************************




--
"Nothing can start to exist nor can cease to exist, only transformation is
possible"

Januka Attanayake
Center for Integrative Geosciences - Solid Earth Geophysics
University of Connecticut
Beach Hall U-2045
354,Mansfield Rd;
Storrs.CT 06269

Tel: 1 860 486 0475
http://www.geocities.com/jattanayake
http://earth.uconn.edu/
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.iris.washington.edu/pipermail/sac-help/attachments/20061122/f2e73296/attachment-0001.html

------------------------------

Message: 2
Date: Thu, 23 Nov 2006 18:47:04 +1300
From: "andreas wessel" <awbochum<at>gmail.com>
Subject: Re: [SAC-HELP] naming files
To: sac-help<at>iris.washington.edu
Message-ID:
<2afddd310611222147m95030aak7d68f61efa8c5891<at>mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hi there,

I think you have just a typing error.

- setbb goes together, without a space..
- to take a variable and append something, you have to put the delimiter
at
the end of the name of the var, just as you did with the $

setbb name 1234
sc echo %name%567

You didn't post what error msg you get, but I think it is "Could not find
VARS variable blackboard", because Sac is looking for a variable "name.z"
instead of "name"

good luck
andreas

On 11/23/06, Januka Attanayake <jattanayake<at>gmail.com> wrote:

2006.300.33.SDMD.BHZ.R.SAC

I want to extract only the 2006.300.33.SDMD part for naming purposes after
I
do certain calculations on it

set bb name $1$.$STATION$ ?
w %name.z


-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://www.iris.washington.edu/pipermail/sac-help/attachments/20061122/cdc42f96/attachment-0001.html

------------------------------

_______________________________________________
sac-help mailing list
sac-help<at>iris.washington.edu
http://www.iris.washington.edu/mailman/listinfo/sac-help


End of sac-help Digest, Vol 17, Issue 12
****************************************




--
"Nothing can start to exist nor can cease to exist, only transformation is
possible"

Januka Attanayake
Center for Integrative Geosciences - Earthquake Seismology
University of Connecticut
Beach Hall U-2045
354,Mansfield Rd;
Storrs.CT 06269

Tel: 1 860 486 0475
http://www.geocities.com/jattanayake
http://earth.uconn.edu/

  • Michael Thorne
    2006-11-29 23:57:44
    Hi Januka, you can use my 'sac2xy' program to quickly turn the
    time,amplitude from a SAC file into a ascii file. the program doesn't
    need to open up sac. at the command prompt you just need to type:
    sac2xy name_of_sacfile name_of_outputfile

    you can grab the program from:
    http://www.aeic.alaska.edu/input/mthorne/software/index.html


    On Wed, 29 Nov 2006, Januka Attanayake wrote:

    Greetings,

    I have 3 questions today !

    1) I have the following piece of script that I use to mark t0 on the
    seismogram

    r 1 2 3
    ppk --->(I mark t0 using the cursor)
    setbb t0 &1, t0 &2, t0 &3
    r 1 2 3
    ch t0 %t0
    w over

    say I have 500 seismograms, how do I replace " setbb t0 &1, t0 &2, t0 &3 "
    so that I can mark t0 all together?

    2) If I have again a bunch of seismograms that I need to seperate according
    to distance how do I do that? is there a script that I can use to do this?

    3) How can I make an ASCII file (2-column, time and amplitude) from a sac
    file that I down load from IRIS?

    Thank you ..!

    Januka.

    On 11/23/06, sac-help-request<at>iris.washington.edu <
    sac-help-request<at>iris.washington.edu> wrote:

    Send sac-help mailing list submissions to
    sac-help<at>iris.washington.edu

    To subscribe or unsubscribe via the World Wide Web, visit
    http://www.iris.washington.edu/mailman/listinfo/sac-help
    or, via email, send a message with subject or body 'help' to
    sac-help-request<at>iris.washington.edu

    You can reach the person managing the list at
    sac-help-owner<at>iris.washington.edu

    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of sac-help digest..."


    Today's Topics:

    1. naming files (Januka Attanayake)
    2. Re: naming files (andreas wessel)


    ----------------------------------------------------------------------

    Message: 1
    Date: Thu, 23 Nov 2006 00:31:15 -0500
    From: "Januka Attanayake" <jattanayake<at>gmail.com>
    Subject: [SAC-HELP] naming files
    To: sac-help<at>iris.washington.edu
    Message-ID:
    <984f6f900611222131s12305e84mbc738dddf0ed8c7d<at>mail.gmail.com>
    Content-Type: text/plain; charset="iso-8859-1"

    Greetings,
    I have a question regarding naming files. Assume that I have a sac file by
    the name
    2006.300.33.SDMD.BHZ.R.SAC
    say, If I want to extract only the 2006.300.33.SDMD part for naming
    purposes
    after I do certain calculations on it, how do I do it?
    would something like this work?

    set bb name $1$.$STATION$ ?
    w %name.z

    It didn't so far for me?
    Would like to hear any suggestions from any one out there....

    Thank you.

    Januka

    On 11/14/06, sac-help-request<at>iris.washington.edu <
    sac-help-request<at>iris.washington.edu> wrote:

    Send sac-help mailing list submissions to
    sac-help<at>iris.washington.edu

    To subscribe or unsubscribe via the World Wide Web, visit
    http://www.iris.washington.edu/mailman/listinfo/sac-help
    or, via email, send a message with subject or body 'help' to
    sac-help-request<at>iris.washington.edu

    You can reach the person managing the list at
    sac-help-owner<at>iris.washington.edu

    When replying, please edit your Subject line so it is more specific
    than "Re: Contents of sac-help digest..."


    Today's Topics:

    1. Re: Cut command (andreas wessel)


    ----------------------------------------------------------------------

    Message: 1
    Date: Tue, 14 Nov 2006 13:44:57 +1300
    From: "andreas wessel" <awbochum<at>gmail.com>
    Subject: Re: [SAC-HELP] Cut command
    To: "Talal Merghelani" <talalmg1<at>yahoo.com>
    Cc: SAC HELP <sac-help<at>iris.washington.edu>
    Message-ID:
    <2afddd310611131644k148e9719x21a328c850048ca8<at>mail.gmail.com>
    Content-Type: text/plain; charset="iso-8859-1"

    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/20061113/b953fb91/attachment-0001.html

    ------------------------------

    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


    End of sac-help Digest, Vol 17, Issue 9
    ***************************************




    --
    "Nothing can start to exist nor can cease to exist, only transformation is
    possible"

    Januka Attanayake
    Center for Integrative Geosciences - Solid Earth Geophysics
    University of Connecticut
    Beach Hall U-2045
    354,Mansfield Rd;
    Storrs.CT 06269

    Tel: 1 860 486 0475
    http://www.geocities.com/jattanayake
    http://earth.uconn.edu/
    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL:
    http://www.iris.washington.edu/pipermail/sac-help/attachments/20061122/f2e73296/attachment-0001.html

    ------------------------------

    Message: 2
    Date: Thu, 23 Nov 2006 18:47:04 +1300
    From: "andreas wessel" <awbochum<at>gmail.com>
    Subject: Re: [SAC-HELP] naming files
    To: sac-help<at>iris.washington.edu
    Message-ID:
    <2afddd310611222147m95030aak7d68f61efa8c5891<at>mail.gmail.com>
    Content-Type: text/plain; charset="iso-8859-1"

    Hi there,

    I think you have just a typing error.

    - setbb goes together, without a space..
    - to take a variable and append something, you have to put the delimiter
    at
    the end of the name of the var, just as you did with the $

    setbb name 1234
    sc echo %name%567

    You didn't post what error msg you get, but I think it is "Could not find
    VARS variable blackboard", because Sac is looking for a variable "name.z"
    instead of "name"

    good luck
    andreas

    On 11/23/06, Januka Attanayake <jattanayake<at>gmail.com> wrote:

    2006.300.33.SDMD.BHZ.R.SAC

    I want to extract only the 2006.300.33.SDMD part for naming purposes after
    I
    do certain calculations on it

    set bb name $1$.$STATION$ ?
    w %name.z


    -------------- next part --------------
    An HTML attachment was scrubbed...
    URL:
    http://www.iris.washington.edu/pipermail/sac-help/attachments/20061122/cdc42f96/attachment-0001.html

    ------------------------------

    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


    End of sac-help Digest, Vol 17, Issue 12
    ****************************************




    --
    "Nothing can start to exist nor can cease to exist, only transformation is
    possible"

    Januka Attanayake
    Center for Integrative Geosciences - Earthquake Seismology
    University of Connecticut
    Beach Hall U-2045
    354,Mansfield Rd;
    Storrs.CT 06269

    Tel: 1 860 486 0475
    http://www.geocities.com/jattanayake
    http://earth.uconn.edu/


    :-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:
    Michael Thorne
    Post Doctoral Research Fellow
    Geophysical Institute
    University of Alaska Fairbanks
    903 Koyukuk Drive
    P.O. Box 757320
    Fairbanks, AK 99775-7320

    phone: (907) 474-1882
    email: mthorne<at>gi.alaska.edu
    web: http://giseis.alaska.edu/input/mthorne
    :-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:-----:

  • andreas wessel
    2006-11-30 23:32:25
    Hi there,

    for the first problem I would try to write a script that edits just one file
    at a time. Then one could run that script in a for loop for all files..

    something like
    for j in *.sac; do
    "script" $j
    done

    or something similar..


    ps: can you please not send 2.5 kilometers of old text with your mails :)

    On 11/30/06, Januka Attanayake <jattanayake<at>gmail.com> wrote:

    Greetings,

    I have 3 questions today !

    1) I have the following piece of script that I use to mark t0 on the
    seismogram

    r 1 2 3
    ppk --->(I mark t0 using the cursor)
    setbb t0 &1, t0 &2, t0 &3
    r 1 2 3
    ch t0 %t0
    w over

    say I have 500 seismograms, how do I replace " setbb t0 &1, t0 &2, t0 &3 "
    so that I can mark t0 all together?

    2) If I have again a bunch of seismograms that I need to seperate
    according to distance how do I do that? is there a script that I can use to
    do this?

    3) How can I make an ASCII file (2-column, time and amplitude) from a sac
    file that I down load from IRIS?

    Thank you ..!

    Januka.


20:30:22 v.22510d55