Thread: Having problems creating ALPHA input files

Started: 2005-11-03 19:34:30
Last activity: 2005-11-04 18:12:29
Topics: SAC Help
cpena@email.arizona.edu
2005-11-03 19:34:30
Hello,

I'm generating synthetic earthquakes composed of about 4100 acceleration points
at 0.012 sec intervals using another program and I want to use double
integration within SAC to generate displacement time series. I've tried
generating the corresponding ALPHA file for SAC and I'm having problems.
Specifically, SAC seems to try to read 5 acc pts at once and I'm creating the
data input in a column format. For example, see below:

Acc pts in column format:

12
23
34
35
11

SAC reads them like this:12 0 0 0 0 (at 0.012 sec intervals)
23 0 0 0 0
34 0 0 0 0
35 0 0 0 0
11 0 0 0 0

Instead as like this: 12 23 34 35 11 (at 0.012 sec intervals)

I've tried to separate the acc pts with commas and even tried to rearrange the
input in 5 pts per row and SAC will still read the data as shown above. Even if
this scheme worked, it is impractical to do in a 4100 pt data set.

What do I have to do for SAC to read each acc pt in the column and get rid of
the "spurios" zero values created by SAC?

Thank you so much for your help
Carlos Pena



  • Rob Casey
    2005-11-04 18:12:29

    Hi Carlos-

    SAC should work fine on 5 points per row. That is how it is supposed
    to read incoming data points. The main thing is that you are running
    READALPHA in the default FREE format, which can handle space-separated
    data columns.

    Try this one-liner to turn 1 column data to five column data. Note
    that this inserts tabs between columns, and I am not sure if this works
    for READALPHA. If not, then change out the '\t' at the end of this
    line for some spaces.

    cat TSK.onecol.txt | awk 'BEGIN {x=0}{printf("%d",$1);if (++x==5)
    {printf("\n");x=0;} else {printf("\t")}}'

    -Rob

    On Nov 3, 2005, at 10:34 AM, cpena<at>email.arizona.edu wrote:

    Hello,

    I'm generating synthetic earthquakes composed of about 4100
    acceleration points
    at 0.012 sec intervals using another program and I want to use double
    integration within SAC to generate displacement time series. I've tried
    generating the corresponding ALPHA file for SAC and I'm having
    problems.
    Specifically, SAC seems to try to read 5 acc pts at once and I'm
    creating the
    data input in a column format. For example, see below:

    Acc pts in column format:

    12
    23
    34
    35
    11

    SAC reads them like this:12 0 0 0 0 (at 0.012 sec intervals)
    23 0 0 0 0
    34 0 0 0 0
    35 0 0 0 0
    11 0 0 0 0

    Instead as like this: 12 23 34 35 11 (at 0.012 sec intervals)

    I've tried to separate the acc pts with commas and even tried to
    rearrange the
    input in 5 pts per row and SAC will still read the data as shown
    above. Even if
    this scheme worked, it is impractical to do in a 4100 pt data set.

    What do I have to do for SAC to read each acc pt in the column and get
    rid of
    the "spurios" zero values created by SAC?

    Thank you so much for your help
    Carlos Pena


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

Page built 19:52:19 | v.b'108166