From 14c32fbbe8276153395beeac67776254e145357c Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Mon, 12 Jun 2017 16:08:06 +0800 Subject: astro/fits/fitscube.py: Save command to header history --- astro/fits/fitscube.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'astro') diff --git a/astro/fits/fitscube.py b/astro/fits/fitscube.py index 8effc75..df72351 100755 --- a/astro/fits/fitscube.py +++ b/astro/fits/fitscube.py @@ -9,7 +9,9 @@ Create FITS image cube from a series of image slices. """ import os +import sys import argparse +from datetime import datetime import numpy as np from astropy.io import fits @@ -67,6 +69,8 @@ class FITSCube: return w def write(self, outfile, clobber): + self.header.add_history(datetime.now().isoformat()) + self.header.add_history(" ".join(sys.argv)) hdu = fits.PrimaryHDU(data=self.data, header=self.header) try: hdu.writeto(outfile, overwrite=clobber) -- cgit v1.2.2