diff options
author | Aaron LI <aly@aaronly.me> | 2017-08-18 12:11:28 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-08-18 12:11:28 +0800 |
commit | b59e9b3b8755b8c3bebb91e262c8301556d18f30 (patch) | |
tree | 56ddef4ae677f04ce880759df5af7561af1dc78c /astro/fits | |
parent | 412ad5def84125a960743b96e0595d52325aafd8 (diff) | |
download | atoolbox-b59e9b3b8755b8c3bebb91e262c8301556d18f30.tar.bz2 |
fitscube.py: Update "DATE" header keyword
Diffstat (limited to 'astro/fits')
-rwxr-xr-x | astro/fits/fitscube.py | 5 |
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: |