diff options
author | Aaron LI <aly@aaronly.me> | 2017-10-31 21:30:59 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-10-31 21:30:59 +0800 |
commit | 4c7ace523dcef8f022d16bf9ea09eddfe1824cfd (patch) | |
tree | c94f658ef6d54ef12c238d13b8ad2f4b323fe432 /astro/fits | |
parent | ec48338fd90bcabc7721524cfa43b8198cf8f478 (diff) | |
download | atoolbox-4c7ace523dcef8f022d16bf9ea09eddfe1824cfd.tar.bz2 |
astro/fitscube.py: Fix header property handling
Diffstat (limited to 'astro/fits')
-rwxr-xr-x | astro/fits/fitscube.py | 7 |
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): |