Exemple #1
0
def plot_bpt_boundry(axs):
    # Plots the classification boundary lines
    xx_sf_nii = np.linspace(-1.281, 0.045, int(1e4))
    xx_sf_sii = np.linspace(-2, 0.315, int(1e4))
    xx_sf_oi = np.linspace(-2.5, -0.7, int(1e4))
    xx_comp_nii = np.linspace(-2, 0.4, int(1e4))
    xx_agn_sii = np.array([-0.308, 1.0])
    xx_agn_oi = np.array([-1.12, 0.5])
    # xlims = [ax.get_xlim() for ax in axs]
    # ylims = [ax.get_ylim() for ax in axs]
    xlims = [(-2, 0.5), (-1.5, 0.5), (-2.5, 0.0)]
    ylims = [(-1.5, 1.3), (-1.5, 1.3), (-1.5, 1.3)]
    xlabels = [
        r'log([NII]/H$\alpha$)', r'log([SII]/H$\alpha$)',
        r'log([OI]/H$\alpha$)'
    ]
    axs[0].plot(xx_sf_nii, bpt.kewley_sf_nii(xx_sf_nii), 'k--', zorder=90)
    axs[0].plot(xx_comp_nii, bpt.kewley_comp_nii(xx_comp_nii), 'k-', zorder=90)
    axs[1].plot(xx_sf_sii, bpt.kewley_sf_sii(xx_sf_sii), 'k-', zorder=90)
    axs[1].plot(xx_agn_sii, bpt.kewley_agn_sii(xx_agn_sii), 'k-', zorder=80)
    axs[2].plot(xx_sf_oi, bpt.kewley_sf_oi(xx_sf_oi), 'k-', zorder=90)
    axs[2].plot(xx_agn_oi, bpt.kewley_agn_oi(xx_agn_oi), 'k-', zorder=80)
    for ax, xlim, ylim, xlabel in zip(axs, xlims, ylims, xlabels):
        ax.set_ylabel(r'log([OIII]/H$\beta$)')
        ax.set_xlabel(xlabel)
        ax.set_xlim(*xlim)
        ax.set_ylim(*ylim)
    axs[0].legend(loc=3)
 def get_bpt(self, snr_min=3, oi_sf=False):
     self.get_cube(maps=True)
     if self.cube != 'no_data':
         # Gets the necessary emission line maps
         oiii = bpt.get_masked(self.maps,
                               'oiii_5008',
                               snr=bpt.get_snr(snr_min, 'oiii'))
         nii = bpt.get_masked(self.maps,
                              'nii_6585',
                              snr=bpt.get_snr(snr_min, 'nii'))
         ha = bpt.get_masked(self.maps,
                             'ha_6564',
                             snr=bpt.get_snr(snr_min, 'ha'))
         hb = bpt.get_masked(self.maps,
                             'hb_4862',
                             snr=bpt.get_snr(snr_min, 'hb'))
         sii = bpt.get_masked(self.maps,
                              'sii_6718',
                              snr=bpt.get_snr(snr_min, 'sii'))
         oi = bpt.get_masked(self.maps,
                             'oi_6302',
                             snr=bpt.get_snr(snr_min, 'oi'))
         self.log_oiii_hb = np.ma.log10(oiii / hb)
         self.log_nii_ha = np.ma.log10(nii / ha)
         self.log_sii_ha = np.ma.log10(sii / ha)
         self.log_oi_ha = np.ma.log10(oi / ha)
         sf_mask_nii = (
             (self.log_oiii_hb < bpt.kewley_sf_nii(self.log_nii_ha)) &
             (self.log_nii_ha < 0.05)).filled(False)
         sf_mask_sii = (
             (self.log_oiii_hb < bpt.kewley_sf_sii(self.log_sii_ha)) &
             (self.log_sii_ha < 0.32)).filled(False)
         sf_mask_oi = ((self.log_oiii_hb < bpt.kewley_sf_oi(self.log_oi_ha))
                       & (self.log_oi_ha < -0.59)).filled(False)
         if oi_sf:
             self.sf_mask = sf_mask_nii & sf_mask_sii & sf_mask_oi
         else:
             self.sf_mask = sf_mask_nii & sf_mask_sii