Thread: SAC Macro Help to Kick Out EQs of certain epicentral distances

Started: 2015-01-17 01:35:33
Last activity: 2015-01-17 18:22:00
Topics: SAC Help
Hello,

I was wondering if anyone could help me with writing a SAC macro that reads in multiple event files, and deletes any events that are beyond a certain epicentral distance away from the station.

I have events with epicentral distances from 30-90 degrees; however, I want to kick out any events with epicentral distances greater than 85 degrees.

Is there a way in SAC to kick out those events from 85-90 degrees that I don’t want?

I have checked the SAC header files, and the DIST functions are measured in km, and if I’m correct, that’s the value in the header that I want to look at.

Any ideas?

Thank you,

Greg

  • Dear Greg -

    The header variable GCARC is the distance in degrees.

    A strategy to process files is to write a macro (called, say, CHECK) to process ONE file, and then write another macro that invokes that macro for each file. E.g.

    ls *.BHZ | awk ‘{print “MACRO CHECK”,$1}’ > /tmp/sac.in
    cat << ‘EOF’ > CHECK
    READ $1$
    IF &1,GCARC LE 85
    SC echo Keep $1$
    ELSE
    SC echo Ignore $1$
    ENDIF
    EOF

    sac
    SAC> macro /tmp/sac.in



    SAC> quit

    See chapter 5 of the SAC book for more examples and ideas about writing strategies.

    On 17 Jan 2015, at 08:35, Greg Brenn <grbrenn<at>crimson.ua.edu> wrote:

    Hello,

    I was wondering if anyone could help me with writing a SAC macro that reads in multiple event files, and deletes any events that are beyond a certain epicentral distance away from the station.

    I have events with epicentral distances from 30-90 degrees; however, I want to kick out any events with epicentral distances greater than 85 degrees.

    Is there a way in SAC to kick out those events from 85-90 degrees that I don’t want?

    I have checked the SAC header files, and the DIST functions are measured in km, and if I’m correct, that’s the value in the header that I want to look at.

    Any ideas?

    Thank you,

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



    George Helffrich
    george.helffrich<at>bris.ac.uk



21:19:56 v.01697673