Thread: problem with rsac1f.f

Started: 2020-04-13 14:52:08
Last activity: 2020-05-02 03:10:41
Topics: SAC Help
mohammad enayat
2020-04-13 14:52:08
Hi
I am using sac version 101.4
I compiled rsac1f.f in the example folder of the sac and I got no error
messages but when I try to read any sac file it returns this error message:
Error reading in file: IR.ABH1..SHZ.D.2015.166.124218.SAC
I am using fedora 27 on 64 bit.
how can I trace errors?

  • Leigh House
    2020-04-14 10:13:06
    Mohammad,
    There are many possible problems here. You do not provide much information to limit these possibilities.

    I suggest that you download and install the latest version of sac, which is 101.6a. Doing this may also solve the problem you describe.

    1) Can you read this file in sac itself? If yes, there is a problem with your program. You need to debug this.

    2) Generate a test file from your version of sac. In sac, use the sac command funcgen to create a test file. Then try to read this test file with your program. Does that work? If yes, your program works. If it doesn’t, you have to a problem with your program and how it was compiled. You need to debug this. Again, you need to do this, and it will be specific to your system.

    A simple problem that one sometimes runs into with sac files is way the information is actually stored in a file. This is called byte-ordering. The current version of sac can work with this for you. In older versions, users had to handle byte ordering themselves. In the directory bin of your sac directory, you should have a program called sacswap that may interchange (swap) the byte ordering.

    You can read the sac manual for more information about byte ordering and sac itself.

    Leigh

    On Apr 14, 2020, at 9:24 AM, mohammad enayat (via IRIS) <sac-help<at>lists.ds.iris.edu> wrote:

    Hi
    I am using sac version 101.4
    I compiled rsac1f.f in the example folder of the sac and I got no error messages but when I try to read any sac file it returns this error message:
    Error reading in file: IR.ABH1..SHZ.D.2015.166.124218.SAC
    I am using fedora 27 on 64 bit.
    how can I trace errors?

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



  • Milton Plasencia
    2020-04-14 17:35:33
    Hi,

    rsac1.f read file that contains yarray and not sac binary as your case with the file .SAC

    HTH,

    Milton



    * * * * * * * * * * * * * * * * * * * * * * *
    Milton P. PLASENCIA LINARES

    Centro di Ricerche Sismologiche (CRS)
    Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS

    Borgo Grotta Gigante 42/C
    (34010) Sgonico - Trieste - Italia
    Tel: +39 040 2140 156 (Udine)
    Tel: +39 040 2140 256 (Trieste)
    Cel.: +39 331 6481 935

    E-mail: mplasencia<at>inogs.it

    ASAIN (Antarctic Seismographic Argentinean Italian Network)
    *********************************

    On 14 Apr 2020, at 17:24, mohammad enayat (via IRIS) <sac-help<at>lists.ds.iris.edu> wrote:

    rsac1f.f


    • mohammad enayat
      2020-04-17 10:42:58
      Dear Milton

      Thanks for your attention. What do you mean yarray not .sac file?
      I have some .gcf files and I convert them with gcf2sac tool but this tool
      fills the gaps with a large value and I want to use this subroutine in
      Fortran to edit these values.
      So you say that I can not use it this way?

      Best regards
      Mohmmad,


      On Thu, Apr 16, 2020 at 10:03 PM Milton Plasencia (via IRIS) <
      sac-help<at>lists.ds.iris.edu> wrote:

      Hi,

      rsac1.f read file that contains yarray and not sac binary as your case
      with the file .SAC

      HTH,

      Milton



      * * * * * * * * * * * * * * * * * * * * * * *
      Milton P. PLASENCIA LINARES

      Centro di Ricerche Sismologiche (CRS)
      Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS

      Borgo Grotta Gigante 42/C
      (34010) Sgonico - Trieste - Italia
      Tel: +39 040 2140 156 (Udine)
      Tel: +39 040 2140 256 (Trieste)
      Cel.: +39 331 6481 935

      E-mail: mplasencia<at>inogs.it <mplasencia<at>inogs.it>

      ASAIN (Antarctic Seismographic Argentinean Italian Network)
      *********************************

      On 14 Apr 2020, at 17:24, mohammad enayat (via IRIS) <
      sac-help<at>lists.ds.iris.edu> wrote:

      rsac1f.f



      ----------------------
      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
        2020-04-17 07:34:21
        Dear Mohammad -

        If you want to read and edit GCF files for later analysis with SAC, SAC/BRIS (the version described in the SAC book) will read GCF files directly with SAC’s READ command. You can do the editing/deglitching work in SAC itself or write it out as a SAC file to use with your own programs. (You will have to build SAC from source code for your particular system, however, because there are no pre-built binaries for it.)

        On 17 Apr 2020, at 07:13, mohammad enayat (via IRIS) <sac-help<at>lists.ds.iris.edu> wrote:

        Dear Milton

        Thanks for your attention. What do you mean yarray not .sac file?
        I have some .gcf files and I convert them with gcf2sac tool but this tool fills the gaps with a large value and I want to use this subroutine in Fortran to edit these values.
        So you say that I can not use it this way?

        Best regards
        Mohmmad,


        On Thu, Apr 16, 2020 at 10:03 PM Milton Plasencia (via IRIS) <sac-help<at>lists.ds.iris.edu <sac-help<at>lists.ds.iris.edu>> wrote:
        Hi,

        rsac1.f read file that contains yarray and not sac binary as your case with the file .SAC

        HTH,

        Milton



        * * * * * * * * * * * * * * * * * * * * * * *
        Milton P. PLASENCIA LINARES

        Centro di Ricerche Sismologiche (CRS)
        Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS

        Borgo Grotta Gigante 42/C
        (34010) Sgonico - Trieste - Italia
        Tel: +39 040 2140 156 (Udine)
        Tel: +39 040 2140 256 (Trieste)
        Cel.: +39 331 6481 935

        E-mail: mplasencia<at>inogs.it <mplasencia<at>inogs.it>

        ASAIN (Antarctic Seismographic Argentinean Italian Network)
        *********************************

        On 14 Apr 2020, at 17:24, mohammad enayat (via IRIS) <sac-help<at>lists.ds.iris.edu <sac-help<at>lists.ds.iris.edu>> wrote:

        rsac1f.f


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


        • mohammad enayat
          2020-04-29 07:40:55
          Dear Helffrich

          Thanks for your nice help. But I found an easier solution in my case I just
          read the array by a Fortran program and find the gap's start and end time
          and after that, I cut the original sac file by sac's cut command. Of
          course, your solution is better but I don't have access to the earlier
          version of the sac because of President Trump.

          Best regards,
          Mohammad

          On Fri, Apr 17, 2020 at 11:09 AM George Helffrich (via IRIS) <
          sac-help<at>lists.ds.iris.edu> wrote:

          Dear Mohammad -

          If you want to read and edit GCF files for later analysis with SAC,
          SAC/BRIS (the version described in the SAC book) will read GCF files
          directly with SAC’s READ command. You can do the editing/deglitching work
          in SAC itself or write it out as a SAC file to use with your own programs.
          (You will have to build SAC from source code for your particular system,
          however, because there are no pre-built binaries for it.)

          On 17 Apr 2020, at 07:13, mohammad enayat (via IRIS) <
          sac-help<at>lists.ds.iris.edu> wrote:

          Dear Milton

          Thanks for your attention. What do you mean yarray not .sac file?
          I have some .gcf files and I convert them with gcf2sac tool but this tool
          fills the gaps with a large value and I want to use this subroutine in
          Fortran to edit these values.
          So you say that I can not use it this way?

          Best regards
          Mohmmad,


          On Thu, Apr 16, 2020 at 10:03 PM Milton Plasencia (via IRIS) <
          sac-help<at>lists.ds.iris.edu> wrote:

          Hi,

          rsac1.f read file that contains yarray and not sac binary as your case
          with the file .SAC

          HTH,

          Milton



          * * * * * * * * * * * * * * * * * * * * * * *
          Milton P. PLASENCIA LINARES

          Centro di Ricerche Sismologiche (CRS)
          Istituto Nazionale di Oceanografia e di Geofisica Sperimentale - OGS

          Borgo Grotta Gigante 42/C
          (34010) Sgonico - Trieste - Italia
          Tel: +39 040 2140 156 (Udine)
          Tel: +39 040 2140 256 (Trieste)
          Cel.: +39 331 6481 935

          E-mail: mplasencia<at>inogs.it <mplasencia<at>inogs.it>

          ASAIN (Antarctic Seismographic Argentinean Italian Network)
          *********************************

          On 14 Apr 2020, at 17:24, mohammad enayat (via IRIS) <
          sac-help<at>lists.ds.iris.edu> wrote:

          rsac1f.f



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


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


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


  • Waddah Mahmoud
    2020-04-28 20:46:03
    Dear mohammad
    can you please assist me how to compile rsca1.f and rsac1.c , i tried many trials and couldn't compile it.
    please provide me with details, I am using 101.6a (iris sac version) and ubuntu 16.4 64 bit.
    Regards
    Wadah
    • mohammad enayat
      2020-04-29 07:28:09
      Dear Mahmoud

      I didn't compile rsac1.c but for compiling Fortran version you just need to
      give compiler sac configs in this way: gfortran rsac1.f `sac-config
      --cflags --libs sacio`
      as mentioned in the sac manual but there is one thing more that you have to
      do that is unfortunately not mentioned there.
      Before compiling you have to edit "sacinit.sh" (or "sacinit.csh" if you use
      csh) in SAC/bin directory and set the "export SACHOME=" variable correctly.
      Please let me know if this fixes your problem.

      Ghorban you,

      Mohammad

      On Wed, Apr 29, 2020 at 1:20 AM Waddah Mahmoud (via IRIS) <
      sac-help<at>lists.ds.iris.edu> wrote:

      Dear mohammad
      can you please assist me how to compile rsca1.f and rsac1.c , i tried many
      trials and couldn't compile it.
      please provide me with details, I am using 101.6a (iris sac version) and
      ubuntu 16.4 64 bit.
      Regards
      Wadah

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


      • Waddah Mahmoud
        2020-04-29 22:01:41
        Thank you Mohammad for reply, I tried the ( gfortran rsac1.f `sac-config --cflags --libs sacio` ), but the result is :
        gfortran rsac1.f `sac-config --cflags --libs sacio`
        /usr/local/sac/bin/sac-config: 3: /usr/local/sac/bin/sac-config: function: not found
        /usr/local/sac/bin/sac-config: 7: /usr/local/sac/bin/sac-config: Syntax error: "}" unexpected
        gfortran: error: rsac1.f: No such file or directory

        and what do you mean by ( edit "sacinit.sh" )? sorry but I don't konw what to do.

        REGARDS
        WADAH
        • mohammad enayat
          2020-04-30 05:43:00
          Dear Waddah

          You can type "which sac " to see which directory sac is installed and then cd to its parent directory.
          In my case output of which sac is : /opt/seismo-util/SAC/bin/sac
          Then "cd /opt/seismo-util/SAC/bin"
          If you type "ls" command you should see file with name "sacinit.sh"
          you can use nano or vi commands to edit sacinit.sh.
          Look for the following 3 lines and set SACHOME‌ variable like this:

          export SACHOME=/opt/seismo-util/SAC
          export PATH=${PATH}:${SACHOME}/bin
          export SACAUX=${SACHOME}/aux

          Then save the file and compile rsac1.f again.
          If this doesn't fix your problem check your .bashrc file for sac pathing.
          In my case my .bashrc file has the following lines to path sac:

          export SACHOME=/opt/seismo-util/SAC
          export PATH=${PATH}:${SACHOME}/bin
          export SACAUX=${SACHOME}/aux
          export SAC_USE_DATABASE=0
          export SAC_PPK_LARGE_CROSSHAIRS=1
          export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SACHOME}/lib

          You just need to set your sac directory path to the first line. in my case it is /opt/seismo-util/SAC
          I hope this works for you too if does not please let me know

          Yours,

          Mohammad

          • Waddah Mahmoud
            2020-04-30 21:31:54
            Dear Mohammad
            I very sorry to disturb you again , I follow your instructions but unfortunately the same result, even when trying to compile codes provided in example folder by "make", the same errors appeared.
            I don't know what can I do now.

            Regards
            Wadah
            • mohammad enayat
              2020-05-01 06:02:44
              Dear Waddah

              No problem It would be my pleasure if I could help you to solve your problem.
              I have no idea about what is happening there. Maybe there is a syntax error in your sac-config file or your sac faced with a problem.
              So please try to compile again because after changing in .bashrc maybe you forgot to source it.
              After that, if it doesn't work try to move your sac folder to /usr/local/sac (and check for paths in .bashrc again). After that, if you write which sac in the terminal you should see /usr/local/sac/bin. Then try to modify sac-config file again as before and compile again.
              If you still face those errors send me your sac-config here or delete your sac and install again and better to install another version.
              My sac version is 101.4 maybe this version works for you too.

              Yours,
              Mohammad

            • mohammad enayat
              2020-05-01 06:17:28
              Dear Waddah

              I noticed something right now. Before doing anything (I mean according to my previous message) do one thing more. Go to sac/bin directory and open sac-config file and check that path in line 35 is correct or not. You should see a line starting with set_paths "/usr/local/sac" or something like this. Check that your path is correct.
              I hope this works.
              Good luck,

              Mohmmad,

              • Waddah Mahmoud
                2020-05-01 21:33:18
                Dear Mohammad
                Thank you for your patience and help, I appreciate very much.
                According to your notes;
                the sac folder is in " /usr/local/ " and I checked again the sac-config and .bashrc files and everything is set well to paths, as the following:
                * ~$which sac
                /usr/local/sac/bin/sac

                * in sac-config :
                line 35 : set_paths "/usr/local/sac"

                * in sacinit.sh :
                export SACHOME=/usr/local/sac
                export PATH=${PATH}:${SACHOME}/bin
                export SACAUX=${SACHOME}/aux

                * in .bashrc :
                ################ sac software ##########################
                export SACHOME=/usr/local/sac
                export PATH=${PATH}:${SACHOME}/bin
                export SACAUX=${SACHOME}/aux
                export SAC_USE_DATABASE=0
                export SAC_PPK_LARGE_CROSSHAIRS=1
                export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${SACHOME}/lib

                I tried again and the same as before.
                let me know If you have any idea or if you prefer we can contact by any way. Sorry again for confusing you.

                Best Regards
                Wadah
                • mohammad enayat
                  2020-05-02 03:10:41
                  Dear Waddah

                  I just sent you an e-mail. Please check it.

                  Thanks,
                  Mohammad
Page built 02:10:48 | v.b'108166