make_wcsheader

grizli.utils.make_wcsheader(ra=40.07293, dec=-1.6137748, size=2, pixscale=0.1, get_hdu=False, theta=0)[source]

Make a celestial WCS header

Parameters
ra, decfloat

Celestial coordinates in decimal degrees

size, pixscalefloat or 2-list

Size of the thumbnail, in arcsec, and pixel scale, in arcsec/pixel. Output image will have dimensions (npix,npix), where

>>> npix = size/pixscale
get_hdubool

Return a ImageHDU rather than header/wcs.

thetafloat

Position angle of the output thumbnail (degrees)

Returns
hduImageHDU

HDU with data filled with zeros if get_hdu=True.

header, wcsHeader, WCS

Header and WCS object if get_hdu=False.

Examples

>>> from grizli.utils import make_wcsheader
>>> h, wcs = make_wcsheader()
>>> print(wcs)
WCS Keywords
Number of WCS axes: 2
CTYPE : 'RA---TAN'  'DEC--TAN'
CRVAL : 40.072929999999999  -1.6137748000000001
CRPIX : 10.0  10.0
CD1_1 CD1_2  : -2.7777777777777e-05  0.0
CD2_1 CD2_2  : 0.0  2.7777777777777701e-05
NAXIS    : 20 20
>>> from grizli.utils import make_wcsheader
>>> hdu = make_wcsheader(get_hdu=True)
>>> print(hdu.data.shape)
(20, 20)
>>> print(hdu.header.tostring)
XTENSION= 'IMAGE   '           / Image extension
BITPIX  =                  -32 / array data type
NAXIS   =                    2 / number of array dimensions
PCOUNT  =                    0 / number of parameters
GCOUNT  =                    1 / number of groups
CRPIX1  =                   10
CRPIX2  =                   10
CRVAL1  =             40.07293
CRVAL2  =           -1.6137748
CD1_1   = -2.7777777777777E-05
CD1_2   =                  0.0
CD2_1   =                  0.0
CD2_2   = 2.77777777777777E-05
NAXIS1  =                   20
NAXIS2  =                   20
CTYPE1  = 'RA---TAN'
CTYPE2  = 'DEC--TAN'