From 91f224ca7bd9b8c4057cb57d2843663043e579f5 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Thu, 25 May 2017 11:13:36 +0800 Subject: sky.py: Add "area()" method XXX/FIXME --------- Consider the spherical coordination and WCS sky projection!! --- fg21sim/sky.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/fg21sim/sky.py b/fg21sim/sky.py index 08ca0df..8f15ca8 100644 --- a/fg21sim/sky.py +++ b/fg21sim/sky.py @@ -86,6 +86,19 @@ class SkyPatch: if infile is not None: 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) @@ -282,6 +295,14 @@ class SkyHealpix: if infile is not None: 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: -- cgit v1.2.2