Thread: Question about header variable DIST

Started: 2013-06-17 23:26:53
Last activity: 2013-06-18 22:26:26
Topics: SAC Help
Stephane Drouet
2013-06-17 23:26:53
Dear SAC users,

I have a question about the header variable DIST. Aren't DIST, as well
as AZ or BAZ, automatically computed once the event and station
coordinates are set?

I am using a python script to download sac data, and the script which
sets some header information, as for instance event and station
coordinates. For some reason, DIST is not computed for some of the
files. Using "/saclst DIST f file.sac/" returns 0. However, if I start
sac, read the file, write the header (wh) and close sac, then saclst
returns the distance. Is there a way to force sac to compute DIST, AZ
and BAZ?

Best Regards,

Stéphane

--
Stéphane Drouet

--------------------------------
Seismologist, PhD
Observatório Nacional
Rua General José Cristino 77
CEP: 20921-400
Bairro Imperial de São Cristóvão
Rio de Janeiro - RJ - Brazil


  • Arthur Snoke
    2013-06-18 04:27:30
    It sounds like your python script is simply adding numbers to the sac file header fields without opening SAC. Applying saclst to that file will only return values for filled header values.

    If I am correct, have your script open SAC and do a write over.

    Older versions of programs wsacn had problems because they did not update the header before writing the file. Look at entries in HISTORY.


    On Jun 17, 2013, at 3:26 PM, Stéphane Drouet wrote:

    Dear SAC users,

    I have a question about the header variable DIST. Aren't DIST, as well as AZ or BAZ, automatically computed once the event and station coordinates are set?

    I am using a python script to download sac data, and the script which sets some header information, as for instance event and station coordinates. For some reason, DIST is not computed for some of the files. Using "saclst DIST f file.sac" returns 0. However, if I start sac, read the file, write the header (wh) and close sac, then saclst returns the distance. Is there a way to force sac to compute DIST, AZ and BAZ?

    Best Regards,

    Stéphane
    --
    Stéphane Drouet

    --------------------------------
    Seismologist, PhD
    Observatório Nacional
    Rua General José Cristino 77
    CEP: 20921-400
    Bairro Imperial de São Cristóvão
    Rio de Janeiro - RJ - Brazil



    • Stephane Drouet
      2013-06-18 22:26:26
      Dear all,

      Thank you for your answers and tips. Effectively, my python script
      simply put values in the sac header without opening sac. Runing sac
      afterwards and a simple "wh" updates header fields.

      Stéphane

      Stéphane Drouet

      --------------------------------
      Seismologist, PhD
      Observatório Nacional
      Rua General José Cristino 77
      CEP: 20921-400
      Bairro Imperial de São Cristóvão
      Rio de Janeiro - RJ - Brazil

      On 06/17/2013 10:27 PM, Arthur Snoke wrote:
      It sounds like your python script is simply adding numbers to the sac file header fields without opening SAC. Applying saclst to that file will only return values for filled header values.

      If I am correct, have your script open SAC and do a write over.

      Older versions of programs wsacn had problems because they did not update the header before writing the file. Look at entries in HISTORY.


      On Jun 17, 2013, at 3:26 PM, Stéphane Drouet wrote:

      Dear SAC users,

      I have a question about the header variable DIST. Aren't DIST, as well as AZ or BAZ, automatically computed once the event and station coordinates are set?

      I am using a python script to download sac data, and the script which sets some header information, as for instance event and station coordinates. For some reason, DIST is not computed for some of the files. Using "saclst DIST f file.sac" returns 0. However, if I start sac, read the file, write the header (wh) and close sac, then saclst returns the distance. Is there a way to force sac to compute DIST, AZ and BAZ?

      Best Regards,

      Stéphane
      --
      Stéphane Drouet

      --------------------------------
      Seismologist, PhD
      Observatório Nacional
      Rua General José Cristino 77
      CEP: 20921-400
      Bairro Imperial de São Cristóvão
      Rio de Janeiro - RJ - Brazil



15:53:31 v.01697673