-
Notifications
You must be signed in to change notification settings - Fork 94
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
Inherit kd_tree resampler for bilinear interpolation #166
Conversation
da = None | ||
from xarray import DataArray | ||
import dask.array as da | ||
import dask |
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.
F401 'dask' imported but unused
pyresample/kd_tree.py
Outdated
vii_slices=vii_slices, ia_slices=ia_slices, | ||
fill_value=fill_value, | ||
dtype=new_data.dtype, concatenate=True) | ||
#new_axes={'neighbour_dim': self.neighbours}) |
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.
E114 indentation is not a multiple of four (comment)
E116 unexpected indentation (comment)
pyresample/kd_tree.py
Outdated
vii_slices=vii_slices, ia_slices=ia_slices, | ||
fill_value=fill_value, | ||
dtype=new_data.dtype, concatenate=True) | ||
# new_axes={'neighbour_dim': self.neighbours}) |
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.
E116 unexpected indentation (comment)
So far this PR has only made the bilinear interpolation much slower. With the script below, it takes 8 m 40 s for the first run and 4 m 7 s for the second run on my laptop. The same figures for Performance for #!/usr/bin/env python
import glob
from satpy import Scene
fnames = glob.glob('/home/lahtinep/data/satellite/geo/msg/H*')
glbl = Scene(reader='seviri_l1b_hrit', filenames=fnames)
glbl.load(['overview', 'natural_color', 'realistic_colors'])
lcl = glbl.resample('euro4', resampler='bilinear', cache_dir='/tmp')
lcl.save_datasets(base_dir='/tmp') |
@@ -926,11 +930,11 @@ def query_no_distance(target_lons, target_lats, valid_output_index, | |||
if index_array.ndim == 1: | |||
index_array = index_array[:, None] | |||
|
|||
# KDTree query returns out-of-bounds neighbors as `len(arr)` | |||
# KDTree query returns out-of-bounds neighbours as `len(arr)` |
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.
@pnuu We are trying to stick with US English spelling of things now. Your change makes this the UK English. Please undo these changes.
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.
That will break backwards compatibility, neighbours
is used in the method and function names.
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.
True, but not sure comments needed to be changed. I'd be willing to deprecate the old neighbours methods over time (like until a 2.0 release).
I'm closing this as obsolete. All the other changes made after this was created make it hard to directly update. I might revisit this in a new PR started from more up-to-date starting point. |
This PR updates bilinear interpolation so that it inherits
XArrayResamplerNN
as a base.git diff origin/master **/*py | flake8 --diff