Thread: plotpk and blackboard variable precision

Started: 2012-04-25 15:19:26
Last activity: 2012-04-30 14:41:09
Topics: SAC Help
Neil Selby
2012-04-25 15:19:26
Hello SAC users,


I want to use "plotpk" with the "savelocs on" option to save picks to
blackboard variables, and then do some calculations with the blackboard
variables (specifically, measure amplitude and period in order to
calculate magnitudes).

To do this I need to temporarily unset the time information in the SAC
header, so that plotpk saves the x locations as offsets, rather than as
gmt date-time strings. This is all fine.

However, I find that the blackboard variables saved are not guaranteed
to be of single sample precision, which is necessary especially when
measuring high-frequency signals. This may be simply due to the use of
single-precision values for the blackboard variables, but I notice that
the date-time strings are always given to three decimal places of
seconds, which would be of sufficient precision for my needs, so SAC is
measuring the picks correctly.

Does anybody know how to solve this problem? I either need to save the
blackboard variables with more precision, or manipulate the date-time
strings within SAC. There are obvious ad-hoc work-arounds, such as
cutting the length of the SAC file, but a general solution would be more
useful!

many thanks,

Neil Selby

  • George Helffrich
    2012-04-30 01:20:39
    Dear All -

    If you use the ZERO option to PPK, it will always format the blackboard variable in the way that you want (i.e. not a GMT time) no matter what the header information contains.

    On 25 Apr 2012, at 08:19, Neil Selby wrote:

    Hello SAC users,


    I want to use "plotpk" with the "savelocs on" option to save picks to blackboard variables, and then do some calculations with the blackboard variables (specifically, measure amplitude and period in order to calculate magnitudes).

    To do this I need to temporarily unset the time information in the SAC header, so that plotpk saves the x locations as offsets, rather than as gmt date-time strings. This is all fine.

    However, I find that the blackboard variables saved are not guaranteed to be of single sample precision, which is necessary especially when measuring high-frequency signals. This may be simply due to the use of single-precision values for the blackboard variables, but I notice that the date-time strings are always given to three decimal places of seconds, which would be of sufficient precision for my needs, so SAC is measuring the picks correctly.

    Does anybody know how to solve this problem? I either need to save the blackboard variables with more precision, or manipulate the date-time strings within SAC. There are obvious ad-hoc work-arounds, such as cutting the length of the SAC file, but a general solution would be more useful!

    many thanks,

    Neil Selby

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



    • Neil Selby
      2012-04-30 14:41:09
      George,

      thanks, that does work and is a better idea than unsetting the header time.

      However, it doesn't resolve my main problem, which is that the precision
      of the blackboard variables (which always seems to be six significant
      figures) is not always sufficient to pick to single sample accuracy.

      A work round to this is to write the pick time as a date-time string,
      and then read and convert this to epochal time outside SAC, but it seems
      unfortunate that SAC does not guarantee that individual samples can be
      picked!

      thanks,

      Neil



      George Helffrich wrote:
      Dear All -

      If you use the ZERO option to PPK, it will always format the blackboard variable in the way that you want (i.e. not a GMT time) no matter what the header information contains.

      On 25 Apr 2012, at 08:19, Neil Selby wrote:


      Hello SAC users,


      I want to use "plotpk" with the "savelocs on" option to save picks to blackboard variables, and then do some calculations with the blackboard variables (specifically, measure amplitude and period in order to calculate magnitudes).

      To do this I need to temporarily unset the time information in the SAC header, so that plotpk saves the x locations as offsets, rather than as gmt date-time strings. This is all fine.

      However, I find that the blackboard variables saved are not guaranteed to be of single sample precision, which is necessary especially when measuring high-frequency signals. This may be simply due to the use of single-precision values for the blackboard variables, but I notice that the date-time strings are always given to three decimal places of seconds, which would be of sufficient precision for my needs, so SAC is measuring the picks correctly.

      Does anybody know how to solve this problem? I either need to save the blackboard variables with more precision, or manipulate the date-time strings within SAC. There are obvious ad-hoc work-arounds, such as cutting the length of the SAC file, but a general solution would be more useful!

      many thanks,

      Neil Selby


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

      .




Page built 07:33:43 | v.b'108166