Thread: Need Help

Started: 2017-10-11 16:31:36
Last activity: 2017-10-11 16:31:36
Topics: SAC Help
Sachin Tiwari
2017-10-11 16:31:36
Hi Sac Users,



Can you please help me in listing all my SAC files in increasing order of
their back-azimuth values and assigning integer weights starting from “1”
to each file in their “user8” header? If there are 8 sac files then file
with minimum back-azimuth will have "1" weight in user8, while maximum
back-azimuth file will have "8" weight in its sac header.

Thanks


--
*Sachin Kumar *
*Junior Research Fellow (JRF)*
*Dept. of Applied Geophysics*
*Indian Institute of Technology (Indian School of Mines), Dhanbad*
*Jharkhand- 826004, India.*

*Mobile No.:+91-7631056163*
*Email : *
*sachinism15<at>gmail.com , <sachinism15<at>gmail.com> ismsachin<at>outlook.com
<sachinism15<at>gmail.com>*

  • Satish_iitb
    2017-10-11 04:23:34
    Hi Sachin,

    You can write small scripts.

    Something similar like this.

    write in sort_baz.sh file and run inside all sac file
    assume your sac file end with "*sac"*
    and run by *sh sort_baz.sh *
    #!!!!!!!!!!
    #!/bin/sh
    rm -rf baz.list
    for fname in *.*sac*
    do
    baz=`saclst BAZ f $fname | awk '{print $2}'`
    echo $fname $baz >>baz.list

    done
    cat listbaz. | sort -k2n | awk '{print NR,$1,$2}' | while read line
    do
    fln=`echo $line | awk '{print $2}'`
    num=`echo $line | awk '{print $1}'`
    sac<<!
    r $fln
    ch user8 $num
    wh
    q
    !
    done
    #!!!!!!!!!!



    Satish Maurya
    Post-Doc
    University of California, Berkeley
    Seismological Laboratory, Dept. of Earth & Planetary Science
    201 The Tower Room, McCone Hall
    Berkeley, CA 94720

    On Tue, Oct 10, 2017 at 9:02 PM, Sachin Tiwari <sachinism15<at>gmail.com>
    wrote:

    Hi Sac Users,



    Can you please help me in listing all my SAC files in increasing order of
    their back-azimuth values and assigning integer weights starting from “1”
    to each file in their “user8” header? If there are 8 sac files then file
    with minimum back-azimuth will have "1" weight in user8, while maximum
    back-azimuth file will have "8" weight in its sac header.

    Thanks


    --
    *Sachin Kumar *
    *Junior Research Fellow (JRF)*
    *Dept. of Applied Geophysics*
    *Indian Institute of Technology (Indian School of Mines), Dhanbad*
    *Jharkhand- 826004, India.*

    *Mobile No.:+91-7631056163 <+91%2076310%2056163>*
    *Email : *
    *sachinism15<at>gmail.com , <sachinism15<at>gmail.com> ismsachin<at>outlook.com
    <sachinism15<at>gmail.com>*


    ----------------------
    SAC Help
    Topic home: http://ds.iris.edu/message-center/topic/sac-help/ |
    Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

    Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/



21:01:12 v.22510d55