Skip to content

Commit

Permalink
check type of self to determine is_table
Browse files Browse the repository at this point in the history
  • Loading branch information
esheldon committed Nov 11, 2015
1 parent 354d47a commit 533611b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions fitsio/fitslib.py
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ def write_table(self, data, table_type='binary',
table_type=table_type)

if header is not None:
self[-1].write_keys(header, is_table=True)
self[-1].write_keys(header)
self[-1]._update_info()

self[-1].write(data,names=names)
Expand Down Expand Up @@ -1296,7 +1296,7 @@ def write_key(self, keyname, value, comment=""):
sval,
str(comment))

def write_keys(self, records_in, clean=True, is_table=False):
def write_keys(self, records_in, clean=True):
"""
Write the keywords to the header.
Expand All @@ -1313,8 +1313,6 @@ def write_keys(self, records_in, clean=True, is_table=False):
If True, trim out the standard fits header keywords that are
created on HDU creation, such as EXTEND, SIMPLE, STTYPE, TFORM,
TDIM, XTENSION, BITPIX, NAXIS, etc.
is_table: bool, optional
If set to True, more keywords will be cleaned
Notes
-----
Expand All @@ -1328,6 +1326,7 @@ def write_keys(self, records_in, clean=True, is_table=False):
hdr = FITSHDR(records_in)

if clean:
is_table = isinstance(self, TableHDU)
hdr.clean(is_table=is_table)

for r in hdr.records():
Expand Down

0 comments on commit 533611b

Please sign in to comment.