aboutsummaryrefslogtreecommitdiffstats
path: root/astro/fits
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-10-31 21:30:59 +0800
committerAaron LI <aly@aaronly.me>2017-10-31 21:30:59 +0800
commit4c7ace523dcef8f022d16bf9ea09eddfe1824cfd (patch)
treec94f658ef6d54ef12c238d13b8ad2f4b323fe432 /astro/fits
parentec48338fd90bcabc7721524cfa43b8198cf8f478 (diff)
downloadatoolbox-4c7ace523dcef8f022d16bf9ea09eddfe1824cfd.tar.bz2
astro/fitscube.py: Fix header property handling
Diffstat (limited to 'astro/fits')
-rwxr-xr-xastro/fits/fitscube.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/astro/fits/fitscube.py b/astro/fits/fitscube.py
index 7a03a06..65b410c 100755
--- a/astro/fits/fitscube.py
+++ b/astro/fits/fitscube.py
@@ -100,10 +100,9 @@ class FITSCube:
@property
def header(self):
- try:
- return self.header_
- except AttributeError:
- return fits.Header()
+ if not hasattr(self, "header_"):
+ self.header_ = fits.Header()
+ return self.header_
@header.setter
def header(self, value):