Thread: Spectral divison

Started: 2016-03-25 23:15:51
Last activity: 2016-03-26 21:44:32
Topics: SAC Help
Abhash Kumar
2016-03-25 23:15:51
Hi,
I am using "readsp" and "divf" to divide two amplitude spectral files
as shown below and getting error message:

SAC> readsp 2012.156.10.37.GREEN.EHE.SAC.am
SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am
ERROR 1307: Illegal operation on spectral file
2012.156.10.37.GREEN.EHE.SAC.am

When I use read command instead of readsp and take output of the divison to
a third file, I don't get error, but the third file is not a amplitude
spectrum file rather a X and Y file:
SAC> read 2012.156.10.37.GREEN.EHE.SAC.am
SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am
SAC> w 2012.156.10.37.GREEN.EHE.spectraldivison.SAC.

I also tried writesp command after divison, but I get ERROR 1305: Illegal
operation on time series file. I would be extremely grateful for any
suggestion on how to divide two spectral files and get another another
spectral file.

Thanks
Abhash Kumar

  • Abhash Kumar
    2016-03-25 23:49:42
    Hi,
    I am using "readsp" and "divf" to divide two amplitude spectral files
    as shown below and getting error message:

    SAC> readsp 2012.156.10.37.GREEN.EHE.SAC.am
    SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am
    ERROR 1307: Illegal operation on spectral file
    2012.156.10.37.GREEN.EHE.SAC.am

    When I use read command instead of readsp and take output of the divison to
    a third file, I don't get error, but the third file is not a amplitude
    spectrum file rather a X and Y file:
    SAC> read 2012.156.10.37.GREEN.EHE.SAC.am
    SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am
    SAC> w 2012.156.10.37.GREEN.EHE.spectraldivison.SAC.

    I also tried writesp command after divison, but I get ERROR 1305: Illegal
    operation on time series file. I would be extremely grateful for any
    suggestion on how to divide two amplitude spectral files and get another
    another spectral file.

    Thanks
    Abhash Kumar
    National Energy Technology Laboratory
    US Department of Energy

    • Milton Plasencia
      2016-03-26 13:07:48
      Hi,

      Perhaps you need try:

      SAC> binoperr NTPS warning
      SAC> r 2012.115.10.30.GREEN.EHE.SAC
      SAC> divf 2012.122.09.56.GREEN.EHE.SAC
      WARNING: Header field mismatch: NPTS 2012.115.10.30.GREEN.EHE.SAC 2012.122.09.56.GREEN.EHE.SAC
      WARNING: Time overlap:
      BEG1: APR 24 (115), 2012 10:30:00.000 2012.115.10.30.GREEN.EHE.SAC
      BEG2: MAY 01 (122), 2012 09:50:56.002 2012.122.09.56.GREEN.EHE.SAC
      SAC> fft
      DC level after DFT is 8.3732
      SAC> psp am loglin

      So, first divide the trace in time domain an then apply fft to obtain the spectral ratio in frequency domain.

      HTH,

      Milton



      On Mar 25, 2016, at 21:50, Abhash Kumar <abhash.kumar84<at>gmail.com> wrote:

      Hi,
      I am using "readsp" and "divf" to divide two amplitude spectral files as shown below and getting error message:

      SAC> readsp 2012.156.10.37.GREEN.EHE.SAC.am http://2012.156.10.37.green.ehe.sac.am/
      SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am http://2012.122.09.56.green.ehe.sac.am/
      ERROR 1307: Illegal operation on spectral file 2012.156.10.37.GREEN.EHE.SAC.am http://2012.156.10.37.green.ehe.sac.am/

      When I use read command instead of readsp and take output of the divison to a third file, I don't get error, but the third file is not a amplitude spectrum file rather a X and Y file:
      SAC> read 2012.156.10.37.GREEN.EHE.SAC.am http://2012.156.10.37.green.ehe.sac.am/
      SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am http://2012.122.09.56.green.ehe.sac.am/
      SAC> w 2012.156.10.37.GREEN.EHE.spectraldivison.SAC.

      I also tried writesp command after divison, but I get ERROR 1305: Illegal operation on time series file. I would be extremely grateful for any suggestion on how to divide two amplitude spectral files and get another another spectral file.

      Thanks
      Abhash Kumar
      National Energy Technology Laboratory
      US Department of Energy

      <2012.122.09.56.GREEN.EHE.SAC.am><2012.156.10.37.GREEN.EHE.SAC.am><2012.156.10.37.GREEN.EHE.spectraldivison.SAC.am>
      ----------------------
      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/


      Attachments
    • George Helffrich
      2016-03-26 21:44:32
      Dear Abhash -

      I’m not sure why you insist on having the result be a spectral file, but here’s a way to get one. After using

      read … ; divf … ;

      then write your spectral division file as a normal SAC file. Then use READSP SPE to re-read it:

      write /tmp/hold ; readsp spe /tmp/hold ; lh

      That supplies a zero phase component for your spectrum. The ‘lh’ command shows the result to be a spectral file. See the documentation for READSP SPE; be careful about any switch from power to amplitude.

      On 26 Mar 2016, at 05:50, Abhash Kumar <abhash.kumar84<at>gmail.com> wrote:

      Hi,
      I am using "readsp" and "divf" to divide two amplitude spectral files as shown below and getting error message:

      SAC> readsp 2012.156.10.37.GREEN.EHE.SAC.am
      SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am
      ERROR 1307: Illegal operation on spectral file 2012.156.10.37.GREEN.EHE.SAC.am

      When I use read command instead of readsp and take output of the divison to a third file, I don't get error, but the third file is not a amplitude spectrum file rather a X and Y file:
      SAC> read 2012.156.10.37.GREEN.EHE.SAC.am
      SAC> divf 2012.122.09.56.GREEN.EHE.SAC.am
      SAC> w 2012.156.10.37.GREEN.EHE.spectraldivison.SAC.

      I also tried writesp command after divison, but I get ERROR 1305: Illegal operation on time series file. I would be extremely grateful for any suggestion on how to divide two amplitude spectral files and get another another spectral file.

      Thanks
      Abhash Kumar
      National Energy Technology Laboratory
      US Department of Energy

      <2012.122.09.56.GREEN.EHE.SAC.am><2012.156.10.37.GREEN.EHE.SAC.am><2012.156.10.37.GREEN.EHE.spectraldivison.SAC.am>
      ----------------------
      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/



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


10:40:40 v.01697673