Thread: problems with plotsp and merge

Started: 2013-08-19 22:39:00
Last activity: 2013-08-20 16:20:43
Topics: SAC Help
giulia
2013-08-19 22:39:00
Hello,

I'm having a couple of problems with sac:

1) PROBLEMS WITH PLOTSP:
after reading a file and using xlim to have only part of the signal, then
fft, I can't plot the spectrum, it simply displays a white window. So,
basically, it works if I do:
r file
fft
psp
But it doesn't work if I do:
r file
xlim 100 200
fft
psp


I also have a problem using Sac Graphic Files and then plotsp. I can create
a correct figure when reading only one file, but not if I read many files.
r file1 file2 file3
fft
bd sgf
psp am

This creates 5 .sgf files: f001.sgf contains the 1st amp. spectrum,
f003.sgf the second and f005.sgf the third. But the second and third have
no information on date, time etc in the figure. And anyway there are two
useless files called f002.sgf and f003.sgf. So basically there is some
confusion with the figures...



2) TROUBLES WITH MERGE: I need to merge many 5min-files to create 1 hour
files. I tried to read all the files, then write merge, but it gives this
error: ERROR 1803: No binary data files read in
Example: r file0*.sac
merge
ERROR 1803: No binary data files read in

Then I tried to read one file and then merge others, but it just merges one
of them, sometimes not even the first.
Example: r file01.sac
merge file02.sac file03.sac
This way, it merges only the first and the third file, with a file missing
in the middle!

The only way to merge several files is to read one and then merge one file
at a time. But this requires a lot of time! And I'm quite sure another way
exists to do the same...
Is it possible that I have some problems with my software since the time
I've installed it?
I installed it a few months ago. I have Scientific Linux - 64bit.

Can you please help me?
Thank you very much,
Best regards,

Giulia

  • youqiang yu
    2013-08-19 18:10:09
    Hi, Giulia,

    For second question, I have some clues for you.

    You can try the following way:

    read file01.sac
    merge file02.sac
    merge file03.sac
    ...
    ...
    write over

    the final merged file is file01.sac. You can generate a shell file to run
    these SAC commands.
    it should work. good luck.

    best,
    youqiang


    On Mon, Aug 19, 2013 at 10:39 AM, Giulia Sgattoni <giulia.sgattoni<at>gmail.com
    wrote:

    Hello,

    I'm having a couple of problems with sac:

    1) PROBLEMS WITH PLOTSP:
    after reading a file and using xlim to have only part of the signal, then
    fft, I can't plot the spectrum, it simply displays a white window. So,
    basically, it works if I do:
    r file
    fft
    psp
    But it doesn't work if I do:
    r file
    xlim 100 200
    fft
    psp


    I also have a problem using Sac Graphic Files and then plotsp. I can
    create a correct figure when reading only one file, but not if I read many
    files.
    r file1 file2 file3
    fft
    bd sgf
    psp am

    This creates 5 .sgf files: f001.sgf contains the 1st amp. spectrum,
    f003.sgf the second and f005.sgf the third. But the second and third have
    no information on date, time etc in the figure. And anyway there are two
    useless files called f002.sgf and f003.sgf. So basically there is some
    confusion with the figures...



    2) TROUBLES WITH MERGE: I need to merge many 5min-files to create 1 hour
    files. I tried to read all the files, then write merge, but it gives this
    error: ERROR 1803: No binary data files read in
    Example: r file0*.sac
    merge
    ERROR 1803: No binary data files read in

    Then I tried to read one file and then merge others, but it just merges
    one of them, sometimes not even the first.
    Example: r file01.sac
    merge file02.sac file03.sac
    This way, it merges only the first and the third file, with a file missing
    in the middle!

    The only way to merge several files is to read one and then merge one file
    at a time. But this requires a lot of time! And I'm quite sure another way
    exists to do the same...
    Is it possible that I have some problems with my software since the time
    I've installed it?
    I installed it a few months ago. I have Scientific Linux - 64bit.

    Can you please help me?
    Thank you very much,
    Best regards,

    Giulia



    _______________________________________________
    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
    相信自己,创造梦想

  • Dongdong Tian
    2013-08-20 16:20:43
    Hi Giulia,

    Q1:
    The command xlim "determines the plot limits for the x axis".
    Before fft, x axis is time; after fft, x axis is frequency.
    So if you "fft" after "xlim 100 200", command "psp" will plot
    freqency between 100 to 200. And In this frequency range, there
    are no energy, so you get a white window.

    If you want to do fft to some portion of your data, you should use
    "cut" before "read" rather than "xlim".

    Q2:
    It seems to be a bug.

    Q3:
    Youqiang has given a good answer.





    2013/8/19 Giulia Sgattoni <giulia.sgattoni<at>gmail.com>

    Hello,

    I'm having a couple of problems with sac:

    1) PROBLEMS WITH PLOTSP:
    after reading a file and using xlim to have only part of the signal, then
    fft, I can't plot the spectrum, it simply displays a white window. So,
    basically, it works if I do:
    r file
    fft
    psp
    But it doesn't work if I do:
    r file
    xlim 100 200
    fft
    psp


    I also have a problem using Sac Graphic Files and then plotsp. I can
    create a correct figure when reading only one file, but not if I read many
    files.
    r file1 file2 file3
    fft
    bd sgf
    psp am

    This creates 5 .sgf files: f001.sgf contains the 1st amp. spectrum,
    f003.sgf the second and f005.sgf the third. But the second and third have
    no information on date, time etc in the figure. And anyway there are two
    useless files called f002.sgf and f003.sgf. So basically there is some
    confusion with the figures...



    2) TROUBLES WITH MERGE: I need to merge many 5min-files to create 1 hour
    files. I tried to read all the files, then write merge, but it gives this
    error: ERROR 1803: No binary data files read in
    Example: r file0*.sac
    merge
    ERROR 1803: No binary data files read in

    Then I tried to read one file and then merge others, but it just merges
    one of them, sometimes not even the first.
    Example: r file01.sac
    merge file02.sac file03.sac
    This way, it merges only the first and the third file, with a file missing
    in the middle!

    The only way to merge several files is to read one and then merge one file
    at a time. But this requires a lot of time! And I'm quite sure another way
    exists to do the same...
    Is it possible that I have some problems with my software since the time
    I've installed it?
    I installed it a few months ago. I have Scientific Linux - 64bit.

    Can you please help me?
    Thank you very much,
    Best regards,

    Giulia



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



03:51:40 v.f0c1234e