Thread: problem with running macro file

Started: 2019-04-28 12:46:52
Last activity: 2019-04-29 18:40:52
Topics: SAC Help
Mochammad Husni Rizal
2019-04-28 12:46:52
Hello everyone,

I need to constantly go to the same directories over and over again. For that, I try to implement the macros command. However, as I save a macro file like the one below

** macro for plotting explosion 12h00 15 november 2015
cd /Users/rizal/Google-Drive/Stage-M1/data_IBU/Seismic_Antenna/SAC/201611/ —> this is the folder that I’m pointing to
r 20161115_1200_IBUA1z.sac 20161115_1200_IBUA4z.sac 20161115_1200_IBUA5z.sac 20161115_1200_IBUA6z.sac
bp bu c 0.5 5 n 2
cd /Users/rizal/Google-Drive/Stage-M1/data_IBU/Multiparameter/2016-11-15/
qdp off
p1 relative

after using command: setmacro /dir/to/mymacro/ where this macro file is saved and then running command macro mymacro.txt, I got the following error

ERROR 1301: No data files read in.
ERROR 1301: No data files read in.
ERROR 1016: Terminating execution of macro /Users/rizal/Google-Drive/Stage-M1/data_IBU//events_20161115_1200
Command line is: bp bu c 0.5 5 n 2

Is this due to the fact that SAC does not accept bash command? Where do I get it wrong here?

Any help is appreciated for beginner in SAC.

Cheers,
Rizal
Master 1 - Solid Earth Geophysics
IPGP



  • Milton Plasencia
    2019-04-29 18:40:52
    Rizal,

    To begin please, add sc (System Command) prior to command cd....

    so;

    **macro..
    sc cd /Users....

    HTH,

    Milton




    ----------------------------
    Milton Plasencia
    mplasencia<at>inogs.it



    On Mon, Apr 29, 2019 at 6:00 PM Mochammad Husni Rizal <mochusnir<at>gmail.com>
    wrote:

    Hello everyone,

    I need to constantly go to the same directories over and over again. For
    that, I try to implement the macros command. However, as I save a macro
    file like the one below

    ** macro for plotting explosion 12h00 15 november 2015
    cd /Users/rizal/Google-Drive/Stage-M1/data_IBU/Seismic_Antenna/SAC/201611/
    —> *this is the folder that I’m pointing to*
    r 20161115_1200_IBUA1z.sac 20161115_1200_IBUA4z.sac
    20161115_1200_IBUA5z.sac 20161115_1200_IBUA6z.sac
    bp bu c 0.5 5 n 2
    cd /Users/rizal/Google-Drive/Stage-M1/data_IBU/Multiparameter/2016-11-15/
    qdp off
    p1 relative

    after using command: *setmacro /dir/to/mymacro/* where this macro file is
    saved and then running command *macro mymacro.txt*, I got the following
    error

    ERROR 1301: No data files read in.
    ERROR 1301: No data files read in.
    ERROR 1016: Terminating execution of macro
    /Users/rizal/Google-Drive/Stage-M1/data_IBU//events_20161115_1200
    Command line is: bp bu c 0.5 5 n 2

    Is this due to the fact that SAC does not accept bash command? Where do I
    get it wrong here?

    Any help is appreciated for beginner in SAC.

    Cheers,
    Rizal
    Master 1 - Solid Earth Geophysics
    IPGP



    ----------------------
    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/


    • George Helffrich
      2019-04-29 18:12:09
      Dear All -

      A few years ago I wrote a long answer to a similar question on why the Unix “cd” command *NEVER* works right with SAC. Is there a way to search the archives to find that answer and provide a pointer to it to this new question? (Everybody faces this issue once in their SAC user career; I would suggest a link to it be provided for every new subscriber to sac-help.)

      On 29 Apr 2019, at 17:41, Milton Plasencia <mpplasencia<at>gmail.com> wrote:

      Rizal,

      To begin please, add sc (System Command) prior to command cd....

      so;

      **macro..
      sc cd /Users....

      HTH,

      Milton




      ----------------------------
      Milton Plasencia
      mplasencia<at>inogs.it <mplasencia<at>inogs.it>



      On Mon, Apr 29, 2019 at 6:00 PM Mochammad Husni Rizal <mochusnir<at>gmail.com <mochusnir<at>gmail.com>> wrote:
      Hello everyone,

      I need to constantly go to the same directories over and over again. For that, I try to implement the macros command. However, as I save a macro file like the one below

      ** macro for plotting explosion 12h00 15 november 2015
      cd /Users/rizal/Google-Drive/Stage-M1/data_IBU/Seismic_Antenna/SAC/201611/ —> this is the folder that I’m pointing to
      r 20161115_1200_IBUA1z.sac 20161115_1200_IBUA4z.sac 20161115_1200_IBUA5z.sac 20161115_1200_IBUA6z.sac
      bp bu c 0.5 5 n 2
      cd /Users/rizal/Google-Drive/Stage-M1/data_IBU/Multiparameter/2016-11-15/
      qdp off
      p1 relative

      after using command: setmacro /dir/to/mymacro/ where this macro file is saved and then running command macro mymacro.txt, I got the following error

      ERROR 1301: No data files read in.
      ERROR 1301: No data files read in.
      ERROR 1016: Terminating execution of macro /Users/rizal/Google-Drive/Stage-M1/data_IBU//events_20161115_1200
      Command line is: bp bu c 0.5 5 n 2

      Is this due to the fact that SAC does not accept bash command? Where do I get it wrong here?

      Any help is appreciated for beginner in SAC.

      Cheers,
      Rizal
      Master 1 - Solid Earth Geophysics
      IPGP



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

      ----------------------
      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/



      George Helffrich
      george<at>elsi.jp


21:31:19 v.22510d55