-
Notifications
You must be signed in to change notification settings - Fork 96
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
Remove chunks that do not intersect target area in gradient search resampling #282
Conversation
The problem with ABI was my assumption of how the chunks are reordered for processing. The stepping goes first in Y direction, then in X. I've got it reversed. It works wit Seviri because there are only one chunk in X direction. |
So now after your last fix the ABI image is correct? |
The last commit fixed the chunk collection for ABI, so here are some timing results for ABI L1b (reduced resolution via Eumetcast) for three RGBs (
The six chunks that were used in processing are shown in the above image in blue surrounding the black target area. conus_5km:
description: Continental USA, 5 km resolution
projection:
proj: laea
a: 6370997.0
b: 6370997.0
lat_0: 50.0
lon_0: -100.0
shape:
height: 669
width: 1027
area_extent:
lower_left_xy: [-2864809.2037627744, -2830762.316377244]
upper_right_xy: [2268528.5715566175, 514757.94726551295] |
According to |
With this latest commit, the timings are
For ABI there's a slight improvement even with this rather small target area, and with larger target area (= more chunks) the gain would be larger. There's zero gain for SEVIRI as all the used source chunks cover all the target chunks. |
Another test with 1 km CONUS area (3345 x 5135) and ABI:
Pretty significant jump from the To get the most of the target chunk filtering, we'd need to pre-compute all the boundary polygons, but I didn't find a way to pass them via |
After the last major restructuring (pair-up the input and output chunks for processing) the 1 km CONUS case takes 1 m 13 s to process and uses 10 GB of memory. The previous iteration used only 2.5 GB, so next I need to look at reducing the memory usage. |
The memory consumption is now solved. I was doing a lot of unnecessary padding, stacking and |
Appveyor doesn't seem to be using conda to install the packages, so I don't know how to fix the linux build error. |
I copied some fixes from #247 so that the arrays passed to Cython code are read-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.
LGTM, thanks for adding the pre-checks! I have two small inline comments that needs to be fixed.
setup.cfg
Outdated
@@ -1,5 +1,5 @@ | |||
[bdist_rpm] | |||
requires=python3-numpy pykdtree python3-numexpr pyproj python3-configobj | |||
requires=python3-numpy pykdtree python3-numexpr pyproj python3-configobj shapely |
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.
this should be python3-shapely
in RHEL8
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.
Updated.
pyresample/gradient/__init__.py
Outdated
return dst_poly | ||
|
||
def get_chunk_mappings(self): | ||
"""""" |
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.
You can do better :)
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.
Ooops.
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.
Docstring added.
Codecov Report
@@ Coverage Diff @@
## master #282 +/- ##
=========================================
Coverage ? 92.55%
=========================================
Files ? 43
Lines ? 9018
Branches ? 0
=========================================
Hits ? 8347
Misses ? 671
Partials ? 0
Continue to review full report at Codecov.
|
This PR adds filtering to gradient search resampling that discards source data chunks that do not intersect the target area.
The gradient search is now an optional mode, and requires
shapely
to be installed.With this PR the following work with gradient search resampling:
resampling of datasets with different resolutions
resampling of datasets that previously failed with
IndexError: Bad index
because chunks had incompatible shapesresampling of data with
AreaDefinition
resampling of data with
SwathDefinition
with "smooth" coordinates (= not VIIRS, MODIS, point data)Tests added
Tests passed
Passes
git diff origin/master **/*py | flake8 --diff