aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/sky.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2017-05-25 11:13:36 +0800
committerAaron LI <aaronly.me@outlook.com>2017-05-25 11:13:36 +0800
commit91f224ca7bd9b8c4057cb57d2843663043e579f5 (patch)
treecad3dd9ed262ad212233a6f2bb5d6d393047a710 /fg21sim/sky.py
parent2303c0b55499fc029519c58fff5a5c83b35143f3 (diff)
downloadfg21sim-91f224ca7bd9b8c4057cb57d2843663043e579f5.tar.bz2
sky.py: Add "area()" method
XXX/FIXME --------- Consider the spherical coordination and WCS sky projection!!
Diffstat (limited to 'fg21sim/sky.py')
-rw-r--r--fg21sim/sky.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/fg21sim/sky.py b/fg21sim/sky.py
index 08ca0df..8f15ca8 100644
--- a/fg21sim/sky.py
+++ b/fg21sim/sky.py
@@ -87,6 +87,19 @@ class SkyPatch:
self.read(infile, frequency)
@property
+ def area(self):
+ """
+ The sky coverage of this patch [ deg^2 ]
+
+ XXX/FIXME
+ ---------
+ Consider the spherical coordination and WCS sky projection!!
+ """
+ ps = self.pixelsize / 60.0 # [ deg ]
+ size = self.xsize * self.ysize
+ return size * ps**2
+
+ @property
def size(self):
return (self.xsize, self.ysize)
@@ -283,6 +296,14 @@ class SkyHealpix:
self.read(infile, frequency)
@property
+ def area(self):
+ """
+ The sky coverage of this HEALPix map, i.e., all sky,
+ unit [ deg^2 ]
+ """
+ return 4*np.pi * np.rad2deg(1)**2
+
+ @property
def shape(self):
if self.data is not None:
return self.data.shape