Add fgst I/O tests for WcsNDMap.
@@ -80,6 +80,31 @@ def test_wcsndmap_read_write(tmpdir, npix, binsz, coordsys, proj, skydir, axes):
assert_allclose(m0.data, m3.data)
+def test_wcsndmap_read_write_fgst(tmpdir):
+ filename = str(tmpdir / 'skycube.fits')
+
+ axis = MapAxis.from_bounds(100., 1000., 4, name='energy', unit='MeV')
+ geom = WcsGeom.create(npix=10, binsz=1.0,
+ proj='AIT', coordsys='GAL', axes=[axis])
+
+ # Test Counts Cube
+ m = WcsNDMap(geom)
+ m.write(filename, conv='fgst-ccube')
+ h = fits.open(filename)
+ assert('EBOUNDS' in h)
+
+ m2 = Map.read(filename)
+ assert(m2.geom.conv == 'fgst-ccube')
+
+ # Test Model Cube
+ m.write(filename, conv='fgst-template')
+ h = fits.open(filename)
+ assert('ENERGIES' in h)
+
+ m2 = Map.read(filename)
+ assert(m2.geom.conv == 'fgst-template')
+
+
@pytest.mark.parametrize(('npix', 'binsz', 'coordsys', 'proj', 'skydir', 'axes'),
wcs_test_geoms)
def test_wcsndmap_set_get_by_pix(npix, binsz, coordsys, proj, skydir, axes):
