Thread: ascii to sac

Started: 2007-05-21 20:48:37
Last activity: 2007-05-21 21:11:28
Topics: SAC Help
Geo .
2007-05-21 20:48:37
Greetings:
Is it possible to convert an ascii file into a SAC file? if not how would
you read a simple ascii file in SAC?

Thanks !

Januka

  • Stanton, Megan
    2007-05-21 18:00:32
    I just asked the opposite question last week. :)
    Below is the old way to do it using the convert command. I believe you
    can also do it using the r/write commands. Something like

    sac
    r <ascii filename>
    write over sac

    You may want to make a copy of your ascii file since the r/write will
    write over the file you input.

    HTH,
    Megan
    CONVERT
    SUMMARY:
    Converts data files from one format to another.

    SYNTAX:
    CONVERT {FROM} {format} infile
    {TO {format} outfile}|{OVER {format}}
    where format is one of the following:
    SAC|ALPHA

    INPUT:
    infile : The name of the input data file.

    outfile : The name of the output data file.

    OVER : Overwrite the input data file.

    SAC : SAC formatted binary data file.

    ALPHA : Alphanumeric equivalent of SAC binary data file.

    DEFAULT VALUES:
    CONVERT FROM SAC infile OVER SAC

    DESCRIPTION:
    This command converts a single data file from one format to another. It
    will
    be replaced in a future update with an improved system that will use the
    READ
    and WRITE commands.

    ________________________________

    From: sac-help-bounces<at>iris.washington.edu
    [sac-help-bounces<at>iris.washington.edu] On Behalf Of Januka
    Attanayake
    Sent: Monday, May 21, 2007 10:49 AM
    To: sac-help<at>iris.washington.edu
    Subject: [SAC-HELP] ascii to sac



    Greetings:
    Is it possible to convert an ascii file into a SAC file? if not how
    would you read a simple ascii file in SAC?

    Thanks !

    Januka


  • Arthur Snoke
    2007-05-21 21:11:28
    Some on this list may have written programs for preparing data in "alpha"
    or ascii format. To understand about sac file formats, I suggest you
    spend time with the sac users manual at
    <http://www.iris.edu/manuals/sac/manual.html. Instructions like the
    following may be helpful:

    Sample Alphanumeric Data File

    The header section and first five lines of the data section of a sample
    SAC alphanumeric data file is shown below. You can reproduce this file
    (with the entire data section) on your system by executing the following
    commands:

    u: FUNCGEN SEISMOGRAM
    u: WRITE ALPHA TEMP1

    You can then convert this alphanumeric file to a binary one and read it
    into SAC with the following commands:

    u: CONVERT FROM ALPHA TEMP1 TO SAC TEMP2
    u: READ TEMP2

    (cut and paste from the manual)

    On Mon, 21 May 2007, Januka Attanayake wrote:

    Greetings:
    Is it possible to convert an ascii file into a SAC file? if not how would
    you read a simple ascii file in SAC?

    Thanks !

    Januka


Page built 05:53:55 | v.090361a2