Thread: Ascii to SAC

Started: 2012-06-05 00:00:44
Last activity: 2012-09-27 00:37:49
Topics: SAC Help
Thomas Barningham
2012-06-05 00:00:44
Dear all,

I'm trying to convert an ascii file into a sac file so that it can be read
by a matlab program that i'm using. I have a time series of thermal data
from several fumaroles that i'm trying to analyse, the current ascii file
looks like this:

Measurement definition file:
Nevado_1001300245-Nevado_1001300890.mdf
Sequence start time:
13-feb-2010 13:13:53
Index X01 Max X02 Max X03 Max A04 Max R05 Avg R06 Avg
0 13,942 10,84 32,047 41,853 5,622 7,276
1 14,663 10,965 29,603 31,401 5,84 7,431
2 14,305 10,445 37,227 41,831 5,832 7,503
3 14,324 10,805 37,959 42,941 5,882 7,558
4 14,399 10,625 31,835 32,518 5,855 7,566
5 14,682 11,576 36,29 45,164 5,95 7,578
6 15,02 12,931 36,529 45,231 6,026 7,651
7 14,456 11,105 37,198 45,07 6,005 7,627

etc

What I want to do is process this through a program constructed from matlab
scripts that have been designed to analyse seismic data with a graphical
interfere, it's called "Seismo_volcanalysis" if any of you have used it.
Specifically these scripts will enable me to perform a
fast Fourier transform in order to pick out periodic temperature
fluctuations from the fumaroles. But to do this I need my ascii file in sac
format so that it can be read by the program, can anyone help?! I realise
the program is designed for seismic analysis, but I figured the scripts
could also be used to analyse thermal data...

