def test_model_deprecated(self, galaxy, exporigin): if exporigin != 'db': pytest.skip() maps = Maps(**self._get_maps_kwargs(galaxy, exporigin)) with pytest.raises(MarvinDeprecationError) as ee: maps.getSpaxel(x=0, y=0, model=True) assert 'the model parameter has been deprecated. Use models.' in str(ee)
def test_deprecated(self, galaxy, exporigin): if exporigin != 'db': pytest.skip() maps = Maps(**self._get_maps_kwargs(galaxy, exporigin)) for old_arg in ['drp', 'model', 'models']: with pytest.raises(MarvinDeprecationError) as ee: kwargs = {old_arg: True} maps.getSpaxel(x=0, y=0, **kwargs) assert 'the {0} parameter has been deprecated.'.format(old_arg) in str(ee)
def test_pickling_data(self, temp_scratch, galaxy): drpver, __ = config.lookUpVersions() maps = Maps(filename=galaxy.mapspath) modelcube = ModelCube(filename=galaxy.modelpath) spaxel = maps.getSpaxel(25, 15, xyorig='lower', drp=False, models=modelcube) file = temp_scratch.join('test_spaxel.mpf') path_saved = spaxel.save(str(file), overwrite=True) assert file.check() is True assert os.path.exists(path_saved) del spaxel spaxel_restored = Spaxel.restore(str(file)) assert spaxel_restored.stellar_vel.value is not None assert spaxel_restored.stellar_vel.bin.binid is not None
def test_quality_flags(self, galaxy): maps = Maps(plateifu=galaxy.plateifu) sp = maps.getSpaxel(0, 0, modelcube=True) assert len(sp.quality_flags) == 2