-
Notifications
You must be signed in to change notification settings - Fork 20
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
Low-freq proc #470
Low-freq proc #470
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #470 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 118 118
Lines 9670 9700 +30
=======================================
+ Hits 9656 9686 +30
Misses 14 14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ahmadtourei, it's looking good so far. I just have two main suggestions.
-
It would be nice if the delta patch wasn't restricted to time/distance if you pass in a template patch. I provided the code that (probably) fixes that.
-
Do you think we could make the recipe executable? That way, we will have much more assurance the code continues to work as DASCore evolves (or the docs wont build). Moreover, we aren't using any dependencies we don't want to include like we did in the other non-executable recipes (eg the MPI one) so I don't see why not as long as the example spool is small, but maybe you have a reason I didn't think of?
docs/recipes/low_freq_proc.qmd
Outdated
# Resample the low-passed filter patch | ||
new_time_ax = np.arange(delta_pa.attrs["time_min"], delta_pa.attrs["time_max"], np.timedelta64(dt, "s")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you just use patch.resample
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently, they do not provide the same results:
import numpy as np
import dascore as dc
pa = dc.get_example_patch()
dt = 5
resampled_pa = pa.resample(time=np.timedelta64(dt, 's')) # has one time sample at zero
new_time_ax = np.arange(pa.attrs["time_min"], pa.attrs["time_max"], np.timedelta64(dt, "s"))
interpolated_pa = pa.interpolate(time=new_time_ax) # has two time samples at 0 second and 5 seconds, as it should because the patch has 8 seconds
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that is odd. I think #10 might be related.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't worked with patch.resample()
much; do you think this behavior is expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In both cases they are just calling underlying scipy functions so I don't think there is much we can do about it anyway.
Feel free to merge when you are happy with it. Do make sure the docs build before you do though. |
Thanks for your input and review! Let's merge the get_name branch first and then I'll merge this. |
The AttributeError: module 'dascore.io.segy.core' has no attribute 'SegyV2' I've merged master branch (after having the optional_segyio branch merged into the master's). Any thoughts on how this can be fixed? @d-chambers |
Yes, this is a quirk of python's entry points. Any time you change them (eg with the IO functions) you have to re-install dascore. Try re-installing. Merging |
@d-chambers The only thing left here is resolving #474. It will be ready to merge after addressing that issue. |
Description
This PR adds a recipe for the low-frequency processing routine. It also adds a delta patch (with unit value at the center of time or distance dimensions and zeros elsewhere) as an example patch.
This PR, in conjunction with #341, deprecates DASDAE's low-freq-real-time package.
Checklist
I have (if applicable):