From 13971c087956d3414b0cbcea122f091e4f19db2c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sun, 13 Aug 2017 19:22:49 +0800 Subject: sky.py: Add "add_header()" method Signed-off-by: Aaron LI --- fg21sim/sky.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fg21sim/sky.py') diff --git a/fg21sim/sky.py b/fg21sim/sky.py index e019b2a..b100a8d 100644 --- a/fg21sim/sky.py +++ b/fg21sim/sky.py @@ -186,6 +186,15 @@ class SkyBase: "File creation date") return hdr + def add_header(self, key, value, comment=None): + """ + Add/update a key to the FITS header. + """ + if comment is None: + self.header_[key] = value + else: + self.header_[key] = (value, comment) + def copy(self): """ Return a (deep) copy of this instance. -- cgit v1.2.2