diff options
author | Aaron LI <aly@aaronly.me> | 2017-06-12 16:08:06 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-06-12 16:08:06 +0800 |
commit | 14c32fbbe8276153395beeac67776254e145357c (patch) | |
tree | 592f4734be3279da8e571a1d4610c2d6ac3cb76c | |
parent | b3cb58da0191f91dbeffd2e2f435f079184acd6b (diff) | |
download | atoolbox-14c32fbbe8276153395beeac67776254e145357c.tar.bz2 |
astro/fits/fitscube.py: Save command to header history
-rwxr-xr-x | astro/fits/fitscube.py | 4 |
1 files changed, 4 insertions, 0 deletions
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) |