Thread: Fwd: SAC header and Pyweed

Started: 2022-05-25 20:53:00
Last activity: 2022-05-25 20:53:00
Topics: PyWEED Help
Ben Mansour, Walid
2022-05-25 20:53:00
Dear all,


I am writing to you because I am using pyweed and I noticed the absence GCARC in my sac header and LCALDA =FALSE. Is there a way to include GCARC in my header?

Cheers,

Walid



Begin forwarded message:

From: Walid Ben Mansour <walid<at>wustl.edu>
Subject: Re: SAC header and Pyweed
Date: May 25, 2022 at 3:51:07 PM CDT
To: Adam Clark <adam<at>iris.washington.edu>

Hi Adam,

I am writing to you because I am using pyweed and I noticed the absence GCARC in my sac header and LCALDA =FALSE. Is there a way to include GCARC in my header?

Cheers,

Walid


On Jan 11, 2021, at 4:12 PM, Adam Clark <adam<at>iris.washington.edu <adam<at>iris.washington.edu>> wrote:

Hi Walid,

I can see how having the data relative to event time could be useful; I will look into adding an option for this in the next version.

As Rob points out, the headers can be edited, and the headers already include the necessary offset.
I found an example shifting the reference time in the ObsPy docs:
https://docs.obspy.org/packages/autogen/obspy.io.sac.sactrace.html#reference-time-and-relative-time-headers

Based on that, I think you could do something like this on existing files to get what you need:

from obspy.io.sac.sactrace import SACTrace

sac = SACTrace.read('IU.FURI.00.BH1_2020-10-22T03_13_16.265_2020-10-22T03_24_16.265.sac')
# Shift reftime by offset
sac.reftime += sac.o
# Set the reftime type
sac.iztype = 'io'
# Mark the beginning as arrival time
sac.a = sac.b
sac.save()

Cheers,
Adam

----------------------
Adam Clark
Web Developer / Admin
IRIS Data Management Center
adam<at>iris.washington.edu <adam<at>iris.washington.edu>



On Jan 11, 2021, at 10:10 AM, Adam Clark <adam<at>iris.washington.edu <adam<at>iris.washington.edu>> wrote:

Hi Walid,

Looking at the PyWEED code, it does try to add the event information to SAC output. I'm not sure exactly which headers this goes into, or whether it's using the proper time information, though. Let me dig into this a bit more and get back to you.

Cheers,
Adam

----------------------
Adam Clark
Web Developer / Admin
IRIS Data Management Center
adam<at>iris.washington.edu <adam<at>iris.washington.edu>



On Jan 11, 2021, at 8:04 AM, Robert Casey <rob<at>iris.washington.edu <rob<at>iris.washington.edu>> wrote:


Hi Walid-

I apologize for the delay. I was away from my desk the end of last week.

Since you are using PyWEED, I'll relay your question to the developer of that tool.

From what I can see in your example, it would suggest to me that the SAC file was created without an origin time to work off for the travel time offset. I don't know if PyWEED does this on purpose or if the event origin you used contained incomplete information. Have you seen this happen before?

You listed an AMARKER entry with no value. Is that what you are asking for? This is the first P arrival marker.

If IZTYPE is set to BEGIN TIME, then that means this dataset is time marked from the start of data. I think that's generally how our utilities mark the reference time.

It would seem to make sense to mark the OMARKER offset time if the dataset were large enough, but if the data is cut relative to P arrival, I should think that AMARKER would be used instead.

All of this is speculation, though, since I haven't worked with PyWEED in a while and I think that our developer, Adam, might be able to shed some more light on the logic of the utility.

If you want to change the header values manually in SAC, you might want to look at the CHNHDR command:

http://ds.iris.edu/files/sac-manual/commands/chnhdr.html

Regards,

-Rob


On Jan 7, 2021, at 2:49 PM, Anh Ngo <anh<at>iris.washington.edu <anh<at>iris.washington.edu>> wrote:

Hi Walid,
Nick is no longer with IRIS.
Maybe Rob Casey can help you with this.

Cheers,
Anh

----- Original Message -----
From: "Walid Ben Mansour" <walid<at>wustl.edu <walid<at>wustl.edu>>
To: "Nick Falco" <nick<at>iris.washington.edu <nick<at>iris.washington.edu>>, "anh" <anh<at>iris.washington.edu <anh<at>iris.washington.edu>>
Sent: Thursday, January 7, 2021 2:42:42 PM
Subject: SAC header and Pyweed

Dear,

I am writing to you because I have some issues with the AIMBAT package (seismological python pack) and I wonder if it is not an issue with how I extract my SAC files. I have already manipulated SAC files, but here I am tracking the differences between my SAC files and the examples provided with AIMBAT.

I use PyWEED, and I wonder how can I get in my SAC headers the following info:
AMARKER
OMARKER: 0.0
IZTYPE : EVENT ORIGIN TIME (and NOT BEGIN TIME)

Cheers

Walid






Attachments
11:37:10 v.22510d55