Thread: How to interpret ASCII SAC files

Started: 2015-09-21 16:56:39
Last activity: 2015-10-12 17:31:44
Topics: SAC Help
Shahar Barak
2015-09-21 16:56:39
Hi,

I couldn't find in the Users Manual how to parse SAC ASCII files (write
alpha).
I see 30 header lines and 3 tail lines. In between I see 5 columns.
Can anyone help me or point me to the right page in the manual?

Thanks,

Shahar

  • Arthur Snoke
    2015-09-22 20:35:59
    http://ds.iris.edu/files/sac-manual/manual/file_format.html contains a complete description of the header in alpha format including an example.

    On Sep 22, 2015, at 1:20 PM, Shahar Barak <shaharb<at>stanford.edu> wrote:

    Hi,

    I couldn't find in the Users Manual how to parse SAC ASCII files (write alpha).
    I see 30 header lines and 3 tail lines. In between I see 5 columns.
    Can anyone help me or point me to the right page in the manual?

    Thanks,

    Shahar

    ----------------------
    SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

    Sent via IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/


    • Shahar Barak
      2015-10-09 20:51:48
      Thanks, Arthur.
      This webpage still doesn't clearly explains why there are 5 columns of data.
      Is it because the header is presented in 5 columns?
      The webpage says the data is in 5G15.7 format. However, a Google search for
      "5G15.7 format" only brings me to the SAC webpage, which doesn't explain
      what is 5G15.7.
      Is the amplitudes sorted as: col1,...col5? i.e., in order to get a single
      column, ordered, time series, I just need to concatenate the columns
      vertically by their order?

      Thanks,

      Shahar

      On Tue, Sep 22, 2015 at 10:35 AM, Arthur Snoke <snoke<at>vt.edu> wrote:

      http://ds.iris.edu/files/sac-manual/manual/file_format.html contains a
      complete description of the header in alpha format including an example.

      On Sep 22, 2015, at 1:20 PM, Shahar Barak <shaharb<at>stanford.edu> wrote:

      Hi,

      I couldn't find in the Users Manual how to parse SAC ASCII files (write
      alpha).
      I see 30 header lines and 3 tail lines. In between I see 5 columns.
      Can anyone help me or point me to the right page in the manual?

      Thanks,

      Shahar

      ----------------------
      SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

      Sent via IRIS Message Center (http://ds.iris.edu/message-center/)
      Update subscription preferences at http://ds.iris.edu/account/profile/




      • Robert Casey
        2015-10-12 17:31:44

        Hi Shahar-

        I'm not sure if you have received a response, but I'll try to answer your questions below:

        This webpage still doesn't clearly explains why there are 5 columns of data.
        Is it because the header is presented in 5 columns?

        I believe that is what was intended. Maintaining a regular record pattern makes it easier to break down the word counts to a single array as needed. Unlike the binary format, the intent of the ASCII format is to be at least somewhat human-readable.

        The webpage says the data is in 5G15.7 format. However, a Google search for "5G15.7 format" only brings me to the SAC webpage, which doesn't explain what is 5G15.7.

        This is old-school FORTRAN numeric formatting. 'G' represents floating point numeric, but uses the size numbers 15 and 7 to mean the number of digits width of the displayed value and the maximum number of significant digits displayed, respectively. This URL helps to explain:

        http://www.physics.nyu.edu/grierlab/idl_html_help/files17.html

        The 5 before it means this is repeated 5 times.

        Is the amplitudes sorted as: col1,...col5? i.e., in order to get a single column, ordered, time series, I just need to concatenate the columns vertically by their order?

        They are sorted along the rows: row1,col1 ; row1,col2 ; row1, col3 ; row1, col4 ; row1, col5 ; row2, col1, row2, col2 ....etc.


        -Rob



        On Tue, Sep 22, 2015 at 10:35 AM, Arthur Snoke <snoke<at>vt.edu <snoke<at>vt.edu>> wrote:
        http://ds.iris.edu/files/sac-manual/manual/file_format.html contains a complete description of the header in alpha format including an example.

        On Sep 22, 2015, at 1:20 PM, Shahar Barak <shaharb<at>stanford.edu <shaharb<at>stanford.edu>> wrote:

        Hi,

        I couldn't find in the Users Manual how to parse SAC ASCII files (write alpha).
        I see 30 header lines and 3 tail lines. In between I see 5 columns.
        Can anyone help me or point me to the right page in the manual?

        Thanks,

        Shahar

        ----------------------
        SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

        Sent via IRIS Message Center (http://ds.iris.edu/message-center/)
        Update subscription preferences at http://ds.iris.edu/account/profile/



        ----------------------
        SAC Help (http://ds.iris.edu/message-center/topic/sac-help/)

        Sent via IRIS Message Center (http://ds.iris.edu/message-center/)
        Update subscription preferences at http://ds.iris.edu/account/profile/


04:32:36 v.b3198453