-
Notifications
You must be signed in to change notification settings - Fork 19
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
Allow 'nearest_dtos' 2-d regridding to work with discrete sampling geometry source grids #833
base: main
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.
One question mostly for my understanding, but overall this is great and will be really useful for VISION work. Please merge once you've fixed one typo. Thanks.
src = src.copy() | ||
src[6:8] = cf.masked | ||
# This following element should be smaller, because it | ||
# now only has two source cells conrtibuting to it, |
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.
# now only has two source cells conrtibuting to it, | |
# now only has two source cells contributing to it, |
elif method == "nearest_dtos": | ||
# 3) Nearest neighbour dtos method: | ||
# | ||
# Set to 0 any weight that corresponds to a masked source |
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.
To check my understanding of this via the maths, am I correct in deducing that the ultimate dot product deals with the fact that, if we set to zero for masked source points (which is the only sensible option IMO so I agree is the way) then we are effectively using less points as sources, i.e. instead of shape (J, I) weights matrix as described here:
weights: `scipy.sparse.spmatrix` The sparse weights matrix that defines the regridding operation. Might be modified (not in-place) to account for missing data in *a*. Must have shape ``(J, I)``, where ``J`` is the number of destination grid cells and ``I`` is the number of source grid cells.
we now really have (J, I - M) where M is the number of masked source points? So I can convince myself the reduction in total source points is accounted for in the calculation. Reminding myself about dot products I think it will, but it would be good to get confirmation. Thanks.
Fixes #832