Exemple #1
0
    def test_getMapRatio(self, galaxy):
        maps = Maps(galaxy.plateifu)
        map_ratio = maps.getMapRatio('emline_gflux', 'nii_6585', 'ha_6564')
        map_arith = maps.emline_gflux_nii_6585 / maps.emline_gflux_ha_6564

        assert map_ratio.value == pytest.approx(map_arith.value, nan_ok=True)
        assert map_ratio.ivar == pytest.approx(map_arith.ivar, nan_ok=True)
        assert map_ratio.mask == pytest.approx(map_arith.mask, nan_ok=True)
        hbd = maps['emline_gsigma_hb_4862']
        mapplot.plot(dapmap=hbd, fig=fig, ax=ax, cb_kws=cb_kws, log_cb=1) #cbrange=(0.1,100))
        ax = fig.add_subplot(2,2,2)
        o1d = maps['emline_gsigma_oi_6302']
        mapplot.plot(dapmap=o1d, fig=fig, ax=ax, cb_kws=cb_kws, log_cb=1) #cbrange=(0.1,100))
        ax = fig.add_subplot(2,2,3)
        n2d = maps['emline_gsigma_nii_6549']
        mapplot.plot(dapmap=n2d, fig=fig, ax=ax, cb_kws=cb_kws, log_cb=1) #cbrange=(0.1,100))
        ax = fig.add_subplot(2,2,4)
        s2d = maps['emline_gsigma_sii_6718']
        mapplot.plot(dapmap=s2d, fig=fig, ax=ax, cb_kws=cb_kws, log_cb=1) #cbrange=(0.1,100))
        fig.tight_layout()
        pdf.savefig()
        plt.close()
        
        # page 5
        # ha_6564:oiid_3728 normal plot
        fig = plt.figure()
        ax = fig.add_subplot(2, 2, 1)
        h_o_ratio = Maps.getMapRatio(maps,'emline_sflux','oiid_3728','ha_6564')
        mapplot.plot(dapmap=h_o_ratio, fig=fig, ax=ax, cb_kws=cb_kws)
        # ha_6564:oiid_3728 logarithmic plot
        ax = fig.add_subplot(2, 2, 2)
        h_o_ratio = Maps.getMapRatio(maps,'emline_sflux','oiid_3728','ha_6564')
        mapplot.plot(dapmap=h_o_ratio, fig=fig, ax=ax, cb_kws=cb_kws, log_cb=1, cbrange=(0.1,100))
        fig.tight_layout()
        pdf.savefig()
        plt.close()

os.system("open %s &" % filename)