def test_wrong_force_load(self, galaxy): x = galaxy.dap['x'] y = galaxy.dap['y'] spaxel = Spaxel(x, y, plateifu=galaxy.plateifu, cube=True, maps=False, modelcube=False) with pytest.raises(AssertionError) as ee: spaxel.load(force='crap') assert 'force can only be cube, maps, or modelcube' in str(ee)
def test_force_load(self, galaxy, force): x = galaxy.dap['x'] y = galaxy.dap['y'] spaxel = Spaxel(x, y, plateifu=galaxy.plateifu, cube=True, maps=False, modelcube=False) assert spaxel.cube_quantities is not None assert spaxel.maps_quantities == {} assert spaxel.modelcube_quantities == {} spaxel.load(force=force) if force == 'cube': assert spaxel.cube_quantities is not None elif force == 'maps': assert spaxel.maps_quantities is not None elif force == 'modelcube': assert spaxel.modelcube_quantities is not None
def test_load_false(self): spaxel = Spaxel(plateifu=self.plateifu, x=15, y=16, load=False) self.assertFalse(spaxel.loaded) self.assertTrue(spaxel.cube) self.assertTrue(spaxel.maps) self.assertTrue(spaxel.modelcube) self.assertEqual(len(spaxel.properties), 0) self.assertIsNone(spaxel.spectrum) spaxel.load() self.assertIsInstance(spaxel.cube, marvin.tools.cube.Cube) self.assertIsInstance(spaxel.maps, marvin.tools.maps.Maps) self.assertIsInstance(spaxel.spectrum, Spectrum) self.assertTrue(len(spaxel.properties) > 0) self.assertIsInstance(spaxel.properties, DictOfProperties)