Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

response called after rotate in stream.py #35

Open
filefolder opened this issue Oct 25, 2022 · 3 comments · May be fixed by #37
Open

response called after rotate in stream.py #35

filefolder opened this issue Oct 25, 2022 · 3 comments · May be fixed by #37
Assignees
Labels
bug Something isn't working

Comments

@filefolder
Copy link

hello, there is a minor issue when dealing with 12Z etc channels in stream.py.

currently they are rotated FIRST (which rotates 12Z to a ZNE frame), and then the inventory is used to remove the response AFTERWARDS. this will cause an inventory error because the newly rotated "ZNE" channels are not in the inventory, only the original "12Z". the solution is to simply just rotate after removing the response.

another related issue involves the "components" kwarg in rotate(). I don't think this is necessary anymore in obspy, and in fact it seems to cause a lot of additional issues. rotating frames works fine just with st.rotate(method="->ZNE", inventory=inv)

@nikosT
Copy link
Owner

nikosT commented Oct 25, 2022

Hi @filefolder, it seems that you are right. In our cases, it is very uncommon to have this orientation.
Could you please try just to alter this line, in file https://github.com/nikosT/Gisola/blob/main/src/stream.py#L275, and change the inventory=inv to inventory=None or completely remove the expression?

That will now be:

        st.remove_response(inventory=None, 
                       output='VEL', # output units in Velocity (m/s)
                       pre_filt=(0.001, 0.002, 8, 9), # bandpass frqs (Hz)
                       zero_mean=True, # detrend(demean)
                       taper=True, # cos taper from f1 to f2 and from f3 to f4
                       taper_fraction=0.05 # percentage of tapering
                       )

Because, now Obspy will try to get the response from stats.response which exists cause of the st.attach_response(inv) execution, before the rotation.

Please, let us know if that worked for you.

@filefolder
Copy link
Author

Thanks, technically that solves the issue if you prefer to rotate before removing response. I think 12Z is the standard FDSN convention orientation for both borehole and OBS sites so it comes up a lot in my experience.

@nikosT
Copy link
Owner

nikosT commented Jun 26, 2023

This issue occurred to another user also. The PR suppose to solve it, however, other implications are happening by merging it into the main code (probably in the stations' info storing/plotting).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants