aboutsummaryrefslogtreecommitdiffstats
path: root/astro
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2017-08-18 12:11:28 +0800
committerAaron LI <aly@aaronly.me>2017-08-18 12:11:28 +0800
commitb59e9b3b8755b8c3bebb91e262c8301556d18f30 (patch)
tree56ddef4ae677f04ce880759df5af7561af1dc78c /astro
parent412ad5def84125a960743b96e0595d52325aafd8 (diff)
downloadatoolbox-b59e9b3b8755b8c3bebb91e262c8301556d18f30.tar.bz2
fitscube.py: Update "DATE" header keyword
Diffstat (limited to 'astro')
-rwxr-xr-xastro/fits/fitscube.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/astro/fits/fitscube.py b/astro/fits/fitscube.py
index 0ad2009..7a03a06 100755
--- a/astro/fits/fitscube.py
+++ b/astro/fits/fitscube.py
@@ -11,7 +11,7 @@ Create FITS image cube from a series of image slices.
import os
import sys
import argparse
-from datetime import datetime
+from datetime import datetime, timezone
import numpy as np
from astropy.io import fits
@@ -132,7 +132,8 @@ class FITSCube:
def write(self, outfile, clobber=False):
header = self.header
header.extend(self.wcs.to_header(), update=True)
- header.add_history(datetime.now().isoformat())
+ header["DATE"] = (datetime.now(timezone.utc).astimezone().isoformat(),
+ "File creation date")
header.add_history(" ".join(sys.argv))
hdu = fits.PrimaryHDU(data=self.data, header=header)
try: