From b59e9b3b8755b8c3bebb91e262c8301556d18f30 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Fri, 18 Aug 2017 12:11:28 +0800 Subject: fitscube.py: Update "DATE" header keyword --- astro/fits/fitscube.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'astro/fits') 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: -- cgit v1.2.2