-
Notifications
You must be signed in to change notification settings - Fork 229
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
A utility for interpolation and resampling #595
Comments
I would say so yes, Could be a good short project. |
Trying to work my way in this issue. I'm new to Devito framework and code base. It seems to me that a proper place to generalize to more interpolator types, like the ones suggested by @navjotk, is in https://github.com/devitocodes/devito/blob/master/devito/operations/interpolators.py. More classes can be added there that implement other types of interpolation, on top of the currently implemented linear interpolation. Any thoughts? |
yes, I agree @YanivHollander . |
Inject operation is unclear to me. (bi)linear interpolation from regular to sparse grid seems to be working fine. Injection back from sparse grid to regular one is less convincing Which algorithm is employed for injection under LinearInterpolator? Python: |
It's linear, the injection is the adjoint of interpolation, so same bilenear coefficietns except it's a scatter instead of a gather. |
I need some guidance on the following:
|
|
So I think the rationale behind this issue was to combine the interpolation in space and time and move to a common place and @YanivHollander seems to be going there in the last comment. |
Hi, Out of all the options to interpolate in space, I didn't find any consideration of spline in space. That's what I meant, @mloubout, in point number 4. |
Over time the work on resampling input data in time and the spatial interpolation of off-grid points seem to have a lot of overlap and this could be cleanly set out in a set of utility functions/classes. I was looking at some existing implementations that we should try and use wherever possible, with @ggorman a few weeks ago, and I am now putting these up in an issue to enable discussion to make this more concrete.
I understand that scipy.signal.firwin can be used to precompute the coefficients required to use the
PrecomputedSparseFunction
class in devito. This can also be used to resample incoming data in time. I also believe that scipy.signal.lfilter is (functionally) scipy's counterpart ofPrecomputedSparseFunction
- although only in a single dimension.Scipy also provides full resampling implementations in the form of scipy.signal.resample and scipy.signal.resample_poly. IIRC,
resample
only works for integer multiples because it uses FFT. I'm not sure why we can't useresample_poly
, though.Scipy also provides direct functions for computing Kaiser-function [1] based interpolation like scipy.signal.kaiserord and scipy.signal.kaiser_beta.
I didn't find any ready implementations of Lanczos-filter based interpolation in scipy. However, I did find an implementation in ObsPy.
References:
[1] Hicks, Graham J. "Arbitrary source and receiver positioning in finite-difference schemes using Kaiser windowed sinc functions." Geophysics 67, no. 1 (2002): 156-165.
The text was updated successfully, but these errors were encountered: