aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/utils/fits.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-10-11 12:29:51 +0800
committerAaron LI <aaronly.me@outlook.com>2016-10-11 12:29:51 +0800
commit344807f49ac8be76517178af877a6a6f6d58a4aa (patch)
tree6badb9fbc3ae73d49d1b6ebd49e02037532b2d0b /fg21sim/utils/fits.py
parenta8ed62510538b02dd415e484cf9019d9a2549839 (diff)
downloadfg21sim-344807f49ac8be76517178af877a6a6f6d58a4aa.tar.bz2
utils: Update documentations, also fix styles
Diffstat (limited to 'fg21sim/utils/fits.py')
-rw-r--r--fg21sim/utils/fits.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/fg21sim/utils/fits.py b/fg21sim/utils/fits.py
index 96b5f58..cef70d1 100644
--- a/fg21sim/utils/fits.py
+++ b/fg21sim/utils/fits.py
@@ -2,7 +2,16 @@
# MIT license
"""
-FITS utilities.
+FITS utilities
+--------------
+
+read_fits_healpix:
+ Read the HEALPix map from a FITS file or a BinTableHDU to 1D array
+ in *RING* ordering.
+
+write_fits_healpix:
+ Write the HEALPix map to a FITS file with proper header as well
+ as the user-provided header.
"""
from datetime import datetime, timezone
@@ -12,6 +21,7 @@ from astropy.io import fits
import healpy as hp
+# Column formats for FITS binary table
# Reference:
# http://docs.astropy.org/en/stable/io/fits/usage/table.html#column-creation
FITS_COLUMN_FORMATS = {
@@ -28,7 +38,7 @@ FITS_COLUMN_FORMATS = {
def read_fits_healpix(filename):
- """Read the HEALPix map from a FITS file or a HDU to 1D array
+ """Read the HEALPix map from a FITS file or a BinTableHDU to 1D array
in *RING* ordering.
Parameters
@@ -40,7 +50,7 @@ def read_fits_healpix(filename):
Returns
-------
data : 1D `~numpy.ndarray`
- HEALPix data in *RING* ordering
+ HEALPix data in *RING* ordering with same dtype as input
header : `~astropy.io.fits.Header`
Header of the input FITS file