Thread: ascii to sac origin time issue

Started: 2017-11-24 02:54:11
Last activity: 2017-11-24 20:08:40
Topics: SAC Help
Sunil .
2017-11-24 02:54:11
Dear SAC users,

I have a synthetic ASCII file have two column time and amplitude, which I have converted to sac binary using xy2sac. The problem arises while setting the origin time of the sac binary file. By default sac binary origin time is set as -12345. I am not able to change the kzdate. Somehow, I able to set the kztime having omarker as 4.5275e+11.

How to set the actual kzdate and kztime in the sac binary header. I will appreciate any help or suggestions.

Thank you,
Sunil
ERI, University of Tokyo
Tokyo

  • George Helffrich
    2017-11-24 20:08:40
    Dear All -

    I would strongly recommend using SAC’s READTABLE command to read the ASCII data directly and then setting time/date information with SAC’s CHNHDR command. Wrapping the two commands into a SAC macro would be a simple task and effective way of mechanizing the operation for conversion of many ASCII data files.

    If you Google for xy2sac you’ll get a similar suggestion.

    On 24 Nov 2017, at 11:54, Sunil . <seismo_003<at>rediffmail.com> wrote:

    Dear SAC users,

    I have a synthetic ASCII file have two column time and amplitude, which I have converted to sac binary using xy2sac. The problem arises while setting the origin time of the sac binary file. By default sac binary origin time is set as -12345. I am not able to change the kzdate. Somehow, I able to set the kztime having omarker as 4.5275e+11.

    How to set the actual kzdate and kztime in the sac binary header. I will appreciate any help or suggestions.

    Thank you,
    Sunil
    ERI, University of Tokyo
    Tokyo

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


    • Geo .
      2017-11-24 17:47:38
      Hello Sunil,
      Use READTABLE as George suggested. See my example below, which you can
      modify. Also, you can't change KZDATE and KZTIME directly as they are
      derived from other header variables.

      *SAC> READTABLE CONTENT XY. filename.txt*

      For KZDATE, modify NZYEAR and NZJDAY headers.
      For KZTIME, modify NZHOUR, NZMIN, NZSEC, and NZMSEC headers.

      For more information, go here:
      https://ds.iris.edu/files/sac-manual/manual/file_format.html

      Januka

      Januka Attanayake
      Postdoctoral Research Associate

      Institute of Geophysics
      WWU Münster | CorrensstraBe 24 | 48149 Münster | Germany
      Tel +49 251 833 4727

      University email: jattanayake<at>uni-muenster.de
      Homepage: http://sites.google.com/site/janukaattanayake/

      On 24 November 2017 at 04:09, George Helffrich <george<at>elsi.jp> wrote:

      Dear All -

      I would strongly recommend using SAC’s READTABLE command to read
      the ASCII data directly and then setting time/date information with SAC’s
      CHNHDR command. Wrapping the two commands into a SAC macro would be a
      simple task and effective way of mechanizing the operation for conversion
      of many ASCII data files.

      If you Google for xy2sac you’ll get a similar suggestion.

      On 24 Nov 2017, at 11:54, Sunil . <seismo_003<at>rediffmail.com> wrote:

      Dear SAC users,

      I have a synthetic ASCII file have two column time and amplitude, which
      I have converted to sac binary using xy2sac. The problem arises while
      setting the origin time of the sac binary file. By default sac binary
      origin time is set as -12345. I am not able to change the kzdate. Somehow,
      I able to set the kztime having omarker as 4.5275e+11.

      How to set the actual kzdate and kztime in the sac binary header. I will
      appreciate any help or suggestions.

      Thank you,
      Sunil
      ERI, University of Tokyo
      Tokyo

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


09:24:52 v.22510d55