Thread: regarding the use of sac2mseed

Started: 2018-07-29 19:52:59
Last activity: 2018-07-29 19:52:59
Topics: SAC Help
sanjay Singh Negi
2018-07-29 19:52:59
Dear SAC users,
I am using the code sac2mseed to convert my sac files to
miniseed format.
The SAC file perfectly opens under SAC. But the converted file seems to be
empty. Hereby I am the code sac2mseed and the sac file.

Any help?

Thank you.

Regards
Sanjay



--



Sanjay Singh Negi
Alternate Email: sasnegi85<at>gmail.com

Contact No.- +91-9536145596

  • Esteban Chaves
    2018-07-29 17:27:08
    Hi Sanjay,

    I use obspy/python. Here is how it does it, very simple and it takes just 2
    lines of code:

    https://docs.obspy.org/packages/autogen/obspy.core.stream.Stream.write.html

    -Esteban J. Chaves


    On Sun, Jul 29, 2018 at 12:26 AM sanjay Singh Negi <sonoogeo<at>gmail.com>
    wrote:

    Dear SAC users,
    I am using the code sac2mseed to convert my sac files to
    miniseed format.
    The SAC file perfectly opens under SAC. But the converted file seems to be
    empty. Hereby I am the code sac2mseed and the sac file.

    Any help?

    Thank you.

    Regards
    Sanjay



    --



    Sanjay Singh Negi
    Alternate Email: sasnegi85<at>gmail.com

    Contact No.- +91-9536145596

    ----------------------
    SAC Help
    Topic home: http://ds.iris.edu/message-center/topic/sac-help/ |
    Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

    Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/



    --
    Esteban J. Chaves
    PhD Candidate in Seismology
    Earth and Planetary Sciences
    University of California, Santa Cruz
    Office: EMS C317B

  • Chad Trabant
    2018-07-29 18:27:46

    Hello Sanjay,

    I am having no trouble converting AMR_2012.107.00.10.00.z to miniSEED using sac2mseed:

    $ sac2mseed AMR_2012.107.00.10.00.z -o AMR_2012.107.00.10.00.mseed -v
    sac2mseed version: 1.12
    Reading AMR_2012.107.00.10.00.z
    [AMR_2012.107.00.10.00.z] Reading SAC binary format (little-endian)
    [AMR_2012.107.00.10.00.z] Creating integer data scaled by: 1
    [AMR_2012.107.00.10.00.z] 30001 samps @ 50.000000 Hz for N: 'II', S: 'AMR', L: 'SI', C: 'EPZ'
    Packed 1 trace(s) of 30001 samples into 5 records

    $ ls -l AMR_2012.107.00.10.00.mseed
    -rw-r--r-- 1 chad staff 20480 Jul 29 11:23 AMR_2012.107.00.10.00.mseed

    I would happy to help you off-list, any generally useful information will be shared back to the list.

    regards,
    Chad

    On Jul 29, 2018, at 12:24 AM, sanjay Singh Negi <sonoogeo<at>gmail.com> wrote:

    Dear SAC users,
    I am using the code sac2mseed to convert my sac files to miniseed format.
    The SAC file perfectly opens under SAC. But the converted file seems to be empty. Hereby I am the code sac2mseed and the sac file.

    Any help?

    Thank you.

    Regards
    Sanjay



    --



    Sanjay Singh Negi
    Alternate Email: sasnegi85<at>gmail.com http://gmail.com/

    Contact No.- +91-9536145596
    <sac2mseed-master.zip><AMR_2012.107.00.10.00.z>
    ----------------------
    SAC Help
    Topic home: http://ds.iris.edu/message-center/topic/sac-help/ | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu

    Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
    Update subscription preferences at http://ds.iris.edu/account/profile/


    • Chad Trabant
      2018-07-29 18:44:52

      Hi Sanjay,

      I think I see the problem. The output files are not empty but all the data samples are zeros. The problem is that the data samples in the SAC are very, very small and the range between smallest and largest is quite large, e.g. 4.46119e-14, -1.04593e-09, etc. The default output encoding for sac2mseed is Steim-2 encoding, which requires 32-bit integers. By default the data values are also-scaled to integers, but something about the range means autoscaling is not being applied. In the end, when the 32-bit floats are converted to integers they all become zero.

      Two suggestions:

      1) Use 32-bit float encoding for the converted miniSEED using the "-e 4" option, e.g.:
      $ sac2mseed AMR_2012.107.00.10.00.z -o AMR_2012.107.00.10.00.mseed -v -e 4

      There will be no compression of this data.

      2) Apply a scaling factor to the samples using the -s option. You need to determine which factor you wish to apply.

      regards,
      Chad

      On Jul 29, 2018, at 11:27 AM, Chad Trabant <chad<at>iris.washington.edu> wrote:

      Hello Sanjay,

      I am having no trouble converting AMR_2012.107.00.10.00.z to miniSEED using sac2mseed:

      $ sac2mseed AMR_2012.107.00.10.00.z -o AMR_2012.107.00.10.00.mseed -v
      sac2mseed version: 1.12
      Reading AMR_2012.107.00.10.00.z
      [AMR_2012.107.00.10.00.z] Reading SAC binary format (little-endian)
      [AMR_2012.107.00.10.00.z] Creating integer data scaled by: 1
      [AMR_2012.107.00.10.00.z] 30001 samps @ 50.000000 Hz for N: 'II', S: 'AMR', L: 'SI', C: 'EPZ'
      Packed 1 trace(s) of 30001 samples into 5 records

      $ ls -l AMR_2012.107.00.10.00.mseed
      -rw-r--r-- 1 chad staff 20480 Jul 29 11:23 AMR_2012.107.00.10.00.mseed

      I would happy to help you off-list, any generally useful information will be shared back to the list.

      regards,
      Chad

      On Jul 29, 2018, at 12:24 AM, sanjay Singh Negi <sonoogeo<at>gmail.com <sonoogeo<at>gmail.com>> wrote:

      Dear SAC users,
      I am using the code sac2mseed to convert my sac files to miniseed format.
      The SAC file perfectly opens under SAC. But the converted file seems to be empty. Hereby I am the code sac2mseed and the sac file.

      Any help?

      Thank you.

      Regards
      Sanjay



      --



      Sanjay Singh Negi
      Alternate Email: sasnegi85<at>gmail.com http://gmail.com/

      Contact No.- +91-9536145596
      <sac2mseed-master.zip><AMR_2012.107.00.10.00.z>
      ----------------------
      SAC Help
      Topic home: http://ds.iris.edu/message-center/topic/sac-help/ | Unsubscribe: sac-help-unsubscribe<at>lists.ds.iris.edu <sac-help-unsubscribe<at>lists.ds.iris.edu>

      Sent from the IRIS Message Center (http://ds.iris.edu/message-center/)
      Update subscription preferences at http://ds.iris.edu/account/profile/



Page built 08:38:57 | v.b'108166