-
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
Check area slices for correct step #275
Conversation
Codecov Report
@@ Coverage Diff @@
## master #275 +/- ##
==========================================
+ Coverage 91.97% 92.01% +0.04%
==========================================
Files 42 42
Lines 8208 8228 +20
==========================================
+ Hits 7549 7571 +22
+ Misses 659 657 -2
Continue to review full report at Codecov.
|
I still get a segfault when trying to use this with pytroll/satpy#1188 when loading the area definition from the yaml file, but not when defining it inline. I'm trying to figure out what's going on. |
My previous comment was a lie. It does also fail when defining it inline; I still had the Specifically, this still segfaults: from satpy import Scene
from satpy.utils import debug_on
from pyresample import create_area_def
debug_on()
from glob import glob
area = create_area_def("fci_0deg_2km",
{"proj": "geos", "lon_0": 0, "h": 35786400, "x_0": 0, "y_0": 0, "ellps": "WGS84"},
units="m",
shape=(5568, 5568),
area_extent=(-5567999.994206558, -5567999.994200589,
5567999.994206558, 5567999.994200589))
sc = Scene(glob("/media/nas/x21308/2020_04_MTG_unofficial_Testdata/20130804_RC72/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--L2P-NC4E_C_EU*.nc"), reader="fci_l1c_fdhsi")
sc.load(["ir_123"])
nsc = sc.resample(area)
nsc.save_dataset("ir_123", "/tmp/ir_123.tif") Meanwhile, this completes successfully (previously from satpy import Scene
from satpy.utils import debug_on
from pyresample import create_area_def
debug_on()
from glob import glob
area = create_area_def("fci_0deg_2km",
{"proj": "geos", "lon_0": 0, "h": 35786400, "x_0": 0, "y_0": 0, "ellps": "WGS84"},
units="m",
shape=(5568//10, 5568//10),
area_extent=(-5567999.994206558/10, -5567999.994200589/10,
5567999.994206558/10, 5567999.994200589/10))
sc = Scene(glob("/media/nas/x21308/2020_04_MTG_unofficial_Testdata/20130804_RC72/W_XX-EUMETSAT-Darmstadt,IMG+SAT,MTI1+FCI-1C-RRAD-FDHSI-FD--CHK-BODY--L2P-NC4E_C_EU*.nc"), reader="fci_l1c_fdhsi")
sc.load(["ir_123"])
nsc = sc.resample(area)
nsc.save_dataset("ir_123", "/tmp/ir_123.tif") |
After the segmentation fault, the last line in
|
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. An explanation of what problem was solved in the description of the PR would be nice :)
Added explanation, and merging. |
This PR makes sure that the
slice(start, stop, step)
has correct sign for thestep
argument whenstart > stop
when slicing the area.git diff origin/master **/*py | flake8 --diff