Cheers
Barney

  • Januka Attanayake
    2012-06-04 22:47:02
    Hello Barney, 
    Why not do the FFT in Matlab and pick the peak frequencies if that's the only thing you want to do without converting your data to .SAC? If you are not familiar with its use you could use positiveFFT.m program from Jake Blanchard's website: http://blanchard.ep.wisc.edu/PublicMatlab/
    Note that your inputs are thermal data vector and sampling frequency. 

    If things are still not clear you could look at his tutorial here: http://www.youtube.com/watch?v=Oi2vFowjYiY
    Note that positiveFFT.m part starts at 3:15. 

    Januka.
     
    _______________
    Serenity isn't freedom from the storm, but peace within the storm

    Januka Attanayake 
    Earthquake Seismology & Economics
    The University of Connecticut
    354, Mansfield Road
    Storrs, CT 06269-2045
    Tel:860 486 3914 (Lab - P405)

    Home page: http://sites.google.com/site/janukaattanayake/
    Research group: http://www.phys.uconn.edu/research/geophysics/index.html








    ________________________________
    From: Thomas Barningham <stbarningham<at>googlemail.com>
    To: sac-help<at>iris.washington.edu
    Sent: Monday, June 4, 2012 6:00 PM
    Subject: [SAC-HELP] Ascii to SAC


    Dear all,

    I'm trying to convert an ascii file into a sac file so that it can be read by a matlab program that i'm using. I have a time series of thermal data from several fumaroles that i'm trying to analyse, the current ascii file looks like this:

    Measurement definition file: 
    Nevado_1001300245-Nevado_1001300890.mdf
    Sequence start time: 
    13-feb-2010 13:13:53 
    Index X01 MaxX02 MaxX03 MaxA04 MaxR05 AvgR06 Avg
    013,94210,8432,04741,8535,6227,276
    114,66310,96529,60331,4015,847,431
    214,30510,44537,22741,8315,8327,503
    314,32410,80537,95942,9415,8827,558
    414,39910,62531,83532,5185,8557,566
    514,68211,57636,2945,1645,957,578
    615,0212,93136,52945,2316,0267,651
    714,45611,10537,19845,076,0057,627

    etc

    What I want to do is process this through a program constructed from matlab scripts that have been designed to analyse seismic data with a graphical interfere, it's called "Seismo_volcanalysis" if any of you have used it. Specifically these scripts will enable me to perform a fast Fourier transform in order to pick out periodic temperature fluctuations from the fumaroles. But to do this I need my ascii file in sac format so that it can be read by the program, can anyone help?! I realise the program is designed for seismic analysis, but I figured the scripts could also be used to analyse thermal data...

    Cheers
    Barney
    _______________________________________________
    sac-help mailing list
    sac-help<at>iris.washington.edu
    http://www.iris.washington.edu/mailman/listinfo/sac-help
  • George Helffrich
    2012-06-05 07:59:05
    Dear Barney -

    See the SAC manual for the ASCII file format, here:

    http://www.iris.edu/software/sac/manual/file_format.html

    As a quick and dirty solution, I'd suggest that you copy and paste the header info from the example, change NPTS (last field on line 16) and then substitute your own data values at the end by copy/paste or an awk script. Then read it in and modify the header values to what you need by CH commands. Watch out for the strict field widths, however.

    On 4 Jun 2012, at 23:00, Thomas Barningham wrote:

    Dear all,

    I'm trying to convert an ascii file into a sac file so that it can be read by a matlab program that i'm using. I have a time series of thermal data from several fumaroles that i'm trying to analyse, the current ascii file looks like this:

    Measurement definition file:
    Nevado_1001300245-Nevado_1001300890.mdf
    Sequence start time:
    13-feb-2010 13:13:53
    Index X01 Max X02 Max X03 Max A04 Max R05 Avg R06 Avg
    0 13,942 10,84 32,047 41,853 5,622 7,276
    1 14,663 10,965 29,603 31,401 5,84 7,431
    2 14,305 10,445 37,227 41,831 5,832 7,503
    3 14,324 10,805 37,959 42,941 5,882 7,558
    4 14,399 10,625 31,835 32,518 5,855 7,566
    5 14,682 11,576 36,29 45,164 5,95 7,578
    6 15,02 12,931 36,529 45,231 6,026 7,651
    7 14,456 11,105 37,198 45,07 6,005 7,627

    etc

    What I want to do is process this through a program constructed from matlab scripts that have been designed to analyse seismic data with a graphical interfere, it's called "Seismo_volcanalysis" if any of you have used it. Specifically these scripts will enable me to perform a fast Fourier transform in order to pick out periodic temperature fluctuations from the fumaroles. But to do this I need my ascii file in sac format so that it can be read by the program, can anyone help?! I realise the program is designed for seismic analysis, but I figured the scripts could also be used to analyse thermal data...

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



    George Helffrich
    george.helffrich<at>bris.ac.uk



  • Derek Schutt
    2012-09-26 16:46:13
    Hi folks,

    What is the sign convention for radial and tangential components if I
    use the "rotate to gcp" command? My guess is away from the event is
    positive radial, and positive tangential will be 90deg clockwise of the
    positive radial. "help rotate" is a little vague, so I figured it
    couldn't hurt to check.

    Thanks,

    Derek

    --
    Derek Schutt
    Assistant Professor
    Geosciences
    Colorado State University
    970-491-5786


    • George Helffrich
      2012-09-27 00:37:49
      Dear All -

      Nothing like a good experiment to show behavior ...

      cat << EOF > /tmp/rottest
      fg seismogram; ch evla 0.001 evlo 0.001 stla 0.001 stlo 90.0
      ch cmpaz 0 cmpinc 90; w /tmp/test.n
      ch cmpaz 90 cmpinc 90; w /tmp/test.e
      read /tmp/test.[e,n]; rotate to gcarc
      message "normal"; lh stla stlo evla evlo cmpaz
      read /tmp/test.[e,n]; rotate to gcarc reversed
      message "reversed"; lh stla stlo evla evlo cmpaz
      quit
      EOF

      sac /tmp/rottest

      Conclusion?

      On 26 Sep 2012, at 16:46, Derek wrote:

      Hi folks,

      What is the sign convention for radial and tangential components if I use the "rotate to gcp" command? My guess is away from the event is positive radial, and positive tangential will be 90deg clockwise of the positive radial. "help rotate" is a little vague, so I figured it couldn't hurt to check.

      Thanks,

      Derek

      --
      Derek Schutt
      Assistant Professor
      Geosciences
      Colorado State University
      970-491-5786

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



      George Helffrich
      george.helffrich<at>bris.ac.uk



08:25:42 v.e73c6799