We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf983bb commit d621316Copy full SHA for d621316
fitsio/hdu/image.py
@@ -278,8 +278,11 @@ def _read_image_slice(self, arg):
278
step = -1
279
280
# Sanity checks for proper syntax.
281
- if (step > 0 and stop < start) or (step < 0 and start < stop):
+ if ((step > 0 and stop < start)
282
+ or (step < 0 and start < stop)
283
+ or (start == stop)):
284
return numpy.empty(0, dtype=npy_dtype)
285
+
286
if start < 0:
287
start = dims[dim] + start
288
@@ -293,6 +296,7 @@ def _read_image_slice(self, arg):
293
296
294
297
if stop > dims[dim]:
295
298
stop = dims[dim]
299
300
if stop < start:
301
# A little black magic here. The stop is offset by 2 to
302
# accommodate the 1-offset of CFITSIO, and to move past the end
0 commit comments