def test_wcs_geom_from_aligned(npix, binsz, frame, proj, skydir, axes): geom = WcsGeom.create( npix=npix, binsz=binsz, skydir=(0, 0), proj=proj, frame=frame, axes=axes ) aligned_geom = WcsGeom.from_aligned(geom=geom, skydir=(2, 3), width="90 deg") assert aligned_geom.is_aligned(geom)
def test_from_aligned_vs_cutout(): skydir = SkyCoord(0.12, -0.34, unit="deg", frame="galactic") geom = WcsGeom.create(binsz=0.1, skydir=skydir, proj="AIT", frame="galactic") position = SkyCoord("2.23d", "3.102d", frame="galactic") width = ("89 deg", "79 deg") aligned_geom = WcsGeom.from_aligned(geom=geom, skydir=position, width=width) geom_cutout = geom.cutout(position=position, width=width) assert geom_cutout == aligned_geom
def test_from_aligned_vs_cutout_tan(): skydir = SkyCoord(0, 0, unit="deg", frame="galactic") geom = WcsGeom.create( binsz=1, skydir=skydir, proj="TAN", frame="galactic", width=("180d", "90d") ) position = SkyCoord("53.23d", "22.102d", frame="galactic") width = ("17 deg", "15 deg") geom_cutout = geom.cutout(position=position, width=width, mode="partial") aligned_geom = WcsGeom.from_aligned(geom=geom, skydir=position, width=width) assert aligned_geom == geom_cutout