Thread: Merge command fail to work

Started: 2013-07-26 17:47:15
Last activity: 2013-07-27 02:56:12
Topics: SAC Help
youqiang yu
2013-07-26 17:47:15
To whom it may concern,

I have a question on the "merge" command. I have
two SAC files from the same station. The reason why
I want to merge them together is these two dataset have
some common data. So I want to merge them together
as one dataset. In other words, the ending time of the first
data file is after the beginning time of the second data file.

what I do is as follows:

read 1.sac
merge 2.sac
write over
quit

If successfully, 1.sac should include these two data. However,
when I read 1.sac again, nothing happens to this file. In addition,
there is no errors when I run the above merging command. Please
help me on this issue. Thanks.

best,
youqiang

--
Youqiang Yu
Geology & Geophysics Program
Department of Geological Science & Engineering
Missouri University of Science and Technology
Rolla, Mo, 65409
Email: yyqkc<at>mst.com
573.201.9437
相信自己,创造梦想

  • Milton Plasencia
    2013-07-27 01:19:12
    Hi,

    Instead write over
    use:
    write new_name_file

    HTH,

    Milton

    Milton P. Plasencia Linares
    mpplasencia<at>gmail.com



    On Jul 26, 2013, at 5:47 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

    To whom it may concern,

    I have a question on the "merge" command. I have
    two SAC files from the same station. The reason why
    I want to merge them together is these two dataset have
    some common data. So I want to merge them together
    as one dataset. In other words, the ending time of the first
    data file is after the beginning time of the second data file.

    what I do is as follows:

    read 1.sac
    merge 2.sac
    write over
    quit

    If successfully, 1.sac should include these two data. However,
    when I read 1.sac again, nothing happens to this file. In addition,
    there is no errors when I run the above merging command. Please
    help me on this issue. Thanks.

    best,
    youqiang

    --
    Youqiang Yu
    Geology & Geophysics Program
    Department of Geological Science & Engineering
    Missouri University of Science and Technology
    Rolla, Mo, 65409
    Email: yyqkc<at>mst.com
    573.201.9437
    相信自己,创造梦想
    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help


    • youqiang yu
      2013-07-26 19:45:53
      Hi, Milton,

      Thanks for the advice.

      However, when I wrote to a new file, the new file included only
      the first file's data. I use "cut" command to remove the overlapping
      part and it works. It seems "merge" command can not merge files
      whose data has overlapping part.

      best,
      youqiang

      On Fri, Jul 26, 2013 at 11:19 AM, Milton Plasencia <mpplasencia<at>gmail.com>wrote:

      Hi,

      Instead write over
      use:
      write new_name_file

      HTH,

      Milton

      Milton P. Plasencia Linares
      mpplasencia<at>gmail.com



      On Jul 26, 2013, at 5:47 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

      To whom it may concern,

      I have a question on the "merge" command. I have
      two SAC files from the same station. The reason why
      I want to merge them together is these two dataset have
      some common data. So I want to merge them together
      as one dataset. In other words, the ending time of the first
      data file is after the beginning time of the second data file.

      what I do is as follows:

      read 1.sac
      merge 2.sac
      write over
      quit

      If successfully, 1.sac should include these two data. However,
      when I read 1.sac again, nothing happens to this file. In addition,
      there is no errors when I run the above merging command. Please
      help me on this issue. Thanks.

      best,
      youqiang

      --
      Youqiang Yu
      Geology & Geophysics Program
      Department of Geological Science & Engineering
      Missouri University of Science and Technology
      Rolla, Mo, 65409
      Email: yyqkc<at>mst.com
      573.201.9437
      相信自己,创造梦想
      _______________________________________________
      sac-help mailing list
      sac-help<at>iris.washington.edu
      http://www.iris.washington.edu/mailman/listinfo/sac-help





      --
      Youqiang Yu
      Geology & Geophysics Program
      Department of Geological Science & Engineering
      Missouri University of Science and Technology
      Rolla, Mo, 65409
      Email: yyqkc<at>mst.com
      573.201.9437
      相信自己,创造梦想

      • Milton Plasencia
        2013-07-27 02:56:12

        Hi Youqiang,

        I recommend you see the "help merge"
        to see the merge behavior when find gaps
        and overlaps, and perhaps add to command
        merge the "verbose" option.

        cheers,

        Milton

        Milton P. Plasencia Linares
        mpplasencia<at>gmail.com



        On Jul 26, 2013, at 7:45 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

        Hi, Milton,

        Thanks for the advice.

        However, when I wrote to a new file, the new file included only
        the first file's data. I use "cut" command to remove the overlapping
        part and it works. It seems "merge" command can not merge files
        whose data has overlapping part.

        best,
        youqiang

        On Fri, Jul 26, 2013 at 11:19 AM, Milton Plasencia <mpplasencia<at>gmail.com> wrote:
        Hi,

        Instead write over
        use:
        write new_name_file

        HTH,

        Milton

        Milton P. Plasencia Linares
        mpplasencia<at>gmail.com



        On Jul 26, 2013, at 5:47 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

        To whom it may concern,

        I have a question on the "merge" command. I have
        two SAC files from the same station. The reason why
        I want to merge them together is these two dataset have
        some common data. So I want to merge them together
        as one dataset. In other words, the ending time of the first
        data file is after the beginning time of the second data file.

        what I do is as follows:

        read 1.sac
        merge 2.sac
        write over
        quit

        If successfully, 1.sac should include these two data. However,
        when I read 1.sac again, nothing happens to this file. In addition,
        there is no errors when I run the above merging command. Please
        help me on this issue. Thanks.

        best,
        youqiang

        --
        Youqiang Yu
        Geology & Geophysics Program
        Department of Geological Science & Engineering
        Missouri University of Science and Technology
        Rolla, Mo, 65409
        Email: yyqkc<at>mst.com
        573.201.9437
        相信自己,创造梦想
        _______________________________________________
        sac-help mailing list
        sac-help<at>iris.washington.edu
        http://www.iris.washington.edu/mailman/listinfo/sac-help




        --
        Youqiang Yu
        Geology & Geophysics Program
        Department of Geological Science & Engineering
        Missouri University of Science and Technology
        Rolla, Mo, 65409
        Email: yyqkc<at>mst.com
        573.201.9437
        相信自己,创造梦想


        • Brian Savage
          2013-07-26 21:29:19
          Yougiang,

          Which version of SAC are you using ?

          The merge command was rewritten as of version 101.6, recently released
          The latest version should be able to merge data similar to what you have. It will merge all data from memory and specified with the command.

          SAC> merge file1.sac file2.sac

          This should give you the merged file, provided it meets constraints about time sampling and amplitude values.

          Cheers
          Brian

          On Jul 26, 2013, at 1:56 PM, Milton Plasencia wrote:


          Hi Youqiang,

          I recommend you see the "help merge"
          to see the merge behavior when find gaps
          and overlaps, and perhaps add to command
          merge the "verbose" option.

          cheers,

          Milton

          Milton P. Plasencia Linares
          mpplasencia<at>gmail.com



          On Jul 26, 2013, at 7:45 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

          Hi, Milton,

          Thanks for the advice.

          However, when I wrote to a new file, the new file included only
          the first file's data. I use "cut" command to remove the overlapping
          part and it works. It seems "merge" command can not merge files
          whose data has overlapping part.

          best,
          youqiang

          On Fri, Jul 26, 2013 at 11:19 AM, Milton Plasencia <mpplasencia<at>gmail.com> wrote:
          Hi,

          Instead write over
          use:
          write new_name_file

          HTH,

          Milton

          Milton P. Plasencia Linares
          mpplasencia<at>gmail.com



          On Jul 26, 2013, at 5:47 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

          To whom it may concern,

          I have a question on the "merge" command. I have
          two SAC files from the same station. The reason why
          I want to merge them together is these two dataset have
          some common data. So I want to merge them together
          as one dataset. In other words, the ending time of the first
          data file is after the beginning time of the second data file.

          what I do is as follows:

          read 1.sac
          merge 2.sac
          write over
          quit

          If successfully, 1.sac should include these two data. However,
          when I read 1.sac again, nothing happens to this file. In addition,
          there is no errors when I run the above merging command. Please
          help me on this issue. Thanks.

          best,
          youqiang

          --
          Youqiang Yu
          Geology & Geophysics Program
          Department of Geological Science & Engineering
          Missouri University of Science and Technology
          Rolla, Mo, 65409
          Email: yyqkc<at>mst.com
          573.201.9437
          相信自己,创造梦想
          _______________________________________________
          sac-help mailing list
          sac-help<at>iris.washington.edu
          http://www.iris.washington.edu/mailman/listinfo/sac-help




          --
          Youqiang Yu
          Geology & Geophysics Program
          Department of Geological Science & Engineering
          Missouri University of Science and Technology
          Rolla, Mo, 65409
          Email: yyqkc<at>mst.com
          573.201.9437
          相信自己,创造梦想

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



          • youqiang yu
            2013-07-26 21:31:07
            Hi Brian,

            Thanks for your information. We have the old version of SAC, which may be
            the reason why merge command has no that many function. We will renew
            the SAC software and see whether it works or not. Have a good weekend.

            best,
            youqiang

            On Fri, Jul 26, 2013 at 1:29 PM, Brian Savage <savage<at>uri.edu> wrote:

            Yougiang,

            Which version of SAC are you using ?

            The merge command was rewritten as of version 101.6, recently released
            The latest version should be able to merge data similar to what you have.
            It will merge all data from memory and specified with the command.

            SAC> merge file1.sac file2.sac

            This should give you the merged file, provided it meets constraints about
            time sampling and amplitude values.

            Cheers
            Brian

            On Jul 26, 2013, at 1:56 PM, Milton Plasencia wrote:


            Hi Youqiang,

            I recommend you see the "help merge"
            to see the merge behavior when find gaps
            and overlaps, and perhaps add to command
            merge the "verbose" option.

            cheers,

            Milton

            Milton P. Plasencia Linares
            mpplasencia<at>gmail.com



            On Jul 26, 2013, at 7:45 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

            Hi, Milton,

            Thanks for the advice.

            However, when I wrote to a new file, the new file included only
            the first file's data. I use "cut" command to remove the overlapping
            part and it works. It seems "merge" command can not merge files
            whose data has overlapping part.

            best,
            youqiang

            On Fri, Jul 26, 2013 at 11:19 AM, Milton Plasencia <
            mpplasencia<at>gmail.com> wrote:
            Hi,

            Instead write over
            use:
            write new_name_file

            HTH,

            Milton

            Milton P. Plasencia Linares
            mpplasencia<at>gmail.com



            On Jul 26, 2013, at 5:47 PM, Youqiang Yu <yyqkc<at>mst.edu> wrote:

            To whom it may concern,

            I have a question on the "merge" command. I have
            two SAC files from the same station. The reason why
            I want to merge them together is these two dataset have
            some common data. So I want to merge them together
            as one dataset. In other words, the ending time of the first
            data file is after the beginning time of the second data file.

            what I do is as follows:

            read 1.sac
            merge 2.sac
            write over
            quit

            If successfully, 1.sac should include these two data. However,
            when I read 1.sac again, nothing happens to this file. In addition,
            there is no errors when I run the above merging command. Please
            help me on this issue. Thanks.

            best,
            youqiang

            --
            Youqiang Yu
            Geology & Geophysics Program
            Department of Geological Science & Engineering
            Missouri University of Science and Technology
            Rolla, Mo, 65409
            Email: yyqkc<at>mst.com
            573.201.9437
            相信自己,创造梦想
            _______________________________________________
            sac-help mailing list
            sac-help<at>iris.washington.edu
            http://www.iris.washington.edu/mailman/listinfo/sac-help




            --
            Youqiang Yu
            Geology & Geophysics Program
            Department of Geological Science & Engineering
            Missouri University of Science and Technology
            Rolla, Mo, 65409
            Email: yyqkc<at>mst.com
            573.201.9437
            相信自己,创造梦想

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




            --
            Youqiang Yu
            Geology & Geophysics Program
            Department of Geological Science & Engineering
            Missouri University of Science and Technology
            Rolla, Mo, 65409
            Email: yyqkc<at>mst.com
            573.201.9437
            相信自己,创造梦想

00:34:37 v.22510d55