diff options
author | Aaron LI <aly@aaronly.me> | 2017-07-19 16:34:40 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-07-19 16:34:40 +0800 |
commit | 9b7f99bbd0eca0e611601dd936c1f7948f8cd58a (patch) | |
tree | cde8dd145d1a560213fa1f4eacefe9ad80b7e40b /fg21sim/utils/wcs.py | |
parent | bfc2b52d6c12553290742fcf793e48b1133e7dad (diff) | |
download | fg21sim-9b7f99bbd0eca0e611601dd936c1f7948f8cd58a.tar.bz2 |
Use [arcsec] as the unit for pixel size and resolution
Signed-off-by: Aaron LI <aly@aaronly.me>
Diffstat (limited to 'fg21sim/utils/wcs.py')
-rw-r--r-- | fg21sim/utils/wcs.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/fg21sim/utils/wcs.py b/fg21sim/utils/wcs.py index b4a9ed1..3cb76b9 100644 --- a/fg21sim/utils/wcs.py +++ b/fg21sim/utils/wcs.py @@ -8,6 +8,8 @@ Create WCS for sky projection. import numpy as np from astropy.wcs import WCS +from .units import UnitConversions as AUC + def make_wcs(center, size, pixelsize, frame="ICRS", projection="TAN"): """ @@ -16,11 +18,13 @@ def make_wcs(center, size, pixelsize, frame="ICRS", projection="TAN"): Parameters ---------- center : (xcenter, ycenter) float tuple - The equatorial/galactic coordinate of the sky/image center [ deg ]. + The equatorial/galactic coordinate of the sky/image center. + Unit: [deg] size : (xsize, ysize) int tuple The size (width, height) of the sky/image. pixelsize : float - The pixel size of the sky/image [ arcmin ] + The pixel size of the sky/image. + Unit: [arcsec] frame : str, "ICRS" or "Galactic" The coordinate frame, only one of ``ICRS`` or ``Galactic``. projection : str, "TAN" or "CAR" @@ -31,10 +35,14 @@ def make_wcs(center, size, pixelsize, frame="ICRS", projection="TAN"): ------- w : `~astropy.wcs.WCS` Created WCS header/object + + TODO/XXX + --------- + To support other projections, e.g., ``SIN`` (common in radio astronomy). """ xcenter, ycenter = center # [ deg ] xsize, ysize = size - delt = pixelsize / 60.0 # [ deg ] + delt = pixelsize * AUC.arcsec2deg # [ deg ] if projection.upper() not in ["TAN", "CAR"]: raise ValueError("unsupported projection: " % projection) if frame.upper() == "ICRS": |