Thread: writing GSE (IMS) and CSS files of impulses

Started: 2015-09-28 17:02:42
Last activity: 2015-10-02 21:30:03
Topics: SAC Help
Sheila Peacock
2015-09-28 17:02:42
I want to test the basic algorithms of another program that
reads only CSS-format data from arrays. Hence I generated
a set of impulses in SAC and tried to write them to a CSS-format
file with "writecss".

This failed with ERROR 1385: No worksets in memory.

The traces look OK with "p1", which I assume means that they
are "in memory".

I tried to write the same set of impulses into an IMS (GSE)
file with "writegse" (because I could convert this format to CSS
with another program) but this crashed SAC with a segmentation fault.

The commands to create the data were:

funcgen impulse npts 2048 delta 0.05

to create the basic impulse, then seven calls to "chnhdr" followed
by "write" to make seven traces with distinct station positions,
then "read" all seven traces in, then "writecss".

The header variables I set were:

kstnm
kcmpnm
stla
stlo
stel
nzyear, nzjday, nzhour, nzmin, nzsec, nzmsec
cmpaz, cmpinc

(stla, stlo and stel were all set to the values for an actual
array station and nzyear etc. all set to be today noon - i.e.
"realistic" values).

I am using SAC 101.6a on a CentOS5 64-bit Linux computer.
The errors occur whether I use the precompiled binary or a
locally-compiled version.

I have tested the two commands, "writecss" and "writegse"
with some "real" seismic data (obtained from IRIS and converted
to SAC from SEED format with rdseed) and I get the same errors,
so I don't think it's because I have not set a crucial
variable in the header. The "help" info does not mention which
variables need to be set for "writecss" and "writegse" to work.



