aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-31 21:50:16 +0800
committerAaron LI <aly@aaronly.me>2017-10-31 21:50:16 +0800
commitfcb344b61c0b92e617068956d17e86cae83dd96a (patch)
tree8fbf4071ca29a5dda39f67c2c9ee57f6da3af24e /astro
parent261d80f7272bedea0c26d660fdf1e104fcad7b4f (diff)
downloadatoolbox-fcb344b61c0b92e617068956d17e86cae83dd96a.tar.bz2
astro/fitscube.py: Fix conflict on property "slices"
Diffstat (limited to 'astro')
-rwxr-xr-xastro/fits/fitscube.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/astro/fits/fitscube.py b/astro/fits/fitscube.py
index 5616c2d..2c9a4fc 100755
--- a/astro/fits/fitscube.py
+++ b/astro/fits/fitscube.py
@@ -39,20 +39,20 @@ class FITSCube:
# The Z-axis step/spacing between slices.
self.zstep = self.header["CDELT3"]
- def add_slices(self, slices, zbegin=0.0, zstep=1.0):
+ def add_slices(self, infiles, zbegin=0.0, zstep=1.0):
"""
Create a FITS cube from input image slices.
"""
- self.slices = slices
+ self.infiles = infiles
self.zbegin = zbegin
self.zstep = zstep
- nslice = len(slices)
- header, image = self.open_image(slices[0])
+ nslice = len(infiles)
+ header, image = self.open_image(infiles[0])
shape = (nslice, ) + image.shape
data = np.zeros(shape, dtype=image.dtype)
- for i, s in enumerate(slices):
- print("[%d/%d] Adding image slice: %s ..." % (i+1, nslice, s))
- hdr, img = self.open_image(s)
+ for i, fn in enumerate(infiles):
+ print("[%d/%d] Adding image slice: %s ..." % (i+1, nslice, fn))
+ hdr, img = self.open_image(fn)
data[i, :, :] = img
self.data = data
self.header = header.copy(strip=True)