Thread: Help with LINEFIT

Started: 2019-04-17 17:10:40
Last activity: 2019-04-18 09:50:06
Topics: SAC Help
Mitchell Liddell
2019-04-17 17:10:40
Hello,

I am using LINEFIT to calculate the slope of a particular function in SAC.
The process seems to work, but the results are not written into the header
like the manual page indicates they should be:

"...the linear fit are written to blackboard variables SLOPE, YINT,
SDSLOPE, SDYINT, SDDATA and CORRCOEF respectively.."

In my case I receive an output like:

SAC> r CS.ph
SAC> linefit
Slope and standard deviation are: 0.87509 0.0053469
Intercept and standard deviation are: 0.37646 0.15027
Data standard deviation is: 1.7514
Data correlation coefficient is: 0.9906


But the header variables for SLOPE etc. are all empty. Can you help with
this?

Thank you!

Mitch V. Liddell




--
Mitch V. Liddell, PhD
Postdoctoral Researcher
University of Alberta
587-372-5060

  • Leigh House
    2019-04-17 18:07:04
    Mitch,

    Another sac-help user, Januka, has replied and referred you to an earlier message thread. And that may solve your problem.

    But, if I understand your problem correctly, you want to save the blackboard values that LINEFIT produces. And that is a bit different from what is in the message thread Januka referred to. Nevertheless, you should read the message thread Januka referred to, since it may help you soon, if not with this particular problem.

    Here is a description of header and blackboard variables that may help you do that.

    SAC header and SAC blackboard variables are actually two very different places to store information.

    SAC header variables can be written into the SAC data file, and thus, be saved. But this is not automatic. You need to give the SAC command ‘writehdr’ (without the ‘') to actually write any new SAC header values out to the SAC data file. Otherwise, those new values will go away when you quit SAC or after you read a new trace into SAC.

    SAC blackboard variables are similar to what you might write on a blackboard and are temporary. They go away when you quit SAC.

    The entry for LINEFIT in the SAC manual is confusing, since it states that LINEFIT “writes results to header blackboard variables”. I’ve not used LINEFIT, but am familiar with SAC header variables, and I don’t recognize any of the variables referred to in the LINEFIT description (SLOPE, YINT and so on) as SAC header variables.

    But, you can use the SAC ‘writebbf' command to write the blackboard variables to a separate file, one that is distinct from the SAC data file. There is another SAC command ‘readbbf' to read blackboard variables from the file.

    You should look at the SAC manual for a fuller description of these commands.

    Good Luck,
    Leigh

    On Apr 17, 2019, at 5:15 PM, Mitchell Liddell <liddell<at>ualberta.ca> wrote:

    Hello,

    I am using LINEFIT to calculate the slope of a particular function in SAC. The process seems to work, but the results are not written into the header like the manual page indicates they should be:

    "...the linear fit are written to blackboard variables SLOPE, YINT, SDSLOPE, SDYINT, SDDATA and CORRCOEF respectively.."

    In my case I receive an output like:

    SAC> r CS.ph
    SAC> linefit
    Slope and standard deviation are: 0.87509 0.0053469
    Intercept and standard deviation are: 0.37646 0.15027
    Data standard deviation is: 1.7514
    Data correlation coefficient is: 0.9906


    But the header variables for SLOPE etc. are all empty. Can you help with this?

    Thank you!

    Mitch V. Liddell




    --
    Mitch V. Liddell, PhD
    Postdoctoral Researcher
    University of Alberta
    587-372-5060

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


  • Geo .
    2019-04-18 09:50:06
    Hi Mitch,
    This has been discussed previously. Please see this thread
    https://ds.iris.edu/message-center/thread/1796/

    Januka Attanayake
    Research Fellow | Earthquake Seismology
    Homepage: *https://sites.google.com/site/janukaattanayake
    https://sites.google.com/site/janukaattanayake*

    School of Earth Sciences | McCoy Bldg. 200
    University of Melbourne | Parkville 3010 VIC
    Australia




    On Thu, 18 Apr 2019 at 09:16, Mitchell Liddell <liddell<at>ualberta.ca> wrote:

    Hello,

    I am using LINEFIT to calculate the slope of a particular function in SAC.
    The process seems to work, but the results are not written into the header
    like the manual page indicates they should be:

    "...the linear fit are written to blackboard variables SLOPE, YINT,
    SDSLOPE, SDYINT, SDDATA and CORRCOEF respectively.."

    In my case I receive an output like:

    SAC> r CS.ph
    SAC> linefit
    Slope and standard deviation are: 0.87509 0.0053469
    Intercept and standard deviation are: 0.37646 0.15027
    Data standard deviation is: 1.7514
    Data correlation coefficient is: 0.9906


    But the header variables for SLOPE etc. are all empty. Can you help with
    this?

    Thank you!

    Mitch V. Liddell




    --
    Mitch V. Liddell, PhD
    Postdoctoral Researcher
    University of Alberta
    587-372-5060

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


18:45:43 v.22510d55