Skip to content

Commit 9403162

Browse files
committed
add a test case for radio cubes
1 parent 11269b0 commit 9403162

2 files changed

Lines changed: 43 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
SIMPLE = T /
2+
BITPIX = -32 / NAXIS = 3 /
3+
NAXIS1 = 256 /
4+
NAXIS2 = 256 /
5+
NAXIS3 = 63 /
6+
EQUINOX = 2.000000000E+03 /Epoch of RA DEC
7+
CTYPE1 = 'RA---SIN' /
8+
CRVAL1 = 1.81046666667E+02 /
9+
CDELT1 = -1.388888923E-03 /
10+
CRPIX1 = 1.280000000E+02 /
11+
CROTA1 = 0.000000000E+00 /
12+
CTYPE2 = 'DEC--SIN' /
13+
CRVAL2 = 1.84433333333E+01 /
14+
CDELT2 = 1.388888923E-03 /
15+
CRPIX2 = 1.290000000E+02 /
16+
CROTA2 = 0.000000000E+00 /
17+
CTYPE3 = 'FREQ ' /
18+
CRVAL3 = 1.41604138193E+09 /
19+
CDELT3 = 4.882812500E+04 /
20+
CRPIX3 = 3.200000000E+01 /
21+
CROTA3 = 0.000000000E+00 /

‎pyregion/tests/test_cube.py‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import os
2+
from os.path import join
3+
from astropy.io.fits import Header
4+
from astropy.wcs import WCS
5+
from .. import parse
6+
7+
rootdir = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'examples')
8+
9+
10+
def demo_header():
11+
return Header.fromtextfile(join(rootdir, "sample_fits03.header"))
12+
13+
#
14+
def test_cube():
15+
16+
header = demo_header()
17+
18+
region_string = 'circle(12:04:15.065,+18:26:51.00,173.029")'
19+
parse(region_string).as_imagecoord(header)
20+
21+
wcs = WCS(header)
22+
parse(region_string).as_imagecoord(wcs)

0 commit comments

Comments
 (0)