aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim
diff options
context:
space:
mode:
Diffstat (limited to 'fg21sim')
-rw-r--r--fg21sim/sky.py36
1 files changed, 35 insertions, 1 deletions
diff --git a/fg21sim/sky.py b/fg21sim/sky.py
index eb9f824..99de963 100644
--- a/fg21sim/sky.py
+++ b/fg21sim/sky.py
@@ -9,6 +9,7 @@ maps.
import os
import logging
import copy
+from datetime import datetime, timezone
import numpy as np
from scipy import ndimage
@@ -85,7 +86,10 @@ class SkyBase:
The frequency of the sky image.
Unit: [MHz]
"""
- return self.frequency_
+ if self.frequency_ is not None:
+ return self.frequency_
+ else:
+ return self.header_.get("FREQ", None)
@frequency.setter
def frequency(self, value):
@@ -95,6 +99,36 @@ class SkyBase:
"""
self.frequency_ = value
+ @property
+ def creator(self):
+ """
+ The creator of the sky image.
+ """
+ if self.creator_ is not None:
+ return self.creator_
+ else:
+ return self.header_.get("CREATOR", None)
+
+ @creator.setter
+ def creator(self, value):
+ """
+ Set the creator of the sky image.
+ """
+ self.creator_ = value
+
+ @property
+ def header(self):
+ """
+ The FITS header of the current sky.
+ """
+ hdr = self.header_.copy()
+ hdr["SkyType"] = (self.type_, "Patch / HEALPix")
+ hdr["PixSize"] = (self.pixelsize, "Pixel size [arcsec]")
+ hdr["CREATOR"] = (self.creator, "Sky Creator")
+ hdr["DATE"] = (datetime.now(timezone.utc).astimezone().isoformat(),
+ "File creation date")
+ return hdr
+
def copy(self):
"""
Return a (deep) copy of this instance.