aboutsummaryrefslogtreecommitdiffstats
path: root/astro/fits
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-06-12 16:08:06 +0800
committerAaron LI <aly@aaronly.me>2017-06-12 16:08:06 +0800
commit14c32fbbe8276153395beeac67776254e145357c (patch)
tree592f4734be3279da8e571a1d4610c2d6ac3cb76c /astro/fits
parentb3cb58da0191f91dbeffd2e2f435f079184acd6b (diff)
downloadatoolbox-14c32fbbe8276153395beeac67776254e145357c.tar.bz2
astro/fits/fitscube.py: Save command to header history
Diffstat (limited to 'astro/fits')
-rwxr-xr-xastro/fits/fitscube.py4
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)