-
Notifications
You must be signed in to change notification settings - Fork 169
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
Inca motion vector (#376) #409
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks @aitaten this looks very cool! I left few initial comments to get started with the review
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.
"correlation" sounds a bit too vague, can we use a more precise name? is this approach equivalent to "TREC"?
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.
TREC stands for tracking radar echo by cross-correlation (TREC). So I would say it is quite equivalent. I will change the name accordingly
|
||
return IS_tmp, JS_tmp | ||
|
||
else: |
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.
don't need this since the function won't be executed without numba
With *T* > 2, all the resulting obtained vectors are pooled together for | ||
the final interpolation on a regular grid. | ||
|
||
settings: dict, optional |
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.
where are these settings documented? can't we convert this dictionary into optional arguments?
Optional dictionary containing keyword arguments for the correlation | ||
based algorithm. | ||
|
||
interp_method: {"idwinterp2d", "rbfinterp2d"}, optional |
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.
out of curiosity, what approach uses INCA to densify the motion field?
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 does a cubic interpolation. I can also implemented if you want ... but again, It is done with numba :(
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.
do you think it could be added as an additional interpolator in the pysteps/utils/interpolate.py module? (I wouldn't mind the numba optional requirement)
if NUMBA_IMPORTED: | ||
|
||
@jit(nopython=True) | ||
def compute_motion_numba(image1, image2, NI, NJ, nthin, IS_tmp, JS_tmp): |
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't we simply have a non accelerated version in case numba is not installed instead of throwing an error?
nr_fields = input_images.shape[0] | ||
domain_size = (input_images.shape[1], input_images.shape[2]) | ||
|
||
PMIN = settings.get("PMIN", 0.05) |
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.
we usually use ALL_CAPS names for global constants only.
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.
Thanks ... I did some changes on these and other variables
pysteps/tests/test_motion.py
Outdated
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.
need to add numba to the test requirements
Co-authored-by: Daniele Nerini <[email protected]>
Co-authored-by: Daniele Nerini <[email protected]>
Introduction of the correlation based motion vector computation as is currently computed in INCA. The error motion computation, and the NWP vector wind correction has not been included. However, this correlation based computation is similar to the original TREC computation adding a new OF method. The original idea is coming from #376