Regards,
Sheila Peacock,
Blacknest.

  • Brian Savage
    2015-09-28 13:38:58
    Sheila,

    The error occurs as you have the “database” functionality” of sac turned off. CSS requires this functionality. I will update the error messages so others do not run into this same issue. Sorry if this was totally opaque.

    To turn the database on use (depending on your shell)
    bash% SAC_USE_DATABASE=1
    or
    csh% setenv SAC_USE_DATABASE 1

    Examples:

    Without database

    % env SAC_USE_DATABASE=0 sac
    SEISMIC ANALYSIS CODE [06/10/2014 (Version 101.6a)]
    Copyright 1995 Regents of the University of California

    SAC> funcgen impulse npts 2048 delta 0.05
    SAC> writecss tmp
    ERROR 1385: No worksets in memory.

    With database

    % env SAC_USE_DATABASE=1 sac
    SEISMIC ANALYSIS CODE [06/10/2014 (Version 101.6a)]
    Copyright 1995 Regents of the University of California

    SAC> funcgen impulse npts 2048 delta 0.05
    SAC> writecss tmp
    SAC>

    Brian


    On Sep 28, 2015, at 5:04 AM, Sheila Peacock <sheila<at>blacknest.gov.uk> wrote:

    I want to test the basic algorithms of another program that
    reads only CSS-format data from arrays. Hence I generated
    a set of impulses in SAC and tried to write them to a CSS-format
    file with "writecss".

    This failed with ERROR 1385: No worksets in memory.

    The traces look OK with "p1", which I assume means that they
    are "in memory".

    I tried to write the same set of impulses into an IMS (GSE)
    file with "writegse" (because I could convert this format to CSS
    with another program) but this crashed SAC with a segmentation fault.

    The commands to create the data were:

    funcgen impulse npts 2048 delta 0.05

    to create the basic impulse, then seven calls to "chnhdr" followed
    by "write" to make seven traces with distinct station positions,
    then "read" all seven traces in, then "writecss".

    The header variables I set were:

    kstnm
    kcmpnm
    stla
    stlo
    stel
    nzyear, nzjday, nzhour, nzmin, nzsec, nzmsec
    cmpaz, cmpinc

    (stla, stlo and stel were all set to the values for an actual
    array station and nzyear etc. all set to be today noon - i.e.
    "realistic" values).

    I am using SAC 101.6a on a CentOS5 64-bit Linux computer.
    The errors occur whether I use the precompiled binary or a
    locally-compiled version.

    I have tested the two commands, "writecss" and "writegse"
    with some "real" seismic data (obtained from IRIS and converted
    to SAC from SEED format with rdseed) and I get the same errors,
    so I don't think it's because I have not set a crucial
    variable in the header. The "help" info does not mention which
    variables need to be set for "writecss" and "writegse" to work.



    Regards,
    Sheila Peacock,
    Blacknest.

    ----------------------
    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/


    • Sheila Peacock
      2015-09-28 21:43:07
      Brian - thank you - that worked.

      There seems to be a limit on the length of the filename in the command
      "writecss filename" (15 or 16 characters). With too
      long a filename it wrote an empty wfdisc file with
      the warning message:

      css-warning: Skipping wfdisc record because file name is too long...
      css-warning: File name longer than 32 characters

      My filename was 18 characters. I think it was made up to 32
      in the names of the binary data (".w") files, which consist
      of the filename I provide plus the station name (greedily five
      characters) and then an 8-digit number, then ".w", which came to
      33 characters. When I shortened my filename to 14 characters it
      worked.

      Once "writecss" had worked, "writegse" invoked by the same
      macro also worked. I guess that the failed "writecss" had left
      some memory not in a clean state, which tripped up "writegse"
      - or does "writegse" also need SAC_USE_DATABASE set?

      George - I haven't tried the Bristol version. Where do I get it?

      Thanks to both.

      Sheila.



      On 09/28/2015 11:40 AM, savage<at>uri.edu wrote:
      Sheila,

      The error occurs as you have the “database” functionality” of sac turned off. CSS requires this functionality. I will update the error messages so others do not run into this same issue. Sorry if this was totally opaque.

      To turn the database on use (depending on your shell)
      bash% SAC_USE_DATABASE=1
      or
      csh% setenv SAC_USE_DATABASE 1

      Examples:

      Without database

      % env SAC_USE_DATABASE=0 sac
      SEISMIC ANALYSIS CODE [06/10/2014 (Version 101.6a)]
      Copyright 1995 Regents of the University of California

      SAC> funcgen impulse npts 2048 delta 0.05
      SAC> writecss tmp
      ERROR 1385: No worksets in memory.

      With database

      % env SAC_USE_DATABASE=1 sac
      SEISMIC ANALYSIS CODE [06/10/2014 (Version 101.6a)]
      Copyright 1995 Regents of the University of California

      SAC> funcgen impulse npts 2048 delta 0.05
      SAC> writecss tmp
      SAC>

      Brian


      On Sep 28, 2015, at 5:04 AM, Sheila Peacock <sheila<at>blacknest.gov.uk> wrote:

      I want to test the basic algorithms of another program that
      reads only CSS-format data from arrays. Hence I generated
      a set of impulses in SAC and tried to write them to a CSS-format
      file with "writecss".

      This failed with ERROR 1385: No worksets in memory.

      The traces look OK with "p1", which I assume means that they
      are "in memory".

      I tried to write the same set of impulses into an IMS (GSE)
      file with "writegse" (because I could convert this format to CSS
      with another program) but this crashed SAC with a segmentation fault.

      The commands to create the data were:

      funcgen impulse npts 2048 delta 0.05

      to create the basic impulse, then seven calls to "chnhdr" followed
      by "write" to make seven traces with distinct station positions,
      then "read" all seven traces in, then "writecss".

      The header variables I set were:

      kstnm
      kcmpnm
      stla
      stlo
      stel
      nzyear, nzjday, nzhour, nzmin, nzsec, nzmsec
      cmpaz, cmpinc

      (stla, stlo and stel were all set to the values for an actual
      array station and nzyear etc. all set to be today noon - i.e.
      "realistic" values).

      I am using SAC 101.6a on a CentOS5 64-bit Linux computer.
      The errors occur whether I use the precompiled binary or a
      locally-compiled version.

      I have tested the two commands, "writecss" and "writegse"
      with some "real" seismic data (obtained from IRIS and converted
      to SAC from SEED format with rdseed) and I get the same errors,
      so I don't think it's because I have not set a crucial
      variable in the header. The "help" info does not mention which
      variables need to be set for "writecss" and "writegse" to work.



      Regards,
      Sheila Peacock,
      Blacknest.

      ----------------------
      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/


      ----------------------
      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/


      • Brian Savage
        2015-10-02 21:30:03
        Sheila,

        I am looking into this presently and this is what I get with 101.6a ( I hope this helps )

        SAC> fg seismo
        SAC> ch kstnm ABCDE
        SAC>
        SAC> * Write CSS with 18 character filename
        SAC> writecss f23456789012345678
        css-warning: Skipping affiliation record because of null keys...
        css-warning: -99999.00 truncated to (-99999.) to fit format requirements
        css-warning: File name longer than 32 characters
        css-warning: basename[ 18]: f23456789012345678
        css-warning: station[ 5]: ABCDE
        css-warning: wfid[ 8]: 00000001
        css-warning: extension[ 2]: .w
        css-warning: filename[ 33]: f23456789012345678ABCDE00000001.w
        css-warning: Skipping wfdisc record because file name is too long...
        SAC>
        SAC> * Write CSS with 17 character filename
        SAC> writecss f2345678901234567
        css-warning: Skipping affiliation record because of null keys...
        css-warning: -99999.00 truncated to (-99999.) to fit format requirements

        Brian

        On Sep 28, 2015, at 9:45 AM, Sheila Peacock wrote:

        Brian - thank you - that worked.

        There seems to be a limit on the length of the filename in the command
        "writecss filename" (15 or 16 characters). With too
        long a filename it wrote an empty wfdisc file with
        the warning message:

        css-warning: Skipping wfdisc record because file name is too long...
        css-warning: File name longer than 32 characters

        My filename was 18 characters. I think it was made up to 32
        in the names of the binary data (".w") files, which consist
        of the filename I provide plus the station name (greedily five
        characters) and then an 8-digit number, then ".w", which came to
        33 characters. When I shortened my filename to 14 characters it
        worked.

        Once "writecss" had worked, "writegse" invoked by the same
        macro also worked. I guess that the failed "writecss" had left
        some memory not in a clean state, which tripped up "writegse"
        - or does "writegse" also need SAC_USE_DATABASE set?

        George - I haven't tried the Bristol version. Where do I get it?

        Thanks to both.

        Sheila.



        On 09/28/2015 11:40 AM, savage<at>uri.edu wrote:
        Sheila,

        The error occurs as you have the “database” functionality” of sac turned off. CSS requires this functionality. I will update the error messages so others do not run into this same issue. Sorry if this was totally opaque.

        To turn the database on use (depending on your shell)
        bash% SAC_USE_DATABASE=1
        or
        csh% setenv SAC_USE_DATABASE 1

        Examples:

        Without database

        % env SAC_USE_DATABASE=0 sac
        SEISMIC ANALYSIS CODE [06/10/2014 (Version 101.6a)]
        Copyright 1995 Regents of the University of California

        SAC> funcgen impulse npts 2048 delta 0.05
        SAC> writecss tmp
        ERROR 1385: No worksets in memory.

        With database

        % env SAC_USE_DATABASE=1 sac
        SEISMIC ANALYSIS CODE [06/10/2014 (Version 101.6a)]
        Copyright 1995 Regents of the University of California

        SAC> funcgen impulse npts 2048 delta 0.05
        SAC> writecss tmp
        SAC>

        Brian


        On Sep 28, 2015, at 5:04 AM, Sheila Peacock <sheila<at>blacknest.gov.uk> wrote:

        I want to test the basic algorithms of another program that
        reads only CSS-format data from arrays. Hence I generated
        a set of impulses in SAC and tried to write them to a CSS-format
        file with "writecss".

        This failed with ERROR 1385: No worksets in memory.

        The traces look OK with "p1", which I assume means that they
        are "in memory".

        I tried to write the same set of impulses into an IMS (GSE)
        file with "writegse" (because I could convert this format to CSS
        with another program) but this crashed SAC with a segmentation fault.

        The commands to create the data were:

        funcgen impulse npts 2048 delta 0.05

        to create the basic impulse, then seven calls to "chnhdr" followed
        by "write" to make seven traces with distinct station positions,
        then "read" all seven traces in, then "writecss".

        The header variables I set were:

        kstnm
        kcmpnm
        stla
        stlo
        stel
        nzyear, nzjday, nzhour, nzmin, nzsec, nzmsec
        cmpaz, cmpinc

        (stla, stlo and stel were all set to the values for an actual
        array station and nzyear etc. all set to be today noon - i.e.
        "realistic" values).

        I am using SAC 101.6a on a CentOS5 64-bit Linux computer.
        The errors occur whether I use the precompiled binary or a
        locally-compiled version.

        I have tested the two commands, "writecss" and "writegse"
        with some "real" seismic data (obtained from IRIS and converted
        to SAC from SEED format with rdseed) and I get the same errors,
        so I don't think it's because I have not set a crucial
        variable in the header. The "help" info does not mention which
        variables need to be set for "writecss" and "writegse" to work.



        Regards,
        Sheila Peacock,
        Blacknest.

        ----------------------
        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/


        ----------------------
        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/


        ----------------------
        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/


10:19:43 v.b4412d20