Add test from_aligned against cutout
@@ -152,6 +152,25 @@ def test_wcs_geom_from_aligned(npix, binsz, frame, proj, skydir, axes):
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="TAN", 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_wcsgeom_solid_angle():
# Test using a CAR projection map with an extra axis
binsz = 1.0 * u.deg
