Exemplo n.º 1
0
    def test_get_spaxel_test2_api(self):

        maps = marvin.tools.maps.Maps(plateifu=self.plateifu, mode='remote')
        spaxel = maps.getSpaxel(x=5, y=5)

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)
Exemplo n.º 2
0
    def test_get_spaxel_test2_file(self):

        maps = marvin.tools.maps.Maps(filename=self.filename_default)
        spaxel = maps.getSpaxel(x=5, y=5)

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)
Exemplo n.º 3
0
    def test_get_spaxel_file(self):

        maps = marvin.tools.maps.Maps(filename=self.filename_default)
        spaxel = maps.getSpaxel(x=15, y=8, xyorig='lower')

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)

        self.assertAlmostEqual(spaxel.properties['stellar_vel'].ivar,
                               1.013657e-05)
Exemplo n.º 4
0
    def test_get_spaxel_no_db(self):
        """Tests getting an spaxel if there is no DB."""

        marvin.marvindb.db = None

        maps = marvin.tools.maps.Maps(filename=self.filename_default)
        spaxel = maps.getSpaxel(x=5, y=5)

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)
Exemplo n.º 5
0
    def test_get_spaxel_getitem(self):

        maps = marvin.tools.maps.Maps(plateifu=self.plateifu, mode='local')
        spaxel = maps.getSpaxel(x=15, y=8, xyorig='lower')
        spaxel_getitem = maps[8, 15]

        self.assertTrue(isinstance(spaxel_getitem, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel_getitem.spectrum)
        self.assertTrue(len(spaxel_getitem.properties.keys()) > 0)

        self.assertAlmostEqual(spaxel_getitem.spectrum.flux[100],
                               spaxel.spectrum.flux[100])
Exemplo n.º 6
0
    def test_get_spaxel_api(self):

        maps = marvin.tools.maps.Maps(plateifu=self.plateifu,
                                      mode='remote',
                                      release='MPL-4')
        spaxel = maps.getSpaxel(x=15, y=8, xyorig='lower')

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)

        self.assertAlmostEqual(spaxel.properties['stellar_vel'].ivar,
                               1.013657e-05)
Exemplo n.º 7
0
    def test_get_spaxel_binned_maps(self):

        maps = marvin.tools.maps.Maps(plateifu=self.plateifu,
                                      bintype='VOR10',
                                      release='MPL-5')
        spaxel = maps.getSpaxel(x=15, y=8, xyorig='lower')

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNotNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)

        self.assertAlmostEqual(spaxel.properties['stellar_vel'].ivar,
                               0.00031520479546875247)
        self.assertEqual(spaxel.bintype, 'SPX')
Exemplo n.º 8
0
    def test_get_spaxel_drp_differ_from_global_api(self):

        #self._update_release('MPL-5')
        marvin.config.setMPL('MPL-5')

        maps = marvin.tools.maps.Maps(plateifu=self.plateifu,
                                      mode='remote',
                                      release='MPL-4')
        spaxel = maps.getSpaxel(x=15, y=8, xyorig='lower', spectrum=False)

        self.assertTrue(isinstance(spaxel, marvin.tools.spaxel.Spaxel))
        self.assertIsNone(spaxel.spectrum)
        self.assertTrue(len(spaxel.properties.keys()) > 0)

        self.assertAlmostEqual(spaxel.properties['stellar_vel'].ivar,
                               1.013657e-05)